build-script: allow combining '-t' and '-T' with other options again

This fixes a regression from PR #2213.

We needed a way to disable testing in a preset, even though previous
flags already requested tests.  So I added an argument to the '--test'
and '--validation-test' flags.  The argparse module treats '-T' and
'--validation-test' the same, so it thinks that in -RTi the 'i' is an
argument to '-T'.
This commit is contained in:
Dmitri Gribenko
2016-04-19 09:36:31 -07:00
parent e67acdb70d
commit a22d8569d4

View File

@@ -538,15 +538,29 @@ details of the setups of other systems or automated environments.""")
run_tests_group = parser.add_argument_group(
title="Run tests")
run_tests_group.add_argument(
"-t", "--test",
"-t",
help="test Swift after building",
action="store_const",
const=True,
dest="test")
run_tests_group.add_argument(
"--test",
help="test Swift after building",
metavar="BOOL",
nargs='?',
type=argparse_bool,
default=False,
const=True)
run_tests_group.add_argument(
"-T", "--validation-test",
"-T",
help="run the validation test suite (implies --test)",
action="store_const",
const=True,
dest="validation_test")
run_tests_group.add_argument(
"--validation-test",
help="run the validation test suite (implies --test)",
metavar="BOOL",
nargs='?',
type=argparse_bool,
default=False,