Skip to content

Commit 2b571d5

Browse files
committed
[build-script] Add an option to only run executable tests. Off by default.
1 parent 967f1e6 commit 2b571d5

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

utils/build-script

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ class HostSpecificConfiguration(object):
182182
if test:
183183
if test_host_only:
184184
suffix = "-only_non_executable"
185+
elif args.only_executable_test:
186+
suffix = "-only_executable"
185187
else:
186188
suffix = ""
187189
subset_suffix = ""
@@ -730,6 +732,8 @@ class BuildScriptInvocation(object):
730732
impl_args += ["--long-test"]
731733
if args.stress_test:
732734
impl_args += ["--stress-test"]
735+
if args.only_executable_test:
736+
impl_args += ["--only-executable-test"]
733737
if not args.benchmark:
734738
impl_args += ["--skip-test-benchmarks"]
735739
if not args.test_optimized:

utils/build-script-impl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ KNOWN_SETTINGS=(
178178
skip-test-optimize-none-implicit-dynamic "" "set to skip testing the test suite in optimize none with implicit dynamic mode"
179179
skip-test-sourcekit "" "set to skip testing SourceKit"
180180
stress-test-sourcekit "" "set to run the stress-SourceKit target"
181+
only-executable-test "" "only run the executable variant of the swift lit tests"
181182
workspace "${HOME}/src" "source directory containing llvm, clang, swift"
182183
enable-llvm-assertions "1" "set to enable llvm assertions"
183184
build-llvm "1" "set to 1 to build LLVM and Clang"
@@ -1482,6 +1483,8 @@ function calculate_targets_for_host() {
14821483
test_target_suffix=""
14831484
if [[ -n "${test_host_only}" ]] ; then
14841485
test_target_suffix="-only_non_executable"
1486+
elif [[ -n "${ONLY_EXECUTABLE_TEST}" ]] ; then
1487+
test_target_suffix="-only_executable"
14851488
fi
14861489

14871490
test_subset_target_suffix=""

utils/build_swift/driver_arguments.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,10 @@ def create_argument_parser():
776776
option('--host-test', toggle_true,
777777
help='run executable tests on host devices (such as iOS or tvOS)')
778778

779+
option('--only-executable-test', toggle_true,
780+
help='Only run executable tests. Does nothing if host-test is not '
781+
'allowed')
782+
779783
option('--test-paths', append,
780784
type=argparse.ShellSplitType(),
781785
help='run tests located in specific directories and/or files '

utils/build_swift/tests/expected_options.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
'host_lipo': None,
141141
'host_target': targets.StdlibDeploymentTarget.host_target().name,
142142
'host_test': False,
143+
'only_executable_test': False,
143144
'install_prefix': targets.install_prefix(),
144145
'install_symroot': None,
145146
'install_destdir': None,
@@ -450,6 +451,7 @@ class IgnoreOption(_BaseOption):
450451
EnableOption('--export-compile-commands'),
451452
EnableOption('--foundation', dest='build_foundation'),
452453
EnableOption('--host-test'),
454+
EnableOption('--only-executable-test'),
453455
EnableOption('--libdispatch', dest='build_libdispatch'),
454456
EnableOption('--libicu', dest='build_libicu'),
455457
EnableOption('--indexstore-db', dest='build_indexstoredb'),

0 commit comments

Comments
 (0)