Skip to content

Commit c484969

Browse files
authored
Merge branch 'main' into fix-parameter
2 parents 185a92f + b41188c commit c484969

File tree

15 files changed

+384
-133
lines changed

15 files changed

+384
-133
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@ jobs:
1919
config:
2020
- debug
2121
- release
22+
xcode:
23+
- 15.4
24+
- 15.2
2225
name: macOS
2326
runs-on: macos-14
2427
steps:
2528
- uses: actions/checkout@v4
2629
- name: Select Xcode
27-
run: sudo xcode-select -s /Applications/Xcode_15.4.app
30+
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
2831
- name: Run tests
2932
run: make test-${{ matrix.config }}
3033

@@ -51,7 +54,7 @@ jobs:
5154
- name: Select Xcode
5255
run: sudo xcode-select -s /Applications/Xcode_15.4.app
5356
- name: Run tests
54-
run: CONFIG=${{ matrix.config }} make test-examples
57+
run: make CONFIG=${{ matrix.config }} test-examples
5558

5659
linux:
5760
strategy:
@@ -69,20 +72,31 @@ jobs:
6972
- name: Run tests
7073
run: make test-${{ matrix.config }}
7174
- name: Build for static-stdlib
72-
run: CONFIG=${{ matrix.config }} make build-for-static-stdlib
75+
run: make CONFIG=${{ matrix.config }} build-for-static-stdlib
7376

74-
# NB: Downloading the toolchain gets rate-limited by GitHub
75-
# wasm:
76-
# name: Wasm
77-
# runs-on: macos-14
78-
# steps:
79-
# - uses: actions/checkout@v4
80-
# - name: Select Xcode
81-
# run: sudo xcode-select -s /Applications/Xcode_15.4.app
82-
# - name: Select Swift version
83-
# run: echo 'wasm-DEVELOPMENT-SNAPSHOT-2024-07-08-a' > .swift-version
84-
# - name: Build
85-
# run: swift run carton bundle
77+
wasm:
78+
name: SwiftWasm
79+
runs-on: ubuntu-latest
80+
strategy:
81+
matrix:
82+
toolchain:
83+
- wasm-5.9.2-RELEASE
84+
- wasm-5.10.0-RELEASE
85+
steps:
86+
- name: Cache toolchains
87+
uses: actions/cache@v3
88+
with:
89+
path: ~/Library/Developer/Toolchains
90+
key: ${{ matrix.toolchain }}
91+
- uses: actions/checkout@v4
92+
- uses: bytecodealliance/actions/wasmtime/setup@v1
93+
- uses: swiftwasm/setup-swiftwasm@v1
94+
with:
95+
swift-version: ${{ matrix.toolchain }}
96+
- name: Build tests
97+
run: swift build --triple wasm32-unknown-wasi --build-tests -Xlinker -z -Xlinker stack-size=$((1024 * 1024))
98+
- name: Run tests
99+
run: wasmtime .build/debug/xctest-dynamic-overlayPackageTests.wasm
86100

87101
windows:
88102
name: Windows

Examples/ExamplesTests/SwiftTestingTests.swift

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,27 @@
66
@Suite
77
struct SwiftTestingTests_Debug {
88
@Test func context() {
9-
#expect(TestContext.current == .swiftTesting)
9+
switch TestContext.current {
10+
case .xcTest:
11+
#expect(Bool(true))
12+
default:
13+
Issue.record()
14+
}
1015
}
1116

1217
@Test func reportIssue_NoMessage() {
1318
withKnownIssue {
1419
reportIssue()
1520
} matching: { issue in
16-
issue.description == "Expectation failed: "
21+
issue.description == "Issue recorded"
1722
}
1823
}
1924

2025
@Test func reportIssue_CustomMessage() {
2126
withKnownIssue {
2227
reportIssue("Something went wrong")
2328
} matching: { issue in
24-
issue.description == "Expectation failed: Something went wrong"
29+
issue.description == "Issue recorded: Something went wrong"
2530
}
2631
}
2732

@@ -68,7 +73,12 @@
6873
@Suite
6974
struct SwiftTestingTests_Release {
7075
@Test func context() {
71-
#expect(TestContext.current == .xcTest)
76+
switch TestContext.current {
77+
case .xcTest:
78+
#expect(Bool(true))
79+
default:
80+
Issue.record()
81+
}
7282
}
7383

7484
@Test func reportIssueDoesNotFail() {

Examples/ExamplesTests/XCTestTests.swift

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ import XCTest
44
#if DEBUG
55
class XCTestTests_Debug: XCTestCase {
66
func testContext() {
7-
XCTAssertEqual(TestContext.current, .xcTest)
7+
switch TestContext.current {
8+
case .xcTest:
9+
XCTAssert(true)
10+
default:
11+
XCTFail()
12+
}
813
}
914

1015
#if _runtime(_ObjC)
@@ -49,7 +54,12 @@ import XCTest
4954
#else
5055
class XCTestTests_Release: XCTestCase {
5156
func testContext() {
52-
XCTAssertEqual(TestContext.current, .xcTest)
57+
switch TestContext.current {
58+
case .xcTest:
59+
XCTAssert(true)
60+
default:
61+
XCTFail()
62+
}
5363
}
5464

5565
func testReportIssueDoesNotFail() {

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
XCODE_PATH := $(shell xcode-select -p)
2+
CONFIG := debug
23

34
# NB: We can't rely on `XCTExpectFailure` because it doesn't exist in `swift-corelibs-foundation`
45
PASS = \033[1;7;32m PASS \033[0m
@@ -50,4 +51,4 @@ test-linux:
5051
-v "$(PWD):$(PWD)" \
5152
-w "$(PWD)" \
5253
swift:5.10 \
53-
bash -c 'swift test'
54+
bash -c 'swift test -c $(CONFIG)'

Sources/IssueReporting/Documentation.docc/Extensions/Unimplemented.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
- ``unimplemented(_:fileID:filePath:function:line:column:)-2ae22``
88
- ``unimplemented(_:fileID:filePath:function:line:column:)-1hsov``
9+
- ``unimplemented(_:throwing:fileID:filePath:function:line:column:)-4h958``
10+
- ``unimplemented(_:throwing:fileID:filePath:function:line:column:)-5zfy9``
911
- ``unimplemented(_:placeholder:fileID:filePath:function:line:column:)-6ts5j``
1012
- ``unimplemented(_:placeholder:fileID:filePath:function:line:column:)-34tpp``
1113

0 commit comments

Comments
 (0)