Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
- name: Run ${{ matrix.config }} tests
run: CONFIG=${{ matrix.config }} make test
run: CONFIG=${{ matrix.config }} make test-all

ubuntu_tests:
ubuntu-tests:
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
Expand Down
21 changes: 19 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
CONFIG = debug
PLATFORM = iOS Simulator,name=iPhone 13 Pro
PLATFORM_IOS = iOS Simulator,name=iPhone 13 Pro
PLATFORM_MACOS = macOS
PLATFORM_MAC_CATALYST = macOS,variant=Mac Catalyst
PLATFORM_TVOS = tvOS Simulator,name=Apple TV
PLATFORM_WATCHOS = watchOS Simulator,name=Apple Watch Series 7 (45mm)

CONFIG = debug

test-all: test build

test:
xcodebuild test \
-configuration $(CONFIG) \
-scheme Clocks \
-destination platform="$(PLATFORM)"
-destination platform="$(PLATFORM_IOS)"

build:
for platform in "$(PLATFORM_IOS)" "$(PLATFORM_MACOS)" "$(PLATFORM_MAC_CATALYST)" "$(PLATFORM_TVOS)" "$(PLATFORM_WATCHOS)"; do \
xcodebuild \
-configuration $(CONFIG) \
-workspace Clocks.xcworkspace \
-scheme Clocks \
-destination platform="$$platform" || exit 1; \
done;

test-linux:
docker run \
Expand Down
2 changes: 1 addition & 1 deletion Sources/Clocks/ImmediateClock.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if swift(>=5.7) && (canImport(RegexBuilder) || !os(macOS))
#if swift(>=5.7) && (canImport(RegexBuilder) || !os(macOS) && !targetEnvironment(macCatalyst))
import Foundation

/// A clock that does not suspend when sleeping.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Clocks/Internal/_AnyClock.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if swift(>=5.7) && (canImport(RegexBuilder) || !os(macOS))
#if swift(>=5.7) && (canImport(RegexBuilder) || !os(macOS) && !targetEnvironment(macCatalyst))
/// Internal use only. Not meant to be used outside the library.
@available(iOS 16, macOS 13, tvOS 16, watchOS 9, *)
public struct _AnyClock<Duration: DurationProtocol & Hashable>: Clock {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Clocks/Internal/_AsyncTimerSequence.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if swift(>=5.7) && (canImport(RegexBuilder) || !os(macOS))
#if swift(>=5.7) && (canImport(RegexBuilder) || !os(macOS) && !targetEnvironment(macCatalyst))
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Async Algorithms open source project
Expand Down
2 changes: 1 addition & 1 deletion Sources/Clocks/Shims.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if swift(>=5.7) && (canImport(RegexBuilder) || !os(macOS))
#if swift(>=5.7) && (canImport(RegexBuilder) || !os(macOS) && !targetEnvironment(macCatalyst))
@available(iOS 16, macOS 13, tvOS 16, watchOS 9, *)
extension Clock {
/// Suspends for the given duration.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Clocks/SwiftUI.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if swift(>=5.7) && (canImport(RegexBuilder) || !os(macOS)) && canImport(SwiftUI)
#if swift(>=5.7) && (canImport(RegexBuilder) || !os(macOS) && !targetEnvironment(macCatalyst)) && canImport(SwiftUI)
import SwiftUI

@available(macOS 13, iOS 16, watchOS 9, tvOS 16, *)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Clocks/TestClock.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if swift(>=5.7) && (canImport(RegexBuilder) || !os(macOS))
#if swift(>=5.7) && (canImport(RegexBuilder) || !os(macOS) && !targetEnvironment(macCatalyst))
import Foundation
import XCTestDynamicOverlay

Expand Down
2 changes: 1 addition & 1 deletion Sources/Clocks/Timer.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if swift(>=5.7) && (canImport(RegexBuilder) || !os(macOS))
#if swift(>=5.7) && (canImport(RegexBuilder) || !os(macOS) && !targetEnvironment(macCatalyst))
@available(iOS 16, macOS 13, tvOS 16, watchOS 9, *)
extension Clock where Duration: Hashable {
/// Creates an async sequence that emits the clock's `now` value on an interval.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Clocks/UnimplementedClock.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if swift(>=5.7) && (canImport(RegexBuilder) || !os(macOS))
#if swift(>=5.7) && (canImport(RegexBuilder) || !os(macOS) && !targetEnvironment(macCatalyst))
import Foundation
import XCTestDynamicOverlay

Expand Down