mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
lit: Add --config-prefix option, to override default config file names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85035 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -49,6 +49,11 @@ Show the B<lit> help message.
|
||||
Run I<N> tests in parallel. By default, this is automatically chose to match the
|
||||
number of detected available CPUs.
|
||||
|
||||
=item B<--config-prefix>=I<NAME>
|
||||
|
||||
Search for I<NAME.cfg> and I<NAME.site.cfg> when searching for test suites,
|
||||
instead I<lit.cfg> and I<lit.site.cfg>.
|
||||
|
||||
=back
|
||||
|
||||
=head1 OUTPUT OPTIONS
|
||||
|
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user