aboutsummaryrefslogtreecommitdiff
path: root/utils/lit/Test.py
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-12-26 22:58:23 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-12-26 22:58:23 +0000
commitd24f1f342a4637756297117ead63e2e966999126 (patch)
tree4b0ee99babcd8cb15a55dfb61065bf855a1047af /utils/lit/Test.py
parentba7b1c4db4ae5250564f5cab53e8f0f35c661a94 (diff)
lit: Sink code into a 'lit' package.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92168 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/lit/Test.py')
-rw-r--r--utils/lit/Test.py79
1 files changed, 0 insertions, 79 deletions
diff --git a/utils/lit/Test.py b/utils/lit/Test.py
deleted file mode 100644
index 1f6556ba85..0000000000
--- a/utils/lit/Test.py
+++ /dev/null
@@ -1,79 +0,0 @@
-import os
-
-# Test results.
-
-class TestResult:
- def __init__(self, name, isFailure):
- self.name = name
- self.isFailure = isFailure
-
-PASS = TestResult('PASS', False)
-XFAIL = TestResult('XFAIL', False)
-FAIL = TestResult('FAIL', True)
-XPASS = TestResult('XPASS', True)
-UNRESOLVED = TestResult('UNRESOLVED', True)
-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.
-
- A test suite groups together a set of logically related tests.
- """
-
- def __init__(self, name, source_root, exec_root, config):
- self.name = name
- self.source_root = source_root
- self.exec_root = exec_root
- # The test suite configuration.
- self.config = config
-
- def getSourcePath(self, components):
- return os.path.join(self.source_root, *components)
-
- def getExecPath(self, components):
- return os.path.join(self.exec_root, *components)
-
-class Test:
- """Test - Information on a single test instance."""
-
- def __init__(self, suite, path_in_suite, config):
- self.suite = suite
- self.path_in_suite = path_in_suite
- self.config = config
- # The test result code, once complete.
- self.result = None
- # Any additional output from the test, once complete.
- self.output = None
- # The wall time to execute this test, if timing and once complete.
- self.elapsed = None
- # The repeat index of this test, or None.
- self.index = None
-
- def copyWithIndex(self, index):
- import copy
- res = copy.copy(self)
- res.index = index
- return res
-
- def setResult(self, result, output, elapsed):
- assert self.result is None, "Test result already set!"
- self.result = result
- self.output = output
- self.elapsed = elapsed
-
- def getFullName(self):
- return self.suite.config.name + '::' + '/'.join(self.path_in_suite)
-
- def getSourcePath(self):
- return self.suite.getSourcePath(self.path_in_suite)
-
- def getExecPath(self):
- return self.suite.getExecPath(self.path_in_suite)