Skip to content

Commit 2444429

Browse files
Merge pull request swiftlang#34751 from cltnschlosser/cs_swiftDriverTestDifferences
Modify driver tests to support swift-driver json and path differences
2 parents 582fb84 + 85c7a9c commit 2444429

File tree

4 files changed

+63
-63
lines changed

4 files changed

+63
-63
lines changed

test/Driver/Dependencies/bindings-build-record.swift

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,49 @@
66
// RUN: cd %t && %swiftc_driver -driver-print-bindings ./main.swift ./other.swift ./yet-another.swift -incremental -driver-show-incremental -output-file-map %t/output.json 2>&1 |%FileCheck %s -check-prefix=MUST-EXEC
77

88
// MUST-EXEC-NOT: warning
9-
// MUST-EXEC: inputs: ["./main.swift"], output: {object: "./main.o", swift-dependencies: "./main.swiftdeps"}
10-
// MUST-EXEC: inputs: ["./other.swift"], output: {object: "./other.o", swift-dependencies: "./other.swiftdeps"}
11-
// MUST-EXEC: inputs: ["./yet-another.swift"], output: {object: "./yet-another.o", swift-dependencies: "./yet-another.swiftdeps"}
9+
// MUST-EXEC: inputs: ["{{(\.\/)?}}main.swift"], output: {object: "{{(\.\/)?}}main.o", swift-dependencies: "{{(\.\/)?}}main.swiftdeps"}
10+
// MUST-EXEC: inputs: ["{{(\.\/)?}}other.swift"], output: {object: "{{(\.\/)?}}other.o", swift-dependencies: "{{(\.\/)?}}other.swiftdeps"}
11+
// MUST-EXEC: inputs: ["{{(\.\/)?}}yet-another.swift"], output: {object: "{{(\.\/)?}}yet-another.o", swift-dependencies: "{{(\.\/)?}}yet-another.swiftdeps"}
1212
// MUST-EXEC: Disabling incremental build: could not read build record
1313

1414
// RUN: echo '{version: "'$(%swiftc_driver_plain -version | head -n1)'", inputs: {"./main.swift": [443865900, 0], "./other.swift": [443865900, 0], "./yet-another.swift": [443865900, 0]}, build_time: [443865901, 0]}' > %t/main~buildrecord.swiftdeps
1515
// RUN: cd %t && %swiftc_driver -driver-print-bindings ./main.swift ./other.swift ./yet-another.swift -incremental -output-file-map %t/output.json 2>&1 | %FileCheck %s -check-prefix=NO-EXEC
1616

17-
// NO-EXEC: inputs: ["./main.swift"], output: {{[{].*[}]}}, condition: check-dependencies
18-
// NO-EXEC: inputs: ["./other.swift"], output: {{[{].*[}]}}, condition: check-dependencies
19-
// NO-EXEC: inputs: ["./yet-another.swift"], output: {{[{].*[}]}}, condition: check-dependencies
17+
// NO-EXEC: inputs: ["{{(\.\/)?}}main.swift"], output: {{[{].*[}]}}, condition: check-dependencies
18+
// NO-EXEC: inputs: ["{{(\.\/)?}}other.swift"], output: {{[{].*[}]}}, condition: check-dependencies
19+
// NO-EXEC: inputs: ["{{(\.\/)?}}yet-another.swift"], output: {{[{].*[}]}}, condition: check-dependencies
2020

2121

2222
// RUN: echo '{version: "'$(%swiftc_driver_plain -version | head -n1)'", inputs: {"./main.swift": [443865900, 0], "./other.swift": !private [443865900, 0], "./yet-another.swift": !dirty [443865900, 0]}, build_time: [443865901, 0]}' > %t/main~buildrecord.swiftdeps
2323
// RUN: cd %t && %swiftc_driver -driver-print-bindings ./main.swift ./other.swift ./yet-another.swift -incremental -output-file-map %t/output.json 2>&1 | %FileCheck %s -check-prefix=BUILD-RECORD
2424

25-
// BUILD-RECORD: inputs: ["./main.swift"], output: {{[{].*[}]}}, condition: check-dependencies{{$}}
26-
// BUILD-RECORD: inputs: ["./other.swift"], output: {{[{].*[}]}}, condition: run-without-cascading{{$}}
27-
// BUILD-RECORD: inputs: ["./yet-another.swift"], output: {{[{].*[}]$}}
25+
// BUILD-RECORD: inputs: ["{{(\.\/)?}}main.swift"], output: {{[{].*[}]}}, condition: check-dependencies{{$}}
26+
// BUILD-RECORD: inputs: ["{{(\.\/)?}}other.swift"], output: {{[{].*[}]}}, condition: run-without-cascading{{$}}
27+
// BUILD-RECORD: inputs: ["{{(\.\/)?}}yet-another.swift"], output: {{[{].*[}]$}}
2828

2929
// RUN: cd %t && %swiftc_driver -driver-print-bindings ./main.swift ./other.swift ./yet-another.swift ./added.swift -incremental -output-file-map %t/output.json 2>&1 > %t/added.txt
3030
// RUN: %FileCheck %s -check-prefix=BUILD-RECORD < %t/added.txt
3131
// RUN: %FileCheck %s -check-prefix=FILE-ADDED < %t/added.txt
3232

33-
// FILE-ADDED: inputs: ["./added.swift"], output: {{[{].*[}]}}, condition: newly-added{{$}}
33+
// FILE-ADDED: inputs: ["{{(\.\/)?}}added.swift"], output: {{[{].*[}]}}, condition: newly-added{{$}}
3434

3535
// RUN: %{python} %S/Inputs/touch.py 443865960 %t/main.swift
3636
// RUN: cd %t && %swiftc_driver -driver-print-bindings ./main.swift ./other.swift ./yet-another.swift -incremental -output-file-map %t/output.json 2>&1 | %FileCheck %s -check-prefix=BUILD-RECORD-PLUS-CHANGE
37-
// BUILD-RECORD-PLUS-CHANGE: inputs: ["./main.swift"], output: {{[{].*[}]}}, condition: run-without-cascading
38-
// BUILD-RECORD-PLUS-CHANGE: inputs: ["./other.swift"], output: {{[{].*[}]}}, condition: run-without-cascading{{$}}
39-
// BUILD-RECORD-PLUS-CHANGE: inputs: ["./yet-another.swift"], output: {{[{].*[}]$}}
37+
// BUILD-RECORD-PLUS-CHANGE: inputs: ["{{(\.\/)?}}main.swift"], output: {{[{].*[}]}}, condition: run-without-cascading
38+
// BUILD-RECORD-PLUS-CHANGE: inputs: ["{{(\.\/)?}}other.swift"], output: {{[{].*[}]}}, condition: run-without-cascading{{$}}
39+
// BUILD-RECORD-PLUS-CHANGE: inputs: ["{{(\.\/)?}}yet-another.swift"], output: {{[{].*[}]$}}
4040

4141
// RUN: %{python} %S/Inputs/touch.py 443865900 %t/*
4242
// RUN: cd %t && %swiftc_driver -driver-print-bindings ./main.swift ./other.swift -incremental -output-file-map %t/output.json 2>&1 | %FileCheck %s -check-prefix=FILE-REMOVED
43-
// FILE-REMOVED: inputs: ["./main.swift"], output: {{[{].*[}]$}}
44-
// FILE-REMOVED: inputs: ["./other.swift"], output: {{[{].*[}]$}}
43+
// FILE-REMOVED: inputs: ["{{(\.\/)?}}main.swift"], output: {{[{].*[}]$}}
44+
// FILE-REMOVED: inputs: ["{{(\.\/)?}}other.swift"], output: {{[{].*[}]$}}
4545
// FILE-REMOVED-NOT: yet-another.swift
4646

4747

4848
// RUN: echo '{version: "bogus", inputs: {"./main.swift": [443865900, 0], "./other.swift": !private [443865900, 0], "./yet-another.swift": !dirty [443865900, 0]}}' > %t/main~buildrecord.swiftdeps
4949
// RUN: cd %t && %swiftc_driver -driver-print-bindings ./main.swift ./other.swift ./yet-another.swift -incremental -output-file-map %t/output.json 2>&1 | %FileCheck %s -check-prefix=INVALID-RECORD
5050

5151
// INVALID-RECORD-NOT: warning
52-
// INVALID-RECORD: inputs: ["./main.swift"], output: {{[{].*[}]$}}
53-
// INVALID-RECORD: inputs: ["./other.swift"], output: {{[{].*[}]$}}
54-
// INVALID-RECORD: inputs: ["./yet-another.swift"], output: {{[{].*[}]$}}
52+
// INVALID-RECORD: inputs: ["{{(\.\/)?}}main.swift"], output: {{[{].*[}]$}}
53+
// INVALID-RECORD: inputs: ["{{(\.\/)?}}other.swift"], output: {{[{].*[}]$}}
54+
// INVALID-RECORD: inputs: ["{{(\.\/)?}}yet-another.swift"], output: {{[{].*[}]$}}

test/Driver/working-directory.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// In another driver mode.
1414
// RUN: cd %t && %swift_driver -driver-print-jobs -working-directory %/S/Inputs -F. | %FileCheck %s -check-prefix=REPL
1515
// RUN: cd %t && %swift_driver -driver-print-jobs -deprecated-integrated-repl -working-directory %/S/Inputs -F. | %FileCheck %s -check-prefix=REPL
16-
// REPL: -F {{\\?"?}}SOURCE_DIR/test/Driver/Inputs{{(\\\\(\\\\)?)|/}}.
16+
// REPL: -F {{\\?"?}}SOURCE_DIR/test/Driver/Inputs
1717

1818
// RUN: cd %t && %swiftc_driver -driver-print-jobs -working-directory=%/S/Inputs -c -module-name m main.swift lib.swift | %FileCheck %s -check-prefix=MULTI_INPUT
1919
// MULTI_INPUT: SOURCE_DIR/test/Driver/Inputs{{/|\\\\}}main.swift
@@ -25,12 +25,12 @@
2525
// RUN: cd %t && %swiftc_driver -driver-print-jobs -working-directory %/S/Inputs -c %/s -F . | %FileCheck %s -check-prefix=SEARCH_PATH
2626
// RUN: cd %t && %swiftc_driver -driver-print-jobs -working-directory %/S/Inputs -c %/s -F. | %FileCheck %s -check-prefix=SEARCH_PATH
2727
// RUN: cd %t && %swiftc_driver -driver-print-jobs -working-directory %/S/Inputs -c %/s -F=. | %FileCheck %s -check-prefix=SEARCH_PATH
28-
// SEARCH_PATH: -F {{"?}}SOURCE_DIR/test/Driver/Inputs{{/|\\\\}}.
28+
// SEARCH_PATH: -F {{"?}}SOURCE_DIR/test/Driver/Inputs
2929

3030
// RUN: cd %t && %swiftc_driver -driver-print-jobs -working-directory %/S/Inputs -emit-executable %/s -L . | %FileCheck %s -check-prefix=L_PATH
3131
// RUN: cd %t && %swiftc_driver -driver-print-jobs -working-directory %/S/Inputs -emit-executable %/s -L. | %FileCheck %s -check-prefix=L_PATH
3232
// RUN: cd %t && %swiftc_driver -driver-print-jobs -working-directory %/S/Inputs -emit-executable %/s -L=. | %FileCheck %s -check-prefix=L_PATH
33-
// L_PATH: -L {{"?}}SOURCE_DIR/test/Driver/Inputs{{/|\\\\}}.
33+
// L_PATH: -L {{"?}}SOURCE_DIR/test/Driver/Inputs
3434

3535
// RUN: cd %t && %swiftc_driver -driver-print-jobs -working-directory %/S/Inputs -c %/s -disable-bridging-pch -import-objc-header bridging-header.h | %FileCheck %s -check-prefix=OBJC_HEADER1
3636
// OBJC_HEADER1: -import-objc-header {{"?}}SOURCE_DIR/test/Driver/Inputs{{/|\\\\}}bridging-header.h

validation-test/Driver/Dependencies/rdar23148987.swift

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
// CHECK-1-NOT: warning
1010
// CHECK-1: {{^{$}}
11-
// CHECK-1: "kind": "began"
12-
// CHECK-1: "name": "compile"
13-
// CHECK-1: ".\/main.swift"
11+
// CHECK-1-DAG: "kind"{{ ?}}: "began"
12+
// CHECK-1-DAG: "name"{{ ?}}: "compile"
13+
// CHECK-1-DAG: "{{(\.\\\/)?}}main.swift"
1414
// CHECK-1: {{^}$}}
1515

1616
// CHECK-1: {{^{$}}
17-
// CHECK-1: "kind": "began"
18-
// CHECK-1: "name": "compile"
19-
// CHECK-1: ".\/helper.swift"
17+
// CHECK-1-DAG: "kind"{{ ?}}: "began"
18+
// CHECK-1-DAG: "name"{{ ?}}: "compile"
19+
// CHECK-1-DAG: "{{(\.\\\/)?}}helper.swift"
2020
// CHECK-1: {{^}$}}
2121

2222
// RUN: ls %t/ | %FileCheck -check-prefix=CHECK-LS %s
@@ -28,15 +28,15 @@
2828

2929
// CHECK-1-SKIPPED-NOT: warning
3030
// CHECK-1-SKIPPED: {{^{$}}
31-
// CHECK-1-SKIPPED: "kind": "skipped"
32-
// CHECK-1-SKIPPED: "name": "compile"
33-
// CHECK-1-SKIPPED: ".\/main.swift"
31+
// CHECK-1-SKIPPED-DAG: "kind"{{ ?}}: "skipped"
32+
// CHECK-1-SKIPPED-DAG: "name"{{ ?}}: "compile"
33+
// CHECK-1-SKIPPED-DAG: "{{(\.\\\/)?}}main.swift"
3434
// CHECK-1-SKIPPED: {{^}$}}
3535

3636
// CHECK-1-SKIPPED: {{^{$}}
37-
// CHECK-1-SKIPPED: "kind": "skipped"
38-
// CHECK-1-SKIPPED: "name": "compile"
39-
// CHECK-1-SKIPPED: ".\/helper.swift"
37+
// CHECK-1-SKIPPED-DAG: "kind"{{ ?}}: "skipped"
38+
// CHECK-1-SKIPPED-DAG: "name"{{ ?}}: "compile"
39+
// CHECK-1-SKIPPED-DAG: "{{(\.\\\/)?}}helper.swift"
4040
// CHECK-1-SKIPPED: {{^}$}}
4141

4242
// RUN: cp %S/Inputs/rdar23148987/helper-2.swift %t/helper.swift
@@ -45,15 +45,15 @@
4545

4646
// CHECK-2-NOT: warning
4747
// CHECK-2: {{^{$}}
48-
// CHECK-2: "kind": "began"
49-
// CHECK-2: "name": "compile"
50-
// CHECK-2: ".\/helper.swift"
48+
// CHECK-2-DAG: "kind"{{ ?}}: "began"
49+
// CHECK-2-DAG: "name"{{ ?}}: "compile"
50+
// CHECK-2-DAG: "{{(\.\\\/)?}}helper.swift"
5151
// CHECK-2: {{^}$}}
5252

5353
// CHECK-2: {{^{$}}
54-
// CHECK-2: "kind": "began"
55-
// CHECK-2: "name": "compile"
56-
// CHECK-2: ".\/main.swift"
54+
// CHECK-2-DAG: "kind"{{ ?}}: "began"
55+
// CHECK-2-DAG: "name"{{ ?}}: "compile"
56+
// CHECK-2-DAG: "{{(\.\\\/)?}}main.swift"
5757
// CHECK-2: {{^}$}}
5858

5959
func test(obj: Test) {

validation-test/Driver/Dependencies/rdar25405605.swift

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
// CHECK-1-NOT: warning
1010
// CHECK-1: {{^{$}}
11-
// CHECK-1: "kind": "began"
12-
// CHECK-1: "name": "compile"
13-
// CHECK-1: ".\/main.swift"
11+
// CHECK-1-DAG: "kind"{{ ?}}: "began"
12+
// CHECK-1-DAG: "name"{{ ?}}: "compile"
13+
// CHECK-1-DAG: "{{(\.\\\/)?}}main.swift"
1414
// CHECK-1: {{^}$}}
1515

1616
// CHECK-1: {{^{$}}
17-
// CHECK-1: "kind": "began"
18-
// CHECK-1: "name": "compile"
19-
// CHECK-1: ".\/helper.swift"
17+
// CHECK-1-DAG: "kind"{{ ?}}: "began"
18+
// CHECK-1-DAG: "name"{{ ?}}: "compile"
19+
// CHECK-1-DAG: "{{(\.\\\/)?}}helper.swift"
2020
// CHECK-1: {{^}$}}
2121

2222
// RUN: ls %t/ | %FileCheck -check-prefix=CHECK-LS %s
@@ -28,15 +28,15 @@
2828

2929
// CHECK-1-SKIPPED-NOT: warning
3030
// CHECK-1-SKIPPED: {{^{$}}
31-
// CHECK-1-SKIPPED: "kind": "skipped"
32-
// CHECK-1-SKIPPED: "name": "compile"
33-
// CHECK-1-SKIPPED: ".\/main.swift"
31+
// CHECK-1-SKIPPED-DAG: "kind"{{ ?}}: "skipped"
32+
// CHECK-1-SKIPPED-DAG: "name"{{ ?}}: "compile"
33+
// CHECK-1-SKIPPED-DAG: "{{(\.\\\/)?}}main.swift"
3434
// CHECK-1-SKIPPED: {{^}$}}
3535

3636
// CHECK-1-SKIPPED: {{^{$}}
37-
// CHECK-1-SKIPPED: "kind": "skipped"
38-
// CHECK-1-SKIPPED: "name": "compile"
39-
// CHECK-1-SKIPPED: ".\/helper.swift"
37+
// CHECK-1-SKIPPED-DAG: "kind"{{ ?}}: "skipped"
38+
// CHECK-1-SKIPPED-DAG: "name"{{ ?}}: "compile"
39+
// CHECK-1-SKIPPED-DAG: "{{(\.\\\/)?}}helper.swift"
4040
// CHECK-1-SKIPPED: {{^}$}}
4141

4242
// RUN: cp %S/Inputs/rdar25405605/helper-2.swift %t/helper.swift
@@ -45,15 +45,15 @@
4545

4646
// CHECK-2-NOT: warning
4747
// CHECK-2: {{^{$}}
48-
// CHECK-2: "kind": "began"
49-
// CHECK-2: "name": "compile"
50-
// CHECK-2: ".\/helper.swift"
48+
// CHECK-2-DAG: "kind"{{ ?}}: "began"
49+
// CHECK-2-DAG: "name"{{ ?}}: "compile"
50+
// CHECK-2-DAG: "{{(\.\\\/)?}}helper.swift"
5151
// CHECK-2: {{^}$}}
5252

5353
// CHECK-2: {{^{$}}
54-
// CHECK-2: "kind": "skipped"
55-
// CHECK-2: "name": "compile"
56-
// CHECK-2: ".\/main.swift"
54+
// CHECK-2-DAG: "kind"{{ ?}}: "skipped"
55+
// CHECK-2-DAG: "name"{{ ?}}: "compile"
56+
// CHECK-2-DAG: "{{(\.\\\/)?}}main.swift"
5757
// CHECK-2: {{^}$}}
5858

5959
// RUN: cp %S/Inputs/rdar25405605/helper-3.swift %t/helper.swift
@@ -64,15 +64,15 @@
6464

6565
// CHECK-3-NOT: warning
6666
// CHECK-3: {{^{$}}
67-
// CHECK-3: "kind": "began"
68-
// CHECK-3: "name": "compile"
69-
// CHECK-3: ".\/helper.swift"
67+
// CHECK-3-DAG: "kind"{{ ?}}: "began"
68+
// CHECK-3-DAG: "name"{{ ?}}: "compile"
69+
// CHECK-3-DAG: "{{(\.\\\/)?}}helper.swift"
7070
// CHECK-3: {{^}$}}
7171

7272
// CHECK-3: {{^{$}}
73-
// CHECK-3: "kind": "began"
74-
// CHECK-3: "name": "compile"
75-
// CHECK-3: ".\/main.swift"
73+
// CHECK-3-DAG: "kind"{{ ?}}: "began"
74+
// CHECK-3-DAG: "name"{{ ?}}: "compile"
75+
// CHECK-3-DAG: "{{(\.\\\/)?}}main.swift"
7676
// CHECK-3: {{^}$}}
7777

7878
func foo(_ value: Foo) -> Bool {

0 commit comments

Comments
 (0)