Skip to content

Commit 47f47f2

Browse files
committed
[Backtracing][Linux][Tests] Fix verify_all_overlays test.
The `_Backtracing` module has a number of private implementation only imports that aren't used outside of the module and that don't require any additional libraries (hence they aren't relevant to the outside world). `verify_all_overlays.py` needs to know about these when it does its test, because it loadas the module as the main module, which results in implementation only imports being required instead of ignored. rdar://101623265
1 parent 63ef7bd commit 47f47f2

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

validation-test/SIL/verify_all_overlays.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
22
# RUN: ${python} %s %target-swiftmodule-name %platform-sdk-overlay-dir \
3+
# RUN: %swift_src_root \
34
# RUN: %target-sil-opt -sdk %sdk -enable-sil-verify-all \
45
# RUN: -F %sdk/System/Library/PrivateFrameworks \
56
# RUN: -F "%xcode-extra-frameworks-dir"
@@ -14,9 +15,11 @@
1415

1516
target_swiftmodule_name = sys.argv[1]
1617
sdk_overlay_dir = sys.argv[2]
17-
sil_opt_invocation = sys.argv[3:]
18+
source_dir = sys.argv[3]
19+
sil_opt_invocation = sys.argv[4:]
1820

1921
for module_file in os.listdir(sdk_overlay_dir):
22+
extra_args = []
2023
module_name, ext = os.path.splitext(module_file)
2124
if ext != ".swiftmodule":
2225
continue
@@ -33,6 +36,12 @@
3336
# TODO: fix the DifferentiationUnittest module.
3437
if module_name == "DifferentiationUnittest":
3538
continue
39+
# Backtracing needs its own additional modules in the module path
40+
if module_name == "_Backtracing":
41+
extra_args = ["-I", os.path.join(source_dir, "stdlib",
42+
"public", "Backtracing", "modules"),
43+
"-I", os.path.join(source_dir, "include")]
44+
3645
print("# " + module_name)
3746

3847
module_path = os.path.join(sdk_overlay_dir, module_file)
@@ -50,4 +59,5 @@
5059
# We are deliberately discarding the output here; we're just making sure
5160
# it can be generated.
5261
subprocess.check_output(sil_opt_invocation +
53-
[module_path, "-module-name", module_name])
62+
[module_path, "-module-name", module_name] +
63+
extra_args)

0 commit comments

Comments
 (0)