Skip to content

Commit

Permalink
Merge pull request #336 from apple/chefski/backport-async-support-to-…
Browse files Browse the repository at this point in the history
…5.5-windows-fix

Backport async support to 5.5, PR #2
  • Loading branch information
briancroom authored Nov 17, 2021
2 parents ee9fe6b + f9722e6 commit 39926a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Tests/Functional/Asynchronous/Use/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// RUN: %{xctest_checker} %t %s
// REQUIRES: concurrency_runtime

// UNSUPPORTED: OS=windows

#if os(macOS)
import SwiftXCTest
#else
Expand Down Expand Up @@ -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\)
Expand Down
5 changes: 5 additions & 0 deletions Tests/Functional/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down Expand Up @@ -148,3 +151,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')

0 comments on commit 39926a8

Please sign in to comment.