[lit] Extract TestFormat base class, for future use.
authorDaniel Dunbar <daniel@zuster.org>
Wed, 21 Aug 2013 22:26:26 +0000 (22:26 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 21 Aug 2013 22:26:26 +0000 (22:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188945 91177308-0d34-0410-b5e6-96231b3b80d8

utils/lit/lit/Test.py
utils/lit/lit/formats/__init__.py
utils/lit/lit/formats/base.py
utils/lit/lit/formats/googletest.py

index cf12425902f6897d54f8f030ddc812848f25d372..dc2a435c2f0f6ef3ac99646a601e8307ab77c9fe 100644 (file)
@@ -20,12 +20,6 @@ UNSUPPORTED = TestResult('UNSUPPORTED', False)
 
 # Test classes.
 
-class TestFormat:
-    """TestFormat - Test information provider."""
-
-    def __init__(self, name):
-        self.name = name
-
 class TestSuite:
     """TestSuite - Information on a group of tests.
 
index f4a303c4c5d0eed823c2fdc190ab660e0bd935d7..68627084176a59f0fdf93d2282ec0454ac0aff70 100644 (file)
@@ -1,4 +1,4 @@
 from __future__ import absolute_import
-from lit.formats.base import FileBasedTest, OneCommandPerFileTest
+from lit.formats.base import TestFormat, FileBasedTest, OneCommandPerFileTest
 from lit.formats.googletest import GoogleTest
 from lit.formats.shtest import ShTest
index b384ec2f0ce962ed60fb20c79dbacf3cd22b7170..9e5420ba7672c96edc7303bd3a02f4324136f62d 100644 (file)
@@ -5,7 +5,12 @@ import sys
 import lit.Test
 import lit.util
 
-class FileBasedTest(object):
+class TestFormat(object):
+    pass
+
+###
+
+class FileBasedTest(TestFormat):
     def getTestsInDirectory(self, testSuite, path_in_suite,
                             litConfig, localConfig):
         source_path = testSuite.getSourcePath(path_in_suite)
@@ -27,7 +32,7 @@ class FileBasedTest(object):
 import re
 import tempfile
 
-class OneCommandPerFileTest:
+class OneCommandPerFileTest(TestFormat):
     # FIXME: Refactor into generic test for running some command on a directory
     # of inputs.
 
index 8465a0b90905ab216689208aaa124e0f4708a108..b77e184d2f6dcce208f2b7b77e906d84a3779eb2 100644 (file)
@@ -5,10 +5,11 @@ import sys
 import lit.Test
 import lit.TestRunner
 import lit.util
+from .base import TestFormat
 
 kIsWindows = sys.platform in ['win32', 'cygwin']
 
-class GoogleTest(object):
+class GoogleTest(TestFormat):
     def __init__(self, test_sub_dir, test_suffix):
         self.test_sub_dir = os.path.normcase(str(test_sub_dir)).split(';')
         self.test_suffix = str(test_suffix)