Skip to content

Commit f969320

Browse files
Emit traces related to sdk dependencies and mark test case failing.
Exposes the issue in rdar://problem/55752426.
1 parent ade2abb commit f969320

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

test/ModuleInterface/ModuleCache/SDKDependencies.swift

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// XFAIL: *
2+
13
// RUN: %empty-directory(%t)
24

35
// 1) Build a prebuilt cache for our SDK
@@ -32,7 +34,7 @@
3234

3335
// 2) Baseline check: Make sure we use the interface when not passing the prebuilt module cache path
3436
//
35-
// RUN: %target-swift-frontend -typecheck -I %t/my-sdk -sdk %t/my-sdk -module-cache-path %t/MCP -emit-dependencies-path %t/dummy.d -track-system-dependencies %s
37+
// RUN: %target-swift-frontend -typecheck -I %t/my-sdk -sdk %t/my-sdk -module-cache-path %t/MCP -emit-dependencies-path %t/dummy.d -track-system-dependencies -emit-loaded-module-trace-path %t/trace.json %s
3638
//
3739
// Check SdkLib and ExportedLib are in the module cache
3840
// RUN: test -f %t/MCP/ExportedLib-*.swiftmodule
@@ -58,13 +60,23 @@
5860
// DEPFILE-DAG: ExportedLib.swiftinterface
5961
// DEPFILE-DAG: SDKDependencies.swift
6062
//
63+
// Check we didn't emit anything from the cache in the trace file either
64+
// RUN: cat %t/trace.json | %FileCheck %s -check-prefix=TRACEFILE-NEGATIVE
65+
// RUN: cat %t/trace.json | %FileCheck %s -check-prefix=TRACEFILE
66+
//
67+
// TRACEFILE-NEGATIVE-NOT: {{[/\\]MCP[/\\]}}
68+
// TRACEFILE-NEGATIVE-NOT: {{[/\\]prebuilt-cache[/\\]}}
69+
//
70+
// TRACEFILE-DAG: SdkLib.swiftinterface
71+
// TRACEFILE-DAG: ExportedLib.swiftinterface
72+
//
6173
// RUN: %empty-directory(%t/MCP)
6274
// RUN: echo '2: PASSED'
6375

6476

6577
// 3) Baseline check: Make sure we use the the prebuilt module cache when using the SDK it was built with
6678
//
67-
// RUN: %target-swift-frontend -typecheck -I %t/my-sdk -sdk %t/my-sdk -prebuilt-module-cache-path %t/prebuilt-cache -module-cache-path %t/MCP -emit-dependencies-path %t/dummy.d -track-system-dependencies %s
79+
// RUN: %target-swift-frontend -typecheck -I %t/my-sdk -sdk %t/my-sdk -prebuilt-module-cache-path %t/prebuilt-cache -module-cache-path %t/MCP -emit-dependencies-path %t/dummy.d -track-system-dependencies -emit-loaded-module-trace-path %t/trace.json %s
6880
//
6981
// Check SdkLib and ExportedLib are in the module cache
7082
// RUN: test -f %t/MCP/SdkLib-*.swiftmodule
@@ -99,6 +111,10 @@
99111
// RUN: cat %t/dummy.d | %FileCheck %s -check-prefix=DEPFILE-NEGATIVE
100112
// RUN: cat %t/dummy.d | %FileCheck %s -check-prefix=DEPFILE
101113
//
114+
// Check we didn't emit anything from the cache in the trace file either
115+
// RUN: cat %t/trace.json | %FileCheck %s -check-prefix=TRACEFILE-NEGATIVE
116+
// RUN: cat %t/trace.json | %FileCheck %s -check-prefix=TRACEFILE
117+
//
102118
// RUN: %empty-directory(%t/MCP)
103119
// RUN: echo '3: PASSED'
104120

@@ -108,7 +124,7 @@
108124
// RUN: mv %t/my-sdk %t/my-new-sdk
109125
// RUN: mkdir %t/new-dir
110126
// RUN: mv %t/prebuilt-cache %t/new-dir/
111-
// RUN: %target-swift-frontend -typecheck -I %t/my-new-sdk -sdk %t/my-new-sdk -prebuilt-module-cache-path %t/new-dir/prebuilt-cache -module-cache-path %t/MCP -emit-dependencies-path %t/dummy.d -track-system-dependencies %s
127+
// RUN: %target-swift-frontend -typecheck -I %t/my-new-sdk -sdk %t/my-new-sdk -prebuilt-module-cache-path %t/new-dir/prebuilt-cache -module-cache-path %t/MCP -emit-dependencies-path %t/dummy.d -track-system-dependencies -emit-loaded-module-trace-path %t/trace.json %s
112128
//
113129
// Check SdkLib and ExportedLib are in the module cache
114130
// RUN: test -f %t/MCP/SdkLib-*.swiftmodule
@@ -136,14 +152,18 @@
136152
// RUN: cat %t/dummy.d | %FileCheck %s -check-prefix=DEPFILE-NEGATIVE
137153
// RUN: cat %t/dummy.d | %FileCheck %s -check-prefix=DEPFILE
138154
//
155+
// Check we didn't emit anything from the cache in the trace file either
156+
// RUN: cat %t/trace.json | %FileCheck %s -check-prefix=TRACEFILE-NEGATIVE
157+
// RUN: cat %t/trace.json | %FileCheck %s -check-prefix=TRACEFILE
158+
//
139159
// RUN: %empty-directory(%t/MCP)
140160
// RUN: echo '4: PASSED'
141161

142162

143163
// 5) Now change the SDK's content and check it no longer uses the prebuilt modules
144164
//
145165
// RUN: echo "// size change" >> %t/my-new-sdk/SdkLib.swiftinterface
146-
// RUN: %target-swift-frontend -typecheck -I %t/my-new-sdk -sdk %t/my-new-sdk -prebuilt-module-cache-path %t/new-dir/prebuilt-cache -module-cache-path %t/MCP -emit-dependencies-path %t/dummy.d -track-system-dependencies %s
166+
// RUN: %target-swift-frontend -typecheck -I %t/my-new-sdk -sdk %t/my-new-sdk -prebuilt-module-cache-path %t/new-dir/prebuilt-cache -module-cache-path %t/MCP -emit-dependencies-path %t/dummy.d -track-system-dependencies -emit-loaded-module-trace-path %t/trace.json %s
147167
//
148168
// Check SDKLib and ExportedLib are in the module cache
149169
// RUN: test -f %t/MCP/SdkLib-*.swiftmodule
@@ -181,6 +201,10 @@
181201
// RUN: cat %t/dummy.d | %FileCheck %s -check-prefix=DEPFILE-NEGATIVE
182202
// RUN: cat %t/dummy.d | %FileCheck %s -check-prefix=DEPFILE
183203
//
204+
// Check we didn't emit anything from the cache in the trace file either
205+
// RUN: cat %t/trace.json | %FileCheck %s -check-prefix=TRACEFILE-NEGATIVE
206+
// RUN: cat %t/trace.json | %FileCheck %s -check-prefix=TRACEFILE
207+
//
184208
// RUN: echo '5: PASSED'
185209

186210

0 commit comments

Comments
 (0)