Skip to content

Commit 39de59b

Browse files
authored
Fix Linux/Windows Testing support (#149)
* Fix Linux/Windows Testing support * wip * wip * wip * wip
1 parent 2ccee55 commit 39de59b

File tree

5 files changed

+20
-17
lines changed

5 files changed

+20
-17
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
- release
8585
name: Linux
8686
runs-on: ubuntu-latest
87-
container: swift:5.10
87+
container: swift:6.0.3
8888
steps:
8989
- uses: actions/checkout@v4
9090
- name: Install dependencies
@@ -110,7 +110,7 @@ jobs:
110110
echo "$PREFIX/usr/bin" >> $GITHUB_PATH
111111
112112
- name: Build
113-
run: swift build --swift-sdk wasm32-unknown-wasi --build-tests -Xlinker -z -Xlinker stack-size=$((1024 * 1024))
113+
run: swift build --target IssueReporting --swift-sdk wasm32-unknown-wasi -Xlinker -z -Xlinker stack-size=$((1024 * 1024))
114114

115115
windows:
116116
name: Windows
@@ -141,4 +141,4 @@ jobs:
141141
steps:
142142
- uses: actions/checkout@v4
143143
- name: "Test Swift Package on Android"
144-
uses: skiptools/swift-android-action@v2
144+
uses: skiptools/swift-android-action@v2

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ format:
4545
--in-place \
4646
--recursive \
4747
.
48+
4849
test-linux:
4950
docker run \
5051
--rm \
5152
-v "$(PWD):$(PWD)" \
5253
-w "$(PWD)" \
53-
swift:5.10 \
54+
swift:6.0.3-focal \
5455
bash -c 'swift test -c $(CONFIG)'

Package.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ let package = Package(
1313
],
1414
products: [
1515
.library(name: "IssueReporting", targets: ["IssueReporting"]),
16-
.library(name: "IssueReportingTestSupport", targets: ["IssueReportingTestSupport"]),
16+
.library(
17+
name: "IssueReportingTestSupport",
18+
type: .dynamic,
19+
targets: ["IssueReportingTestSupport"]
20+
),
1721
.library(name: "XCTestDynamicOverlay", targets: ["XCTestDynamicOverlay"]),
1822
],
1923
targets: [

Package@swift-6.0.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ let package = Package(
1212
],
1313
products: [
1414
.library(name: "IssueReporting", targets: ["IssueReporting"]),
15-
.library(name: "IssueReportingTestSupport", targets: ["IssueReportingTestSupport"]),
15+
.library(
16+
name: "IssueReportingTestSupport",
17+
type: .dynamic,
18+
targets: ["IssueReportingTestSupport"]
19+
),
1620
.library(name: "XCTestDynamicOverlay", targets: ["XCTestDynamicOverlay"]),
1721
],
1822
targets: [
@@ -44,12 +48,6 @@ let package = Package(
4448
swiftLanguageModes: [.v6]
4549
)
4650

47-
#if os(Linux) || os(Windows)
48-
package.dependencies.append(
49-
.package(url: "https://github.com/apple/swift-testing", from: "0.11.0")
50-
)
51-
#endif
52-
5351
#if os(macOS)
5452
package.dependencies.append(contentsOf: [
5553
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),

Sources/IssueReporting/Internal/SwiftTesting.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func _recordIssue(
1414
) {
1515
guard let function = function(for: "$s25IssueReportingTestSupport07_recordA0ypyF")
1616
else {
17-
#if DEBUG
17+
#if DEBUG && canImport(Darwin)
1818
guard
1919
let record = unsafeBitCast(
2020
symbol: "$s7Testing5IssueV6record_14sourceLocationAcA7CommentVSg_AA06SourceE0VtFZ",
@@ -60,7 +60,7 @@ func _recordError(
6060
) {
6161
guard let function = function(for: "$s25IssueReportingTestSupport12_recordErrorypyF")
6262
else {
63-
#if DEBUG
63+
#if DEBUG && canImport(Darwin)
6464
guard
6565
let record = unsafeBitCast(
6666
symbol: """
@@ -110,7 +110,7 @@ func _withKnownIssue(
110110
) {
111111
guard let function = function(for: "$s25IssueReportingTestSupport010_withKnownA0ypyF")
112112
else {
113-
#if DEBUG
113+
#if DEBUG && canImport(Darwin)
114114
guard
115115
let withKnownIssue = unsafeBitCast(
116116
symbol: """
@@ -182,7 +182,7 @@ func _withKnownIssue(
182182
guard
183183
let function = function(for: "$s25IssueReportingTestSupport010_withKnownA13AsyncIsolatedypyF")
184184
else {
185-
#if DEBUG
185+
#if DEBUG && canImport(Darwin)
186186
guard
187187
let withKnownIssue = unsafeBitCast(
188188
symbol: """
@@ -254,7 +254,7 @@ func _withKnownIssue(
254254
) async {
255255
guard let function = function(for: "$s25IssueReportingTestSupport010_withKnownA5AsyncypyF")
256256
else {
257-
#if DEBUG
257+
#if DEBUG && canImport(Darwin)
258258
guard
259259
let withKnownIssue = unsafeBitCast(
260260
symbol: """

0 commit comments

Comments
 (0)