Skip to content

Commit

Permalink
Add support for Mac Catalyst (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzalezreal authored Dec 31, 2023
1 parent 5be879a commit ae799d0
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ test-macos:
-scheme MarkdownUI \
-destination platform="macOS"

test-macos-maccatalyst:
xcodebuild test \
-scheme MarkdownUI \
-destination platform="macOS,variant=Mac Catalyst"

test-ios:
xcodebuild test \
-scheme MarkdownUI \
Expand All @@ -18,7 +23,7 @@ test-watchos:
-scheme MarkdownUI \
-destination platform="watchOS Simulator,name=Apple Watch SE (40mm) (2nd generation)"

test: test-macos test-ios test-tvos test-watchos
test: test-macos test-macos-maccatalyst test-ios test-tvos test-watchos

format:
swift format --in-place --recursive .
Expand Down
1 change: 1 addition & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ let package = Package(
.macOS(.v12),
.iOS(.v15),
.tvOS(.v15),
.macCatalyst(.v15),
.watchOS(.v8),
],
products: [
Expand Down
4 changes: 4 additions & 0 deletions Tests/MarkdownUITests/MarkdownImageTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
final class MarkdownImageTests: XCTestCase {
private let layout = SwiftUISnapshotLayout.device(config: .iPhone8)

override func setUpWithError() throws {
try XCTSkipIf(UIDevice.current.userInterfaceIdiom == .pad, "Skipping on Mac Catalyst")
}

func testFailingImage() {
let view = Markdown {
#"""
Expand Down
4 changes: 4 additions & 0 deletions Tests/MarkdownUITests/MarkdownListTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
final class MarkdownListTests: XCTestCase {
private let layout = SwiftUISnapshotLayout.device(config: .iPhone8)

override func setUpWithError() throws {
try XCTSkipIf(UIDevice.current.userInterfaceIdiom == .pad, "Skipping on Mac Catalyst")
}

func testTaskList() {
let view = Markdown {
#"""
Expand Down
4 changes: 4 additions & 0 deletions Tests/MarkdownUITests/MarkdownTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
final class MarkdownTests: XCTestCase {
private let layout = SwiftUISnapshotLayout.device(config: .iPhone8)

override func setUpWithError() throws {
try XCTSkipIf(UIDevice.current.userInterfaceIdiom == .pad, "Skipping on Mac Catalyst")
}

func testBlockquote() {
let view = Markdown {
#"""
Expand Down
4 changes: 4 additions & 0 deletions Tests/MarkdownUITests/ThemeDocCTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
final class ThemeDocCTests: XCTestCase {
private let layout = SwiftUISnapshotLayout.device(config: .iPhone8)

override func setUpWithError() throws {
try XCTSkipIf(UIDevice.current.userInterfaceIdiom == .pad, "Skipping on Mac Catalyst")
}

func testInlines() {
let view = ThemePreview(theme: .docC) {
#"""
Expand Down
4 changes: 4 additions & 0 deletions Tests/MarkdownUITests/ThemeGitHubTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
private let layout = SwiftUISnapshotLayout.device(config: .iPhone8)
private let perceptualPrecision: Float = 0.97

override func setUpWithError() throws {
try XCTSkipIf(UIDevice.current.userInterfaceIdiom == .pad, "Skipping on Mac Catalyst")
}

func testInlines() {
let view = ThemePreview(theme: .gitHub) {
#"""
Expand Down

0 comments on commit ae799d0

Please sign in to comment.