summaryrefslogtreecommitdiffstats
path: root/llvm/utils/lit/lit.py
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-10-25 03:30:55 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-10-25 03:30:55 +0000
commita4ea29e3626b72639839a90e84d4b386e2125023 (patch)
treeea96093cde90569dfc6e09fcbab1ef6a314fe296 /llvm/utils/lit/lit.py
parentefd3e907b450c513e1f3baf1904abb9cc30d3980 (diff)
downloadbcm5719-llvm-a4ea29e3626b72639839a90e84d4b386e2125023.tar.gz
bcm5719-llvm-a4ea29e3626b72639839a90e84d4b386e2125023.zip
lit: Add --config-prefix option, to override default config file names.
llvm-svn: 85035
Diffstat (limited to 'llvm/utils/lit/lit.py')
-rwxr-xr-xllvm/utils/lit/lit.py27
1 files changed, 20 insertions, 7 deletions
diff --git a/llvm/utils/lit/lit.py b/llvm/utils/lit/lit.py
index 5b24286e22f..a856473c228 100755
--- a/llvm/utils/lit/lit.py
+++ b/llvm/utils/lit/lit.py
@@ -16,9 +16,13 @@ from TestingConfig import TestingConfig
import LitConfig
import Test
+# Configuration files to look for when discovering test suites. These can be
+# overridden with --config-prefix.
+#
# FIXME: Rename to 'config.lit', 'site.lit', and 'local.lit' ?
-kConfigName = 'lit.cfg'
-kSiteConfigName = 'lit.site.cfg'
+gConfigName = 'lit.cfg'
+gSiteConfigName = 'lit.site.cfg'
+
kLocalConfigName = 'lit.local.cfg'
class TestingProgressDisplay:
@@ -134,10 +138,10 @@ class Tester(threading.Thread):
self.display.update(test)
def dirContainsTestSuite(path):
- cfgpath = os.path.join(path, kSiteConfigName)
+ cfgpath = os.path.join(path, gSiteConfigName)
if os.path.exists(cfgpath):
return cfgpath
- cfgpath = os.path.join(path, kConfigName)
+ cfgpath = os.path.join(path, gConfigName)
if os.path.exists(cfgpath):
return cfgpath
@@ -268,7 +272,7 @@ def getTestsInSuite(ts, path_in_suite, litConfig,
file_sourcepath = os.path.join(source_path, filename)
if not os.path.isdir(file_sourcepath):
continue
-
+
# Check for nested test suites, first in the execpath in case there is a
# site configuration and then in the source path.
file_execpath = ts.getExecPath(path_in_suite + (filename,))
@@ -283,7 +287,7 @@ def getTestsInSuite(ts, path_in_suite, litConfig,
subiter = getTestsInSuite(ts, path_in_suite + (filename,),
litConfig, testSuiteCache,
localConfigCache)
-
+
for res in subiter:
yield res
@@ -314,6 +318,9 @@ def main():
parser.add_option("-j", "--threads", dest="numThreads", metavar="N",
help="Number of testing threads",
type=int, action="store", default=None)
+ parser.add_option("", "--config-prefix", dest="configPrefix",
+ metavar="NAME", help="Prefix for 'lit' config files",
+ action="store", default=None)
group = OptionGroup(parser, "Output Format")
# FIXME: I find these names very confusing, although I like the
@@ -379,6 +386,11 @@ def main():
if not args:
parser.error('No inputs specified')
+ if opts.configPrefix is not None:
+ global gConfigName, gSiteConfigName
+ gConfigName = '%s.cfg' % opts.configPrefix
+ gSiteConfigName = '%s.site.cfg' % opts.configPrefix
+
if opts.numThreads is None:
opts.numThreads = Util.detectCPUs()
@@ -413,7 +425,8 @@ def main():
if opts.showSuites:
suitesAndTests = dict([(ts,[])
- for ts,_ in testSuiteCache.values()])
+ for ts,_ in testSuiteCache.values()
+ if ts])
for t in tests:
suitesAndTests[t.suite].append(t)
OpenPOWER on IntegriCloud