From b8da67ffd913f01a1a68cf03389002028b579c1b Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 5 Nov 2021 10:39:10 -0700 Subject: [PATCH 1/2] Tests: disable Asynchronous.Use on Windows Disable this test on Windows as this is exposing a latent UB in the Concurrency runtime. It seems better to safely disable this test on Windows for the time being until the runtime is fixed. --- Tests/Functional/Asynchronous/Use/main.swift | 4 +++- Tests/Functional/lit.cfg | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Tests/Functional/Asynchronous/Use/main.swift b/Tests/Functional/Asynchronous/Use/main.swift index 249a635f..7ffa2194 100644 --- a/Tests/Functional/Asynchronous/Use/main.swift +++ b/Tests/Functional/Asynchronous/Use/main.swift @@ -3,6 +3,8 @@ // RUN: %{xctest_checker} %t %s // REQUIRES: concurrency_runtime +// UNSUPPORTED: OS=windows + #if os(macOS) import SwiftXCTest #else @@ -57,7 +59,7 @@ class AsyncAwaitTests: XCTestCase { override func setUp() async throws {} override func tearDown() async throws {} - + // CHECK: Test Case 'AsyncAwaitTests.test_explicitFailures_withinAsyncTests_areReported' started at \d+-\d+-\d+ \d+:\d+:\d+\.\d+ // CHECK: .*[/\\]Asynchronous[/\\]Use[/\\]main.swift:[[@LINE+3]]: error: AsyncAwaitTests.test_explicitFailures_withinAsyncTests_areReported : XCTAssertTrue failed - // CHECK: Test Case 'AsyncAwaitTests.test_explicitFailures_withinAsyncTests_areReported' failed \(\d+\.\d+ seconds\) diff --git a/Tests/Functional/lit.cfg b/Tests/Functional/lit.cfg index 49a5bf3b..ed48f57f 100644 --- a/Tests/Functional/lit.cfg +++ b/Tests/Functional/lit.cfg @@ -148,3 +148,5 @@ os_is_not_macOS = run_os != 'Darwin' macOS_version_is_recent_enough = parse_version(run_vers) >= parse_version('12.0') if os_is_not_macOS or macOS_version_is_recent_enough: config.available_features.add('concurrency_runtime') +if run_os == 'Windows': + config.available_features.add('OS=windows') From f9722e6e06ca9e802e61c508f3fd055a17e79b27 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 30 Sep 2021 17:37:38 -0700 Subject: [PATCH 2/2] tests: allow passing in SDKROOT for Windows as well Allow passing through `-sdk %SDKROOT%` on Windows for tests. --- Tests/Functional/lit.cfg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tests/Functional/lit.cfg b/Tests/Functional/lit.cfg index ed48f57f..ab0684f5 100644 --- a/Tests/Functional/lit.cfg +++ b/Tests/Functional/lit.cfg @@ -75,6 +75,9 @@ else: # We need to jump through extra hoops to link swift-corelibs-foundation. foundation_dir = _getenv('FOUNDATION_BUILT_PRODUCTS_DIR') if platform.system() == 'Windows': + sdkroot = os.getenv('SDKROOT', None) + if sdkroot: + swift_exec.extend(['-sdk', sdkroot]) swift_exec.extend(['-Xlinker', '-nodefaultlib:libcmt']) else: swift_exec.extend([