diff options
author | Daniel Dunbar <daniel@zuster.org> | 2013-01-31 01:23:39 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2013-01-31 01:23:39 +0000 |
commit | 47896090f30fe9f37a776b46e285b1d6d8b1ad9b (patch) | |
tree | 1fd5c03bb9a0f441cfe47a050767873024345818 /utils/lit/lit | |
parent | c9fd0a57f7ab21e8d48474f862faf896cd196941 (diff) | |
download | llvm-47896090f30fe9f37a776b46e285b1d6d8b1ad9b.tar.gz llvm-47896090f30fe9f37a776b46e285b1d6d8b1ad9b.tar.bz2 llvm-47896090f30fe9f37a776b46e285b1d6d8b1ad9b.tar.xz |
[lit] Move unittest adaptor code into discovery module.
- Also, add a test for it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174019 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/lit/lit')
-rw-r--r-- | utils/lit/lit/discovery.py | 26 | ||||
-rwxr-xr-x | utils/lit/lit/main.py | 22 |
2 files changed, 25 insertions, 23 deletions
diff --git a/utils/lit/lit/discovery.py b/utils/lit/lit/discovery.py index 830c5dea02..c869a671ef 100644 --- a/utils/lit/lit/discovery.py +++ b/utils/lit/lit/discovery.py @@ -6,7 +6,7 @@ import os import sys from lit.TestingConfig import TestingConfig -from lit import Test +from lit import LitConfig, Test def dirContainsTestSuite(path, lit_config): cfgpath = os.path.join(path, lit_config.site_config_name) @@ -208,3 +208,27 @@ def find_tests_for_inputs(lit_config, inputs): sys.exit(2) return tests + +def load_test_suite(inputs): + import platform + import unittest + from lit.LitTestCase import LitTestCase + + # Create the global config object. + litConfig = LitConfig.LitConfig(progname = 'lit', + path = [], + quiet = False, + useValgrind = False, + valgrindLeakCheck = False, + valgrindArgs = [], + noExecute = False, + ignoreStdErr = False, + debug = False, + isWindows = (platform.system()=='Windows'), + params = {}) + + tests = find_tests_for_inputs(litConfig, inputs) + + # Return a unittest test suite which just runs the tests in order. + return unittest.TestSuite([LitTestCase(test, litConfig) for test in tests]) + diff --git a/utils/lit/lit/main.py b/utils/lit/lit/main.py index 5a3b11cde7..da961eeedc 100755 --- a/utils/lit/lit/main.py +++ b/utils/lit/lit/main.py @@ -148,28 +148,6 @@ def runTests(numThreads, litConfig, provider, display): except KeyboardInterrupt: sys.exit(2) -def load_test_suite(inputs): - import unittest - - # Create the global config object. - litConfig = LitConfig.LitConfig(progname = 'lit', - path = [], - quiet = False, - useValgrind = False, - valgrindLeakCheck = False, - valgrindArgs = [], - noExecute = False, - ignoreStdErr = False, - debug = False, - isWindows = (platform.system()=='Windows'), - params = {}) - - tests = lit.discovery.find_tests_for_inputs(litConfig, inputs) - - # Return a unittest test suite which just runs the tests in order. - from LitTestCase import LitTestCase - return unittest.TestSuite([LitTestCase(test, litConfig) for test in tests]) - def main(builtinParameters = {}): # Bump the GIL check interval, its more important to get any one thread to a # blocking operation (hopefully exec) than to try and unblock other threads. |