Skip to content

tests: enable Serialization test on Windows #40686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions test/Serialization/restrict-swiftmodule-to-revision.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@
// RUN: %empty-directory(%t/build)
// RUN: %{python} %utils/split_file.py -o %t %s

/// Unsupported on Windows for the use of env vars.
// UNSUPPORTED: OS=windows-msvc

/// 1. Compile Lib.swift as non-resilient untagged, resilient untagged, and resilient tagged
// BEGIN Lib.swift
public func foo() {}

/// Build Lib as a resilient and non-resilient swiftmodule
// RUN: %target-swift-frontend -emit-module %t/Lib.swift -swift-version 5 -o %t/build -parse-stdlib -module-cache-path %t/cache -module-name ResilientLib -enable-library-evolution
// RUN: %target-swift-frontend -emit-module %t/Lib.swift -swift-version 5 -o %t/build -parse-stdlib -module-cache-path %t/cache -module-name NonresilientLib
// RUN: SWIFT_DEBUG_FORCE_SWIFTMODULE_REVISION=my-revision \
// RUN: env SWIFT_DEBUG_FORCE_SWIFTMODULE_REVISION=my-revision \
// RUN: %target-swift-frontend -emit-module %t/Lib.swift -swift-version 5 -o %t/build -parse-stdlib -module-cache-path %t/cache -module-name TaggedLib -enable-library-evolution


Expand All @@ -23,7 +20,7 @@ foo()

/// Building a NonresilientLib client should always succeed
// RUN: %target-swift-frontend -typecheck %t/NonresilientClient.swift -swift-version 5 -I %t/build -parse-stdlib -module-cache-path %t/cache
// RUN: SWIFT_DEBUG_FORCE_SWIFTMODULE_REVISION=my-revision \
// RUN: env SWIFT_DEBUG_FORCE_SWIFTMODULE_REVISION=my-revision \
// RUN: %target-swift-frontend -typecheck %t/NonresilientClient.swift -swift-version 5 -I %t/build -parse-stdlib -module-cache-path %t/cache


Expand All @@ -36,12 +33,12 @@ foo()
// RUN: %target-swift-frontend -typecheck %t/ResilientClient.swift -swift-version 5 -I %t/build -parse-stdlib -module-cache-path %t/cache

/// Building a ResilientLib client should reject the import for a tagged compiler
// RUN: SWIFT_DEBUG_FORCE_SWIFTMODULE_REVISION=not-a-revision \
// RUN: env SWIFT_DEBUG_FORCE_SWIFTMODULE_REVISION=not-a-revision \
// RUN: not %target-swift-frontend -typecheck %t/ResilientClient.swift -swift-version 5 -I %t/build -parse-stdlib -module-cache-path %t/cache 2>&1 | %FileCheck %s
// CHECK: compiled module was created by a different version of the compiler; rebuild 'ResilientLib' and try again: {{.*}}ResilientLib.swiftmodule

/// Building a ResilientLib client should succeed for a tagged compiler with SWIFT_DEBUG_IGNORE_SWIFTMODULE_REVISION
// RUN: SWIFT_DEBUG_FORCE_SWIFTMODULE_REVISION=not-a-revision SWIFT_DEBUG_IGNORE_SWIFTMODULE_REVISION=true \
// RUN: env SWIFT_DEBUG_FORCE_SWIFTMODULE_REVISION=not-a-revision SWIFT_DEBUG_IGNORE_SWIFTMODULE_REVISION=true \
// RUN: %target-swift-frontend -typecheck %t/ResilientClient.swift -swift-version 5 -I %t/build -parse-stdlib -module-cache-path %t/cache


Expand All @@ -51,11 +48,11 @@ import TaggedLib
foo()

/// Importing TaggedLib should success with the same tag or a dev compiler
// RUN: SWIFT_DEBUG_FORCE_SWIFTMODULE_REVISION=my-revision \
// RUN: env SWIFT_DEBUG_FORCE_SWIFTMODULE_REVISION=my-revision \
// RUN: %target-swift-frontend -typecheck %t/TaggedClient.swift -swift-version 5 -I %t/build -parse-stdlib -module-cache-path %t/cache
// RUN: %target-swift-frontend -typecheck %t/TaggedClient.swift -swift-version 5 -I %t/build -parse-stdlib -module-cache-path %t/cache

/// Building a TaggedLib client should reject the import for a different tagged compiler
// RUN: SWIFT_DEBUG_FORCE_SWIFTMODULE_REVISION=not-a-revision \
// RUN: env SWIFT_DEBUG_FORCE_SWIFTMODULE_REVISION=not-a-revision \
// RUN: not %target-swift-frontend -typecheck %t/TaggedClient.swift -swift-version 5 -I %t/build -parse-stdlib -module-cache-path %t/cache 2>&1 | %FileCheck %s --check-prefix=CHECK-TAGGED
// CHECK-TAGGED: compiled module was created by a different version of the compiler; rebuild 'TaggedLib' and try again: {{.*}}TaggedLib.swiftmodule