Skip to content

Fix issue with test availability in Linux #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ jobs:
curl -sL https://raw.githubusercontent.com/apple/swift-mmio/refs/heads/main/.swift-format -o .swift-format-mmio
diff .swift-format .swift-format-mmio

# tests:
# name: Test
# uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
# with:
# macos_exclude_xcode_versions: "[{\"xcode_version\": \"16.0\"}, {\"xcode_version\": \"16.1\"}, {\"xcode_version\": \"16.2\"}, {\"xcode_version\": \"16.3\"}]"
# 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\"}]"
# windows_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"6.0\"}, {\"swift_version\": \"6.1\"}, {\"swift_version\": \"nightly\"}, {\"swift_version\": \"nightly-6.1\"}]"
# enable_macos_checks: true
tests:
name: Test
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
with:
macos_exclude_xcode_versions: "[{\"xcode_version\": \"16.0\"}, {\"xcode_version\": \"16.1\"}, {\"xcode_version\": \"16.2\"}, {\"xcode_version\": \"16.3\"}]"
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\"}]"
windows_exclude_swift_versions: "[{\"swift_version\": \"5.9\"}, {\"swift_version\": \"6.0\"}, {\"swift_version\": \"6.1\"}, {\"swift_version\": \"nightly\"}, {\"swift_version\": \"nightly-6.1\"}]"
enable_macos_checks: false
enable_windows_checks: false

soundness:
name: Soundness
Expand Down
1 change: 1 addition & 0 deletions .unacceptablelanguageignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CODE_OF_CONDUCT.md
13 changes: 8 additions & 5 deletions Tests/ExampleParserTests/TestQOI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,18 @@ import Testing

#if canImport(AppKit)
import AppKit
#else
import Foundation
#endif

struct QOITests {
@Test(arguments: ["tricolor", "antelope"])
func parseImage(fileName: String) throws {
let qoi = try #require(Self.getQOIPixels(testFileName: fileName))
if #available(macOS 10.0, *) {
let png = try #require(Self.getPNGPixels(testFileName: fileName))
#expect(png == qoi)
}
#if canImport(AppKit)
let png = try #require(Self.getPNGPixels(testFileName: fileName))
#expect(png == qoi)
#endif
}

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

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