Skip to content

Commit 0c4427b

Browse files
authored
Fix issue with test availability in Linux (swiftlang#4)
1 parent e2918c0 commit 0c4427b

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

.github/workflows/pull_request.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ jobs:
2020
curl -sL https://raw.githubusercontent.com/apple/swift-mmio/refs/heads/main/.swift-format -o .swift-format-mmio
2121
diff .swift-format .swift-format-mmio
2222
23-
# tests:
24-
# name: Test
25-
# uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
26-
# with:
27-
# macos_exclude_xcode_versions: "[{\"xcode_version\": \"16.0\"}, {\"xcode_version\": \"16.1\"}, {\"xcode_version\": \"16.2\"}, {\"xcode_version\": \"16.3\"}]"
28-
# linux_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}, {\"swift_version\": \"6.0\"}, {\"swift_version\": \"6.1\"}, {\"swift_version\": \"nightly-main\"}, {\"swift_version\": \"nightly-6.1\"}, {\"swift_version\": \"nightly-6.2\"}]"
29-
# windows_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"6.0\"}, {\"swift_version\": \"6.1\"}, {\"swift_version\": \"nightly\"}, {\"swift_version\": \"nightly-6.1\"}]"
30-
# enable_macos_checks: true
23+
tests:
24+
name: Test
25+
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
26+
with:
27+
macos_exclude_xcode_versions: "[{\"xcode_version\": \"16.0\"}, {\"xcode_version\": \"16.1\"}, {\"xcode_version\": \"16.2\"}, {\"xcode_version\": \"16.3\"}]"
28+
linux_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"5.10\"}, {\"swift_version\": \"6.0\"}, {\"swift_version\": \"6.1\"}, {\"swift_version\": \"nightly-main\"}, {\"swift_version\": \"nightly-6.1\"}]"
29+
windows_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"6.0\"}, {\"swift_version\": \"6.1\"}, {\"swift_version\": \"nightly\"}, {\"swift_version\": \"nightly-6.1\"}]"
30+
enable_macos_checks: false
31+
enable_windows_checks: false
3132

3233
soundness:
3334
name: Soundness

.unacceptablelanguageignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CODE_OF_CONDUCT.md

Tests/ExampleParserTests/TestQOI.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@ import Testing
1515

1616
#if canImport(AppKit)
1717
import AppKit
18+
#else
19+
import Foundation
1820
#endif
1921

2022
struct QOITests {
2123
@Test(arguments: ["tricolor", "antelope"])
2224
func parseImage(fileName: String) throws {
2325
let qoi = try #require(Self.getQOIPixels(testFileName: fileName))
24-
if #available(macOS 10.0, *) {
25-
let png = try #require(Self.getPNGPixels(testFileName: fileName))
26-
#expect(png == qoi)
27-
}
26+
#if canImport(AppKit)
27+
let png = try #require(Self.getPNGPixels(testFileName: fileName))
28+
#expect(png == qoi)
29+
#endif
2830
}
2931

3032
static func getQOIPixels(testFileName: String) -> Data? {
@@ -36,7 +38,7 @@ struct QOITests {
3638
}.pixels
3739
}
3840

39-
@available(macOS 10.0, *)
41+
#if canImport(AppKit)
4042
static func getPNGPixels(testFileName: String) -> Data? {
4143
guard let imageData = testData(named: "PNG/\(testFileName).png"),
4244
let image = NSImage(data: imageData)
@@ -53,4 +55,5 @@ struct QOITests {
5355
}
5456
return nil
5557
}
58+
#endif
5659
}

0 commit comments

Comments
 (0)