Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
utils/lit/lit/main.py
Show First 20 Lines • Show All 267 Lines • ▼ Show 20 Lines | group.add_option("", "--show-tests", dest="showTests", | ||||
help="Show all discovered tests", | help="Show all discovered tests", | ||||
action="store_true", default=False) | action="store_true", default=False) | ||||
group.add_option("", "--use-processes", dest="useProcesses", | group.add_option("", "--use-processes", dest="useProcesses", | ||||
help="Run tests in parallel with processes (not threads)", | help="Run tests in parallel with processes (not threads)", | ||||
action="store_true", default=True) | action="store_true", default=True) | ||||
group.add_option("", "--use-threads", dest="useProcesses", | group.add_option("", "--use-threads", dest="useProcesses", | ||||
help="Run tests in parallel with threads (not processes)", | help="Run tests in parallel with threads (not processes)", | ||||
action="store_false", default=True) | action="store_false", default=True) | ||||
group.add_option("", "--xfail-requires-pr", dest="xFailRequirePR", | |||||
help="Require PRs for XFAIL tests", | |||||
action="store_true", default=False) | |||||
parser.add_option("", "--bug-tracker-prefix", dest="bugTrackerPrefixes", | |||||
metavar="", | |||||
help=("Prefixes for specifying bugs in XFAIL directives " | |||||
"(defaults to include http://llvm.org/PR)"), | |||||
type=str, action="append", default=['http://llvm.org/PR']) | |||||
parser.add_option_group(group) | parser.add_option_group(group) | ||||
(opts, args) = parser.parse_args() | (opts, args) = parser.parse_args() | ||||
if opts.show_version: | if opts.show_version: | ||||
print("lit %s" % (lit.__version__,)) | print("lit %s" % (lit.__version__,)) | ||||
return | return | ||||
Show All 27 Lines | # threads by default there. | ||||
# Decide what the requested maximum indvidual test time should be | # Decide what the requested maximum indvidual test time should be | ||||
if opts.maxIndividualTestTime != None: | if opts.maxIndividualTestTime != None: | ||||
maxIndividualTestTime = opts.maxIndividualTestTime | maxIndividualTestTime = opts.maxIndividualTestTime | ||||
else: | else: | ||||
# Default is zero | # Default is zero | ||||
maxIndividualTestTime = 0 | maxIndividualTestTime = 0 | ||||
isWindows = platform.system() == 'Windows' | isWindows = platform.system() == 'Windows' | ||||
bugTrackerRegex = re.compile('^' + '|^'.join(opts.bugTrackerPrefixes)) | |||||
# Create the global config object. | # Create the global config object. | ||||
litConfig = lit.LitConfig.LitConfig( | litConfig = lit.LitConfig.LitConfig( | ||||
progname = os.path.basename(sys.argv[0]), | progname = os.path.basename(sys.argv[0]), | ||||
path = opts.path, | path = opts.path, | ||||
quiet = opts.quiet, | quiet = opts.quiet, | ||||
useValgrind = opts.useValgrind, | useValgrind = opts.useValgrind, | ||||
valgrindLeakCheck = opts.valgrindLeakCheck, | valgrindLeakCheck = opts.valgrindLeakCheck, | ||||
valgrindArgs = opts.valgrindArgs, | valgrindArgs = opts.valgrindArgs, | ||||
noExecute = opts.noExecute, | noExecute = opts.noExecute, | ||||
debug = opts.debug, | debug = opts.debug, | ||||
isWindows = isWindows, | isWindows = isWindows, | ||||
params = userParams, | params = userParams, | ||||
config_prefix = opts.configPrefix, | config_prefix = opts.configPrefix, | ||||
maxIndividualTestTime = maxIndividualTestTime, | maxIndividualTestTime = maxIndividualTestTime, | ||||
maxFailures = opts.maxFailures) | maxFailures = opts.maxFailures, | ||||
xFailRequirePR = opts.xFailRequirePR, | |||||
bugTrackerRegex = bugTrackerRegex) | |||||
# Perform test discovery. | # Perform test discovery. | ||||
run = lit.run.Run(litConfig, | run = lit.run.Run(litConfig, | ||||
lit.discovery.find_tests_for_inputs(litConfig, inputs)) | lit.discovery.find_tests_for_inputs(litConfig, inputs)) | ||||
# After test discovery the configuration might have changed | # After test discovery the configuration might have changed | ||||
# the maxIndividualTestTime. If we explicitly set this on the | # the maxIndividualTestTime. If we explicitly set this on the | ||||
# command line then override what was set in the test configuration | # command line then override what was set in the test configuration | ||||
▲ Show 20 Lines • Show All 222 Lines • Show Last 20 Lines |