Skip to content

Commit ec4f8de

Browse files
author
David Ungar
committed
Fix tests for fine-grained dependencies
1 parent 326e403 commit ec4f8de

File tree

324 files changed

+9901
-277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

324 files changed

+9901
-277
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// REQUIRES: shell
2+
// Also uses awk:
3+
// XFAIL OS=windows
4+
5+
// RUN: rm -f %t.*
6+
//
7+
// Generate a bridging PCH, use it in a swift file, and check that the swift file's .swiftdeps
8+
// mention the .h the PCH was generated from, and any .h files included in it.
9+
//
10+
// RUN: %target-swift-frontend -enable-fine-grained-dependencies -emit-pch -o %t.pch %/S/Inputs/chained-unit-test-bridging-header-to-pch.h
11+
// RUN: %target-swift-frontend -enable-fine-grained-dependencies -module-name test -c -emit-dependencies-path %t.d -emit-reference-dependencies-path %t.swiftdeps -primary-file %s -import-objc-header %t.pch
12+
// RUN: %FileCheck --check-prefix CHECK-DEPS %s < %t.d
13+
// RUN: %S/../Inputs/process_fine_grained_swiftdeps.sh <%t.swiftdeps >%t-processed.swiftdeps
14+
// RUN: %FileCheck --check-prefix CHECK-SWIFTDEPS --enable-yaml-compatibility %s < %t-processed.swiftdeps
15+
// RUN: %FileCheck --check-prefix CHECK-SWIFTDEPS2 --enable-yaml-compatibility %s < %t-processed.swiftdeps
16+
17+
// RUN: %target-swift-frontend -enable-fine-grained-dependencies -module-name test -c -emit-dependencies-path %t.persistent.d -emit-reference-dependencies-path %t.persistent.swiftdeps -primary-file %s -import-objc-header %/S/Inputs/chained-unit-test-bridging-header-to-pch.h -pch-output-dir %t/pch
18+
// RUN: %FileCheck --check-prefix CHECK-DEPS %s < %t.persistent.d
19+
// RUN: %S/../Inputs/process_fine_grained_swiftdeps.sh <%t.persistent.swiftdeps >%t-processed.persistent.swiftdeps
20+
// RUN: %FileCheck --check-prefix CHECK-SWIFTDEPS --enable-yaml-compatibility %s < %t-processed.persistent.swiftdeps
21+
// RUN: %FileCheck --check-prefix CHECK-SWIFTDEPS2 --enable-yaml-compatibility %s < %t-processed.persistent.swiftdeps
22+
23+
print(app_function(1))
24+
25+
// CHECK-DEPS: pch-bridging-header-deps-fine.o : {{.*}}SOURCE_DIR{{/|\\}}test{{/|\\}}ClangImporter{{/|\\}}Inputs{{/|\\}}app-bridging-header-to-pch.h {{.*}}SOURCE_DIR{{/|\\}}test{{/|\\}}ClangImporter{{/|\\}}Inputs{{/|\\}}chained-unit-test-bridging-header-to-pch.h
26+
27+
// CHECK-SWIFTDEPS: externalDepend {{.*}} 'SOURCE_DIR{{/|\\\\}}test{{/|\\\\}}ClangImporter{{/|\\\\}}Inputs{{/|\\\\}}app-bridging-header-to-pch.h'
28+
// CHECK-SWIFTDEPS: externalDepend {{.*}} 'SOURCE_DIR{{/|\\\\}}test{{/|\\\\}}ClangImporter{{/|\\\\}}Inputs{{/|\\\\}}chained-unit-test-bridging-header-to-pch.h'
29+
30+
// CHECK-SWIFTDEPS2-NOT: {{.*}}.pch

test/ClangImporter/pch-bridging-header-deps.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
// Generate a bridging PCH, use it in a swift file, and check that the swift file's .swiftdeps
44
// mention the .h the PCH was generated from, and any .h files included in it.
55
//
6-
// RUN: %target-swift-frontend -emit-pch -o %t.pch %/S/Inputs/chained-unit-test-bridging-header-to-pch.h
7-
// RUN: %target-swift-frontend -module-name test -c -emit-dependencies-path %t.d -emit-reference-dependencies-path %t.swiftdeps -primary-file %s -import-objc-header %t.pch
6+
// RUN: %target-swift-frontend -disable-fine-grained-dependencies -emit-pch -o %t.pch %/S/Inputs/chained-unit-test-bridging-header-to-pch.h
7+
// RUN: %target-swift-frontend -disable-fine-grained-dependencies -module-name test -c -emit-dependencies-path %t.d -emit-reference-dependencies-path %t.swiftdeps -primary-file %s -import-objc-header %t.pch
88
// RUN: %FileCheck --check-prefix CHECK-DEPS %s < %t.d
99
// RUN: %FileCheck --check-prefix CHECK-SWIFTDEPS --enable-yaml-compatibility %s < %t.swiftdeps
1010
// RUN: %FileCheck --check-prefix CHECK-SWIFTDEPS2 --enable-yaml-compatibility %s < %t.swiftdeps
1111

12-
// RUN: %target-swift-frontend -module-name test -c -emit-dependencies-path %t.persistent.d -emit-reference-dependencies-path %t.persistent.swiftdeps -primary-file %s -import-objc-header %/S/Inputs/chained-unit-test-bridging-header-to-pch.h -pch-output-dir %t/pch
12+
// RUN: %target-swift-frontend -disable-fine-grained-dependencies -module-name test -c -emit-dependencies-path %t.persistent.d -emit-reference-dependencies-path %t.persistent.swiftdeps -primary-file %s -import-objc-header %/S/Inputs/chained-unit-test-bridging-header-to-pch.h -pch-output-dir %t/pch
1313
// RUN: %FileCheck --check-prefix CHECK-DEPS %s < %t.persistent.d
1414
// RUN: %FileCheck --check-prefix CHECK-SWIFTDEPS --enable-yaml-compatibility %s < %t.persistent.swiftdeps
1515
// RUN: %FileCheck --check-prefix CHECK-SWIFTDEPS2 --enable-yaml-compatibility %s < %t.persistent.swiftdeps
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Fine-grained v0
2+
---
3+
allNodes:
4+
- key:
5+
kind: sourceFileProvide
6+
aspect: interface
7+
context: ''
8+
name: main.swiftdeps
9+
fingerprint: 8276a546203ebde599da50b466729230
10+
sequenceNumber: 0
11+
defsIDependUpon: [ 4, 2 ]
12+
isProvides: true
13+
- key:
14+
kind: sourceFileProvide
15+
aspect: implementation
16+
context: ''
17+
name: main.swiftdeps
18+
fingerprint: 8276a546203ebde599da50b466729230
19+
sequenceNumber: 1
20+
defsIDependUpon: [ ]
21+
isProvides: true
22+
- key:
23+
kind: dynamicLookup
24+
aspect: interface
25+
context: ''
26+
name: z
27+
sequenceNumber: 2
28+
defsIDependUpon: [ 0 ]
29+
isProvides: true
30+
- key:
31+
kind: dynamicLookup
32+
aspect: implementation
33+
context: ''
34+
name: z
35+
sequenceNumber: 3
36+
defsIDependUpon: [ ]
37+
isProvides: true
38+
- key:
39+
kind: topLevel
40+
aspect: interface
41+
context: ''
42+
name: a
43+
sequenceNumber: 4
44+
defsIDependUpon: [ ]
45+
isProvides: false
46+
...
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Fine-grained v0
2+
---
3+
allNodes:
4+
- key:
5+
kind: sourceFileProvide
6+
aspect: interface
7+
context: ''
8+
name: other.swiftdeps
9+
fingerprint: 72e95f4a11b98227c1f6ad6ea7f6cdba
10+
sequenceNumber: 0
11+
defsIDependUpon: [ 2 ]
12+
isProvides: true
13+
- key:
14+
kind: sourceFileProvide
15+
aspect: implementation
16+
context: ''
17+
name: other.swiftdeps
18+
fingerprint: 72e95f4a11b98227c1f6ad6ea7f6cdba
19+
sequenceNumber: 1
20+
defsIDependUpon: [ ]
21+
isProvides: true
22+
- key:
23+
kind: topLevel
24+
aspect: interface
25+
context: ''
26+
name: a
27+
sequenceNumber: 2
28+
defsIDependUpon: [ 0 ]
29+
isProvides: true
30+
- key:
31+
kind: topLevel
32+
aspect: implementation
33+
context: ''
34+
name: a
35+
sequenceNumber: 3
36+
defsIDependUpon: [ ]
37+
isProvides: true
38+
...
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"./main.swift": {
3+
"object": "./main.o",
4+
"swift-dependencies": "./main.swiftdeps"
5+
},
6+
"./other.swift": {
7+
"object": "./other.o",
8+
"swift-dependencies": "./other.swiftdeps"
9+
},
10+
"./yet-another.swift": {
11+
"object": "./yet-another.o",
12+
"swift-dependencies": "./yet-another.swiftdeps"
13+
},
14+
"": {
15+
"swift-dependencies": "./main~buildrecord.swiftdeps"
16+
}
17+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Fine-grained v0
2+
---
3+
allNodes:
4+
- key:
5+
kind: sourceFileProvide
6+
aspect: interface
7+
context: ''
8+
name: yet-another.swiftdeps
9+
fingerprint: f0a22821b1bfd1d40363b3f89c7a7693
10+
sequenceNumber: 0
11+
defsIDependUpon: [ 2 ]
12+
isProvides: true
13+
- key:
14+
kind: sourceFileProvide
15+
aspect: implementation
16+
context: ''
17+
name: yet-another.swiftdeps
18+
fingerprint: f0a22821b1bfd1d40363b3f89c7a7693
19+
sequenceNumber: 1
20+
defsIDependUpon: [ ]
21+
isProvides: true
22+
- key:
23+
kind: dynamicLookup
24+
aspect: interface
25+
context: ''
26+
name: z
27+
sequenceNumber: 2
28+
defsIDependUpon: [ ]
29+
isProvides: false
30+
...
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Fine-grained v0
2+
---
3+
allNodes:
4+
- key:
5+
kind: sourceFileProvide
6+
aspect: interface
7+
context: ''
8+
name: main.swiftdeps
9+
fingerprint: 42e5bb8d6f23bfc1b055b85bd466a86c
10+
sequenceNumber: 0
11+
defsIDependUpon: [ 2, 4 ]
12+
isProvides: true
13+
- key:
14+
kind: sourceFileProvide
15+
aspect: implementation
16+
context: ''
17+
name: main.swiftdeps
18+
fingerprint: 42e5bb8d6f23bfc1b055b85bd466a86c
19+
sequenceNumber: 1
20+
defsIDependUpon: [ ]
21+
isProvides: true
22+
- key:
23+
kind: nominal
24+
aspect: interface
25+
context: 4main1zV
26+
name: ''
27+
sequenceNumber: 2
28+
defsIDependUpon: [ 0 ]
29+
isProvides: true
30+
- key:
31+
kind: nominal
32+
aspect: implementation
33+
context: 4main1zV
34+
name: ''
35+
sequenceNumber: 3
36+
defsIDependUpon: [ ]
37+
isProvides: true
38+
- key:
39+
kind: topLevel
40+
aspect: interface
41+
context: ''
42+
name: a
43+
sequenceNumber: 4
44+
defsIDependUpon: [ ]
45+
isProvides: false
46+
...
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Fine-grained v0
2+
---
3+
allNodes:
4+
- key:
5+
kind: sourceFileProvide
6+
aspect: interface
7+
context: ''
8+
name: main.swiftdeps
9+
fingerprint: 42e5bb8d6f23bfc1b055b85bd466a86c
10+
sequenceNumber: 0
11+
defsIDependUpon: [ 2 ]
12+
isProvides: true
13+
- key:
14+
kind: sourceFileProvide
15+
aspect: implementation
16+
context: ''
17+
name: main.swiftdeps
18+
fingerprint: 42e5bb8d6f23bfc1b055b85bd466a86c
19+
sequenceNumber: 1
20+
defsIDependUpon: [ ]
21+
isProvides: true
22+
- key:
23+
kind: topLevel
24+
aspect: interface
25+
context: ''
26+
name: a
27+
sequenceNumber: 2
28+
defsIDependUpon: [ ]
29+
isProvides: false
30+
...
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Fine-grained v0
2+
---
3+
allNodes:
4+
- key:
5+
kind: sourceFileProvide
6+
aspect: interface
7+
context: ''
8+
name: other.swiftdeps
9+
fingerprint: 72e95f4a11b98227c1f6ad6ea7f6cdba
10+
sequenceNumber: 0
11+
defsIDependUpon: [ 2 ]
12+
isProvides: true
13+
- key:
14+
kind: sourceFileProvide
15+
aspect: implementation
16+
context: ''
17+
name: other.swiftdeps
18+
fingerprint: 72e95f4a11b98227c1f6ad6ea7f6cdba
19+
sequenceNumber: 1
20+
defsIDependUpon: [ ]
21+
isProvides: true
22+
- key:
23+
kind: topLevel
24+
aspect: interface
25+
context: ''
26+
name: a
27+
sequenceNumber: 2
28+
defsIDependUpon: [ 0 ]
29+
isProvides: true
30+
- key:
31+
kind: topLevel
32+
aspect: implementation
33+
context: ''
34+
name: a
35+
sequenceNumber: 3
36+
defsIDependUpon: [ ]
37+
isProvides: true
38+
...
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Fine-grained v0
2+
---
3+
allNodes:
4+
- key:
5+
kind: sourceFileProvide
6+
aspect: interface
7+
context: ''
8+
name: other.swiftdeps
9+
fingerprint: 72e95f4a11b98227c1f6ad6ea7f6cdba
10+
sequenceNumber: 0
11+
defsIDependUpon: [ 2 ]
12+
isProvides: true
13+
- key:
14+
kind: sourceFileProvide
15+
aspect: implementation
16+
context: ''
17+
name: other.swiftdeps
18+
fingerprint: 72e95f4a11b98227c1f6ad6ea7f6cdba
19+
sequenceNumber: 1
20+
defsIDependUpon: [ ]
21+
isProvides: true
22+
- key:
23+
kind: topLevel
24+
aspect: interface
25+
context: ''
26+
name: a
27+
sequenceNumber: 2
28+
defsIDependUpon: [ 0 ]
29+
isProvides: true
30+
- key:
31+
kind: topLevel
32+
aspect: implementation
33+
context: ''
34+
name: a
35+
sequenceNumber: 3
36+
defsIDependUpon: [ ]
37+
isProvides: true
38+
...

0 commit comments

Comments
 (0)