Skip to content

Commit 71970fc

Browse files
committed
Fix and re-enable disabled 'InterfaceHash' tests
- Force loading of module dependencies from interface - Set a unique module cache path for these tests
1 parent 9504de5 commit 71970fc

File tree

3 files changed

+10
-17
lines changed

3 files changed

+10
-17
lines changed

test/InterfaceHash/edited_function_body.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// RUN: %empty-directory(%t)
2+
// RUN: %empty-directory(%t/ModuleCache)
23
// RUN: %{python} %utils/split_file.py -o %t %s
3-
// RUN: %target-swift-frontend -dump-interface-hash -primary-file %t/a.swift 2> %t/a.hash
4-
// RUN: %target-swift-frontend -dump-interface-hash -primary-file %t/b.swift 2> %t/b.hash
4+
// RUN: %target-swift-frontend -dump-interface-hash -primary-file %t/a.swift -module-cache-path %t/ModuleCache 2> %t/a.hash
5+
// RUN: %target-swift-frontend -dump-interface-hash -primary-file %t/b.swift -module-cache-path %t/ModuleCache 2> %t/b.hash
56
// RUN: cmp %t/a.hash %t/b.hash
67

78
// BEGIN a.swift

test/InterfaceHash/edited_method_body.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
// UNSUPPORTED: OS=windows-msvc
2-
3-
// rdar://124402245
4-
// UNSUPPORTED: OS=linux-gnu
5-
61
// When adding a private protocol method, the interface hash should stay the same
72
// The per-type fingerprint should change
83

94
// RUN: %empty-directory(%t)
5+
// RUN: %empty-directory(%t/ModuleCache)
106
// RUN: %{python} %utils/split_file.py -o %t %s
117
// RUN: cp %t/{a,x}.swift
12-
// RUN: %target-swift-frontend -typecheck -primary-file %t/x.swift -emit-reference-dependencies-path %t/x.swiftdeps -module-name main
8+
// RUN: env SWIFT_FORCE_MODULE_LOADING=prefer-interface %target-swift-frontend -typecheck -primary-file %t/x.swift -emit-reference-dependencies-path %t/x.swiftdeps -module-name main -module-cache-path %t/ModuleCache -Rmodule-loading
139
// RUN: %{python} %S/../Inputs/process_fine_grained_swiftdeps_with_fingerprints.py %swift-dependency-tool %t/x.swiftdeps > %t/a-processed.swiftdeps
1410
// RUN: cp %t/{b,x}.swift
15-
// RUN: %target-swift-frontend -typecheck -primary-file %t/x.swift -emit-reference-dependencies-path %t/x.swiftdeps -module-name main
11+
// RUN: env SWIFT_FORCE_MODULE_LOADING=prefer-interface %target-swift-frontend -typecheck -primary-file %t/x.swift -emit-reference-dependencies-path %t/x.swiftdeps -module-name main -module-cache-path %t/ModuleCache -Rmodule-loading
1612
// RUN: %{python} %S/../Inputs/process_fine_grained_swiftdeps_with_fingerprints.py %swift-dependency-tool %t/x.swiftdeps > %t/b-processed.swiftdeps
1713

1814
// RUN: diff %t/a-processed.swiftdeps %t/b-processed.swiftdeps

test/InterfaceHash/edited_property_getter.swift

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
1-
// UNSUPPORTED: OS=windows-msvc
2-
3-
// rdar://124402245
4-
// UNSUPPORTED: OS=linux-gnu
5-
61
// When adding a private protocol method, the interface hash should stay the same
72
// The per-type fingerprint should change
83

94
// RUN: %empty-directory(%t)
5+
// RUN: %empty-directory(%t/ModuleCache)
106
// RUN: %{python} %utils/split_file.py -o %t %s
117
// RUN: cp %t/{a,x}.swift
12-
// RUN: %target-swift-frontend -typecheck -primary-file %t/x.swift -emit-reference-dependencies-path %t/x.swiftdeps -module-name main
8+
// RUN: env SWIFT_FORCE_MODULE_LOADING=prefer-interface %target-swift-frontend -typecheck -primary-file %t/x.swift -emit-reference-dependencies-path %t/x.swiftdeps -module-name main -module-cache-path %t/ModuleCache -Rmodule-loading
139
// RUN: %{python} %S/../Inputs/process_fine_grained_swiftdeps_with_fingerprints.py %swift-dependency-tool %t/x.swiftdeps > %t/a-processed.swiftdeps
1410
// RUN: cp %t/{b,x}.swift
15-
// RUN: %target-swift-frontend -typecheck -primary-file %t/x.swift -emit-reference-dependencies-path %t/x.swiftdeps -module-name main
11+
// RUN: env SWIFT_FORCE_MODULE_LOADING=prefer-interface %target-swift-frontend -typecheck -primary-file %t/x.swift -emit-reference-dependencies-path %t/x.swiftdeps -module-name main -module-cache-path %t/ModuleCache -Rmodule-loading
1612
// RUN: %{python} %S/../Inputs/process_fine_grained_swiftdeps_with_fingerprints.py %swift-dependency-tool %t/x.swiftdeps > %t/b-processed.swiftdeps
1713

18-
// RUN: cmp %t/a-processed.swiftdeps %t/b-processed.swiftdeps
14+
// RUN: diff %t/a-processed.swiftdeps %t/b-processed.swiftdeps
1915

2016
// BEGIN a.swift
2117
class C {

0 commit comments

Comments
 (0)