run_wml_tests: --batch-disable is a special case of --batch-max so implement it as such

This commit is contained in:
Celtic Minstrel 2021-03-03 03:08:50 -05:00 committed by Celtic Minstrel
parent 0e7f19462e
commit 208a347dba

View file

@ -249,10 +249,10 @@ if __name__ == '__main__':
help="New timer value to use, instead of 10s as default. The value 0 means no timer, and also skips tests that expect timeout.")
ap.add_argument("-bt", "--batch-timeout", type=int, default=300,
help="New timer value to use for batched tests, instead of 300s as default.")
ap.add_argument("-bd", "--batch-disable", action="store_true",
help="Disable test batching, may be useful if debugging a small subset of tests.")
ap.add_argument("-bm", "--batch-max", type=int, default=0,
help="Maximum number of tests to do in a batch. Default no limit.")
ap.add_argument("-bd", "--batch-disable", action="store_const", const=1, dest='batch_max',
help="Disable test batching, may be useful if debugging a small subset of tests. Equivalent to --batch-max=1")
ap.add_argument("-s", "--no-strict", dest="strict_mode", action="store_false",
help="Disable strict mode. By default, we run wesnoth with the option --log-strict=warning to ensure errors result in a failed test.")
ap.add_argument("-d", "--debug_bin", action="store_true",
@ -283,7 +283,7 @@ if __name__ == '__main__':
if options.verbose > 1:
print(repr(options))
batcher = test_nobatcher if options.batch_disable else test_batcher
batcher = test_nobatcher if options.batch_max == 1 else test_batcher
test_list, test_summary = TestListParser(options).get(batcher)
runner = WesnothRunner(options)