[lit] Extract TestFormat base class, for future use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188945 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2013-08-21 22:26:26 +00:00
parent bf9d6e5c37
commit 7b0cdf7bf4
4 changed files with 10 additions and 10 deletions

View 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.

View 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

View 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.

View 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)