Fix and re-enable disabled 'InterfaceHash' tests

- Force loading of module dependencies from interface
- Set a unique module cache path for these tests
This commit is contained in:
Artem Chikin
2024-02-23 12:00:43 -08:00
parent 9504de5ed7
commit 71970fcf1f
3 changed files with 10 additions and 17 deletions

View File

@@ -1,7 +1,8 @@
// RUN: %empty-directory(%t) // RUN: %empty-directory(%t)
// RUN: %empty-directory(%t/ModuleCache)
// RUN: %{python} %utils/split_file.py -o %t %s // RUN: %{python} %utils/split_file.py -o %t %s
// RUN: %target-swift-frontend -dump-interface-hash -primary-file %t/a.swift 2> %t/a.hash // RUN: %target-swift-frontend -dump-interface-hash -primary-file %t/a.swift -module-cache-path %t/ModuleCache 2> %t/a.hash
// RUN: %target-swift-frontend -dump-interface-hash -primary-file %t/b.swift 2> %t/b.hash // RUN: %target-swift-frontend -dump-interface-hash -primary-file %t/b.swift -module-cache-path %t/ModuleCache 2> %t/b.hash
// RUN: cmp %t/a.hash %t/b.hash // RUN: cmp %t/a.hash %t/b.hash
// BEGIN a.swift // BEGIN a.swift

View File

@@ -1,18 +1,14 @@
// UNSUPPORTED: OS=windows-msvc
// rdar://124402245
// UNSUPPORTED: OS=linux-gnu
// When adding a private protocol method, the interface hash should stay the same // When adding a private protocol method, the interface hash should stay the same
// The per-type fingerprint should change // The per-type fingerprint should change
// RUN: %empty-directory(%t) // RUN: %empty-directory(%t)
// RUN: %empty-directory(%t/ModuleCache)
// RUN: %{python} %utils/split_file.py -o %t %s // RUN: %{python} %utils/split_file.py -o %t %s
// RUN: cp %t/{a,x}.swift // RUN: cp %t/{a,x}.swift
// RUN: %target-swift-frontend -typecheck -primary-file %t/x.swift -emit-reference-dependencies-path %t/x.swiftdeps -module-name main // 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
// RUN: %{python} %S/../Inputs/process_fine_grained_swiftdeps_with_fingerprints.py %swift-dependency-tool %t/x.swiftdeps > %t/a-processed.swiftdeps // RUN: %{python} %S/../Inputs/process_fine_grained_swiftdeps_with_fingerprints.py %swift-dependency-tool %t/x.swiftdeps > %t/a-processed.swiftdeps
// RUN: cp %t/{b,x}.swift // RUN: cp %t/{b,x}.swift
// RUN: %target-swift-frontend -typecheck -primary-file %t/x.swift -emit-reference-dependencies-path %t/x.swiftdeps -module-name main // 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
// RUN: %{python} %S/../Inputs/process_fine_grained_swiftdeps_with_fingerprints.py %swift-dependency-tool %t/x.swiftdeps > %t/b-processed.swiftdeps // RUN: %{python} %S/../Inputs/process_fine_grained_swiftdeps_with_fingerprints.py %swift-dependency-tool %t/x.swiftdeps > %t/b-processed.swiftdeps
// RUN: diff %t/a-processed.swiftdeps %t/b-processed.swiftdeps // RUN: diff %t/a-processed.swiftdeps %t/b-processed.swiftdeps

View File

@@ -1,21 +1,17 @@
// UNSUPPORTED: OS=windows-msvc
// rdar://124402245
// UNSUPPORTED: OS=linux-gnu
// When adding a private protocol method, the interface hash should stay the same // When adding a private protocol method, the interface hash should stay the same
// The per-type fingerprint should change // The per-type fingerprint should change
// RUN: %empty-directory(%t) // RUN: %empty-directory(%t)
// RUN: %empty-directory(%t/ModuleCache)
// RUN: %{python} %utils/split_file.py -o %t %s // RUN: %{python} %utils/split_file.py -o %t %s
// RUN: cp %t/{a,x}.swift // RUN: cp %t/{a,x}.swift
// RUN: %target-swift-frontend -typecheck -primary-file %t/x.swift -emit-reference-dependencies-path %t/x.swiftdeps -module-name main // 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
// RUN: %{python} %S/../Inputs/process_fine_grained_swiftdeps_with_fingerprints.py %swift-dependency-tool %t/x.swiftdeps > %t/a-processed.swiftdeps // RUN: %{python} %S/../Inputs/process_fine_grained_swiftdeps_with_fingerprints.py %swift-dependency-tool %t/x.swiftdeps > %t/a-processed.swiftdeps
// RUN: cp %t/{b,x}.swift // RUN: cp %t/{b,x}.swift
// RUN: %target-swift-frontend -typecheck -primary-file %t/x.swift -emit-reference-dependencies-path %t/x.swiftdeps -module-name main // 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
// RUN: %{python} %S/../Inputs/process_fine_grained_swiftdeps_with_fingerprints.py %swift-dependency-tool %t/x.swiftdeps > %t/b-processed.swiftdeps // RUN: %{python} %S/../Inputs/process_fine_grained_swiftdeps_with_fingerprints.py %swift-dependency-tool %t/x.swiftdeps > %t/b-processed.swiftdeps
// RUN: cmp %t/a-processed.swiftdeps %t/b-processed.swiftdeps // RUN: diff %t/a-processed.swiftdeps %t/b-processed.swiftdeps
// BEGIN a.swift // BEGIN a.swift
class C { class C {