Skip to content

Commit 8f8fee1

Browse files
author
Nathan Hawes
committed
[ParseableInterface][test] Fix path matching in the SDKDependencies and SystemDependencies tests for Windows
Also don't use -n option of cp as it looks like it's not supported.
1 parent 0c8920e commit 8f8fee1

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

test/ParseableInterface/ModuleCache/SDKDependencies.swift

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
// RUN: llvm-bcanalyzer -dump %t/prebuilt-cache/SdkLib.swiftmodule | %FileCheck %s -check-prefix=PREBUILT
1313
//
1414
// PREBUILT: MODULE_BLOCK
15-
// PREBUILT-NOT: FILE_DEPENDENCY {{.*}}/MCP/{{.*}}
16-
// PREBUILT-NOT: FILE_DEPENDENCY {{.*}}/prebuilt-cache/{{.*}}
17-
// PREBUILD-NOT: FILE_DEPENDENCY {{.*}}/lib/swift/{{.*}}
15+
// PREBUILT-NOT: FILE_DEPENDENCY {{.*[/\\]MCP[/\\]}}
16+
// PREBUILT-NOT: FILE_DEPENDENCY {{.*[/\\]prebuilt-cache[/\\]}}
17+
// PREBUILD-NOT: FILE_DEPENDENCY {{.*[/\\]lib[/\\]swift[/\\]}}
1818
//
1919
// Re-build them in the opposite order
2020
// RUN: %empty-directory(%t/prebuilt-cache)
@@ -50,8 +50,8 @@
5050
// RUN: cat %t/dummy.d | %FileCheck %s -check-prefix=DEPFILE-NEGATIVE
5151
// RUN: cat %t/dummy.d | %FileCheck %s -check-prefix=DEPFILE
5252
//
53-
// DEPFILE-NEGATIVE-NOT: /MCP/
54-
// DEPFILE-NEGATIVE-NOT: /prebuilt-cache/
53+
// DEPFILE-NEGATIVE-NOT: {{[/\\]MCP[/\\]}}
54+
// DEPFILE-NEGATIVE-NOT: {{[/\\]prebuilt-cache[/\\]}}
5555
//
5656
// DEPFILE-DAG: SomeCModule.h
5757
// DEPFILE-DAG: SdkLib.swiftinterface
@@ -79,21 +79,21 @@
7979
// RUN: cat %t/MCP/SdkLib-*.swiftmodule | %FileCheck %s -check-prefixes=EXLIB,SDKLIB
8080
//
8181
// EXLIB: dependencies:
82-
// EXLIB-DAG: /my-sdk/usr/include/module.modulemap
83-
// EXLIB-DAG: /my-sdk/usr/include/SomeCModule.h
84-
// EXLIB-DAG: /my-sdk/ExportedLib.swiftinterface
85-
// SDKLIB-DAG: /my-sdk/SdkLib.swiftinterface
82+
// EXLIB-DAG: {{[/\\]my-sdk[/\\]usr[/\\]include[/\\]}}module.modulemap
83+
// EXLIB-DAG: {{[/\\]my-sdk[/\\]usr[/\\]include[/\\]}}SomeCModule.h
84+
// EXLIB-DAG: {{[/\\]my-sdk[/\\]}}ExportedLib.swiftinterface
85+
// SDKLIB-DAG: {{[/\\]my-sdk[/\\]}}SdkLib.swiftinterface
8686
//
8787
// Check they don't contain any dependencies from either cache other than themselves
8888
// RUN: cat %t/MCP/ExportedLib-*.swiftmodule | %FileCheck %s -check-prefix=NOCACHE -DLIB_NAME=ExportedLib
8989
// RUN: cat %t/MCP/SdkLib-*.swiftmodule | %FileCheck %s -check-prefix=NOCACHE -DLIB_NAME=SdkLib
9090
//
9191
// NOCACHE: dependencies:
92-
// NOCACHE-NOT: /prebuilt-cache/
93-
// NOCACHE-NOT: /MCP/
94-
// NOCACHE: /prebuilt-cache/[[LIB_NAME]].swiftmodule
95-
// NOCACHE-NOT: /prebuilt-cache/
96-
// NOCACHE-NOT: /MCP/
92+
// NOCACHE-NOT: {{[/\\]prebuilt-cache[/\\]}}
93+
// NOCACHE-NOT: {{[/\\]MCP[/\\]}}
94+
// NOCACHE: {{[/\\]prebuilt-cache[/\\]}}[[LIB_NAME]].swiftmodule
95+
// NOCACHE-NOT: {{[/\\]prebuilt-cache[/\\]}}
96+
// NOCACHE-NOT: {{[/\\]MCP[/\\]}}
9797
//
9898
// Check we didn't emit anything from the cache in the .d file either
9999
// RUN: cat %t/dummy.d | %FileCheck %s -check-prefix=DEPFILE-NEGATIVE
@@ -122,10 +122,10 @@
122122
// RUN: cat %t/MCP/ExportedLib-*.swiftmodule | %FileCheck %s -check-prefix=NEW-EXLIB
123123
// RUN: cat %t/MCP/SdkLib-*.swiftmodule | %FileCheck %s -check-prefixes=NEW-EXLIB,NEW-SDKLIB
124124
//
125-
// NEW-EXLIB-DAG: /my-new-sdk/usr/include/module.modulemap
126-
// NEW-EXLIB-DAG: /my-new-sdk/usr/include/SomeCModule.h
127-
// NEW-EXLIB-DAG: /my-new-sdk/ExportedLib.swiftinterface
128-
// NEW-SDKLIB-DAG: /my-new-sdk/SdkLib.swiftinterface
125+
// NEW-EXLIB-DAG: {{[/\\]my-new-sdk[/\\]usr[/\\]include[/\\]}}module.modulemap
126+
// NEW-EXLIB-DAG: {{[/\\]my-new-sdk[/\\]usr[/\\]include[/\\]}}SomeCModule.h
127+
// NEW-EXLIB-DAG: {{[/\\]my-new-sdk[/\\]}}ExportedLib.swiftinterface
128+
// NEW-SDKLIB-DAG: {{[/\\]my-new-sdk[/\\]}}SdkLib.swiftinterface
129129
//
130130
// Check they don't contain dependencies from the module cache, old prebuilt
131131
// cache, or new prebuilt cache

test/ParseableInterface/ModuleCache/SystemDependencies.swiftinterface

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@
3535

3636
// Check that it picked a different cache key.
3737
// RUN: %empty-directory(%t/MCP-combined)
38-
// RUN: cp -n %t/MCP/SystemDependencies*.swiftmodule %t/MCP-combined
39-
// RUN: cp -n %t/MCP-system/SystemDependencies*.swiftmodule %t/MCP-combined
38+
// RUN: cp %t/MCP/SystemDependencies*.swiftmodule %t/MCP-combined
39+
// RUN: cp %t/MCP-system/SystemDependencies*.swiftmodule %t/MCP-combined
40+
// RUN: ls -1 %t/MCP-combined | %FileCheck %s -check-prefix=MODULECACHE
4041

4142
// NEGATIVE-NOT: SomeCModule.h
4243
// CHECK: SomeCModule.h
44+
// MODULECACHE-COUNT-2: SystemDependencies-{{[^ ]+}}.swiftmodule
4345

4446
import SomeCModule

0 commit comments

Comments
 (0)