Skip to content

Commit f846709

Browse files
committed
Force swift.compile_in_parallel in the tests that depend on looking up specific mnemonics.
1 parent 1fc74f6 commit f846709

File tree

7 files changed

+38
-25
lines changed

7 files changed

+38
-25
lines changed

test/coverage_settings_tests.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def coverage_settings_test_suite(name, tags = []):
4646
"-profile-coverage-mapping",
4747
"-Xwrapped-swift=-coverage-prefix-pwd-is-dot",
4848
],
49-
mnemonic = "SwiftCompile",
49+
mnemonic = "SwiftCompileModule",
5050
target_under_test = "//test/fixtures/debug_settings:simple",
5151
)
5252

@@ -60,7 +60,7 @@ def coverage_settings_test_suite(name, tags = []):
6060
not_expected_argv = [
6161
"-Xwrapped-swift=-coverage-prefix-pwd-is-dot",
6262
],
63-
mnemonic = "SwiftCompile",
63+
mnemonic = "SwiftCompileModule",
6464
target_under_test = "//test/fixtures/debug_settings:simple",
6565
)
6666

@@ -72,6 +72,6 @@ def coverage_settings_test_suite(name, tags = []):
7272
"__BAZEL_XCODE_DEVELOPER_DIR__=/PLACEHOLDER_DEVELOPER_DIR",
7373
],
7474
target_compatible_with = ["@platforms//os:macos"],
75-
mnemonic = "SwiftCompile",
75+
mnemonic = "SwiftCompileModule",
7676
target_under_test = "//test/fixtures/debug_settings:simple",
7777
)

test/debug_settings_tests.bzl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def debug_settings_test_suite(name, tags = []):
144144
"-Xfrontend -no-serialize-debugging-options",
145145
"-gline-tables-only",
146146
],
147-
mnemonic = "SwiftCompile",
147+
mnemonic = "SwiftCompileModule",
148148
tags = all_tags,
149149
target_under_test = "//test/fixtures/debug_settings:simple",
150150
)
@@ -158,7 +158,7 @@ def debug_settings_test_suite(name, tags = []):
158158
not_expected_argv = [
159159
"-Xwrapped-swift=-debug-prefix-pwd-is-dot",
160160
],
161-
mnemonic = "SwiftCompile",
161+
mnemonic = "SwiftCompileModule",
162162
tags = all_tags,
163163
target_under_test = "//test/fixtures/debug_settings:simple",
164164
)
@@ -179,7 +179,7 @@ def debug_settings_test_suite(name, tags = []):
179179
"-Xfrontend -serialize-debugging-options",
180180
"-gline-tables-only",
181181
],
182-
mnemonic = "SwiftCompile",
182+
mnemonic = "SwiftCompileModule",
183183
tags = all_tags,
184184
target_under_test = "//test/fixtures/debug_settings:simple",
185185
)
@@ -199,7 +199,7 @@ def debug_settings_test_suite(name, tags = []):
199199
"-Xfrontend -no-serialize-debugging-options",
200200
"-g",
201201
],
202-
mnemonic = "SwiftCompile",
202+
mnemonic = "SwiftCompileModule",
203203
tags = all_tags,
204204
target_under_test = "//test/fixtures/debug_settings:simple",
205205
)
@@ -219,7 +219,7 @@ def debug_settings_test_suite(name, tags = []):
219219
"-Xfrontend -no-serialize-debugging-options",
220220
"-gline-tables-only",
221221
],
222-
mnemonic = "SwiftCompile",
222+
mnemonic = "SwiftCompileModule",
223223
tags = all_tags,
224224
target_under_test = "//test/fixtures/debug_settings:simple",
225225
)
@@ -238,6 +238,8 @@ def debug_settings_test_suite(name, tags = []):
238238
"-g",
239239
"-gline-tables-only",
240240
],
241+
# In optimized mode, the driver still uses a single invocation for both
242+
# the module and for codegen.
241243
mnemonic = "SwiftCompile",
242244
tags = all_tags,
243245
target_under_test = "//test/fixtures/debug_settings:simple",
@@ -254,6 +256,8 @@ def debug_settings_test_suite(name, tags = []):
254256
not_expected_argv = [
255257
"-Xfrontend -serialize-debugging-options",
256258
],
259+
# In optimized mode, the driver still uses a single invocation for both
260+
# the module and for codegen.
257261
mnemonic = "SwiftCompile",
258262
tags = all_tags,
259263
target_under_test = "//test/fixtures/debug_settings:simple",
@@ -266,7 +270,7 @@ def debug_settings_test_suite(name, tags = []):
266270
"__BAZEL_XCODE_DEVELOPER_DIR__=/PLACEHOLDER_DEVELOPER_DIR",
267271
],
268272
target_compatible_with = ["@platforms//os:macos"],
269-
mnemonic = "SwiftCompile",
273+
mnemonic = "SwiftCompileModule",
270274
tags = all_tags,
271275
target_under_test = "//test/fixtures/debug_settings:simple",
272276
)

test/features_tests.bzl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def features_test_suite(name, tags = []):
149149
not_expected_argv = [
150150
"-Xwrapped-swift=-file-prefix-pwd-is-dot",
151151
],
152-
mnemonic = "SwiftCompile",
152+
mnemonic = "SwiftCompileModule",
153153
target_under_test = "//test/fixtures/debug_settings:simple",
154154
)
155155

@@ -162,7 +162,7 @@ def features_test_suite(name, tags = []):
162162
"__BAZEL_XCODE_DEVELOPER_DIR__=/PLACEHOLDER_DEVELOPER_DIR",
163163
],
164164
target_compatible_with = ["@platforms//os:macos"],
165-
mnemonic = "SwiftCompile",
165+
mnemonic = "SwiftCompileModule",
166166
target_under_test = "//test/fixtures/debug_settings:simple",
167167
)
168168

@@ -172,7 +172,7 @@ def features_test_suite(name, tags = []):
172172
not_expected_argv = [
173173
"-Xwrapped-swift=-global-index-store-import-path=",
174174
],
175-
mnemonic = "SwiftCompile",
175+
mnemonic = "SwiftCompileModule",
176176
target_under_test = "//test/fixtures/debug_settings:simple",
177177
)
178178

@@ -182,7 +182,7 @@ def features_test_suite(name, tags = []):
182182
expected_argv = [
183183
"-Xwrapped-swift=-global-index-store-import-path=bazel-out/_global_index_store",
184184
],
185-
mnemonic = "SwiftCompile",
185+
mnemonic = "SwiftCompileModule",
186186
target_compatible_with = ["@platforms//os:macos"],
187187
target_under_test = "//test/fixtures/debug_settings:simple",
188188
)
@@ -193,7 +193,7 @@ def features_test_suite(name, tags = []):
193193
expected_argv = [
194194
"-disable-sandbox",
195195
],
196-
mnemonic = "SwiftCompile",
196+
mnemonic = "SwiftCompileModule",
197197
target_compatible_with = ["@platforms//os:macos"],
198198
target_under_test = "//test/fixtures/debug_settings:simple",
199199
)
@@ -202,6 +202,8 @@ def features_test_suite(name, tags = []):
202202
name = "{}_default_opt_test".format(name),
203203
tags = all_tags,
204204
expected_argv = ["-emit-object", "-O", "-whole-module-optimization"],
205+
# In optimized mode, the driver still uses a single invocation for both
206+
# the module and for codegen.
205207
mnemonic = "SwiftCompile",
206208
target_under_test = "//test/fixtures/debug_settings:simple",
207209
)
@@ -211,6 +213,8 @@ def features_test_suite(name, tags = []):
211213
tags = all_tags,
212214
expected_argv = ["-emit-object", "-O"],
213215
not_expected_argv = ["-whole-module-optimization"],
216+
# In optimized mode, the driver still uses a single invocation for both
217+
# the module and for codegen.
214218
mnemonic = "SwiftCompile",
215219
target_under_test = "//test/fixtures/debug_settings:simple",
216220
)

test/fixtures/debug_settings/BUILD

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,10 @@ licenses(["notice"])
1616
swift_library(
1717
name = "simple",
1818
srcs = ["Empty.swift"],
19+
features = [
20+
# TODO: b/351801556 - Remove this when it is the default on all
21+
# toolchains.
22+
"swift.compile_in_parallel",
23+
],
1924
tags = FIXTURE_TAGS,
2025
)

test/module_cache_settings_tests.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def module_cache_settings_test_suite(name, tags = []):
6767
"-Xwrapped-swift=-ephemeral-module-cache",
6868
"/tmp/__build_bazel_rules_swift/swift_module_cache/$(WORKSPACE_NAME)",
6969
],
70-
mnemonic = "SwiftCompile",
70+
mnemonic = "SwiftCompileModule",
7171
tags = all_tags,
7272
target_under_test = "//test/fixtures/debug_settings:simple",
7373
)
@@ -83,7 +83,7 @@ def module_cache_settings_test_suite(name, tags = []):
8383
not_expected_argv = [
8484
"-Xwrapped-swift=-ephemeral-module-cache",
8585
],
86-
mnemonic = "SwiftCompile",
86+
mnemonic = "SwiftCompileModule",
8787
tags = all_tags,
8888
target_under_test = "//test/fixtures/debug_settings:simple",
8989
)
@@ -95,7 +95,7 @@ def module_cache_settings_test_suite(name, tags = []):
9595
not_expected_argv = [
9696
"/tmp/__build_bazel_rules_swift/swift_module_cache/$(WORKSPACE_NAME)",
9797
],
98-
mnemonic = "SwiftCompile",
98+
mnemonic = "SwiftCompileModule",
9999
tags = all_tags,
100100
target_under_test = "//test/fixtures/debug_settings:simple",
101101
)

test/pch_output_dir_tests.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def pch_output_dir_test_suite(name, tags = []):
4545
# can't verify the whole argument here. It has the configuration
4646
# fragment baked in.
4747
],
48-
mnemonic = "SwiftCompile",
48+
mnemonic = "SwiftCompileModule",
4949
tags = all_tags,
5050
target_under_test = "//test/fixtures/debug_settings:simple",
5151
)

test/split_derived_files_tests.bzl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def split_derived_files_test_suite(name, tags = []):
143143
not_expected_argv = [
144144
"simple.derived_output_file_map.json",
145145
],
146-
mnemonic = "SwiftCompile",
146+
mnemonic = "SwiftCompileModule",
147147
tags = all_tags,
148148
target_under_test = "//test/fixtures/debug_settings:simple",
149149
)
@@ -278,7 +278,7 @@ def split_derived_files_test_suite(name, tags = []):
278278
"-enable-batch-mode",
279279
"simple.output_file_map.json",
280280
],
281-
mnemonic = "SwiftCompile",
281+
mnemonic = "SwiftCompileModule",
282282
not_expected_argv = [
283283
"-emit-module-path",
284284
"simple.derived_output_file_map.json",
@@ -344,7 +344,7 @@ def split_derived_files_test_suite(name, tags = []):
344344
"-emit-object",
345345
"-whole-module-optimization",
346346
],
347-
mnemonic = "SwiftCompile",
347+
mnemonic = "SwiftCompileModule",
348348
not_expected_argv = [
349349
"-emit-module-path",
350350
],
@@ -406,7 +406,7 @@ def split_derived_files_test_suite(name, tags = []):
406406
expected_argv = [
407407
"-emit-object",
408408
],
409-
mnemonic = "SwiftCompile",
409+
mnemonic = "SwiftCompileModule",
410410
not_expected_argv = [
411411
"-experimental-skip-non-inlinable-function-bodies",
412412
],
@@ -433,7 +433,7 @@ def split_derived_files_test_suite(name, tags = []):
433433
"-emit-object",
434434
"-index-store-path",
435435
],
436-
mnemonic = "SwiftCompile",
436+
mnemonic = "SwiftCompileModule",
437437
not_expected_argv = [
438438
"-emit-module-path",
439439
],
@@ -458,7 +458,7 @@ def split_derived_files_test_suite(name, tags = []):
458458
split_swiftmodule_bitcode_test(
459459
name = "{}_bitcode_compile".format(name),
460460
expected_argv = ["-emit-bc"],
461-
mnemonic = "SwiftCompile",
461+
mnemonic = "SwiftCompileModule",
462462
tags = all_tags,
463463
target_under_test = "//test/fixtures/debug_settings:simple",
464464
)
@@ -480,7 +480,7 @@ def split_derived_files_test_suite(name, tags = []):
480480
"-Xcc -DWORLD=1",
481481
],
482482
target_compatible_with = ["@platforms//os:macos"],
483-
mnemonic = "SwiftCompile",
483+
mnemonic = "SwiftCompileModule",
484484
tags = all_tags,
485485
target_under_test = "//test/fixtures/debug_settings:simple",
486486
)

0 commit comments

Comments
 (0)