1
- PLATFORM_IOS = iOS Simulator,name=iPhone 15 Pro
1
+ CONFIG = debug
2
+ PLATFORM_IOS = iOS Simulator,id=$(call udid_for,iOS 17.5,iPhone \d\+ Pro [^M])
2
3
PLATFORM_MACOS = macOS
3
4
PLATFORM_MAC_CATALYST = macOS,variant=Mac Catalyst
4
- PLATFORM_TVOS = tvOS Simulator,name=Apple TV
5
- PLATFORM_WATCHOS = watchOS Simulator,name=Apple Watch Series 9 (41mm)
5
+ PLATFORM_TVOS = tvOS Simulator,id=$(call udid_for,tvOS 17.5,TV)
6
+ PLATFORM_VISIONOS = visionOS Simulator,id=$(call udid_for,visionOS 1.2,Vision)
7
+ PLATFORM_WATCHOS = watchOS Simulator,id=$(call udid_for,watchOS 10.5,Watch)
6
8
7
9
SCHEME ?= Supabase
8
- PLATFORM ?= iOS Simulator,name=iPhone 15 Pro
10
+ PLATFORM ?= $( PLATFORM_IOS )
9
11
10
12
export SECRETS
11
13
define SECRETS
@@ -22,31 +24,50 @@ load-env:
22
24
dot-env :
23
25
@echo " $$ SECRETS" > Tests/IntegrationTests/DotEnv.swift
24
26
25
- test-all : dot-env
26
- set -o pipefail && \
27
- xcodebuild test \
28
- -skipMacroValidation \
29
- -workspace supabase-swift.xcworkspace \
30
- -scheme " $( SCHEME) " \
31
- -testPlan AllTests \
32
- -destination platform=" $( PLATFORM) " | xcpretty
27
+
28
+ build-all-platforms :
29
+ for platform in " iOS" " macOS" " macOS,variant=Mac Catalyst" " tvOS" " visionOS" " watchOS" ; do \
30
+ xcodebuild \
31
+ -skipMacroValidation \
32
+ -configuration " $( CONFIG) " \
33
+ -workspace Supabase.xcworkspace \
34
+ -scheme " $( SCHEME) " \
35
+ -testPlan AllTests \
36
+ -destination platform=" $$ platform" | xcpretty || exit 1; \
37
+ done
33
38
34
39
test-library : dot-env
35
- set -o pipefail && \
36
- xcodebuild test \
37
- -skipMacroValidation \
38
- -workspace supabase-swift.xcworkspace \
39
- -scheme " $( SCHEME) " \
40
- -derivedDataPath /tmp/derived-data \
41
- -destination platform=" $( PLATFORM) " | xcpretty
40
+ for platform in " $( PLATFORM_IOS) " " $( PLATFORM_MACOS) " " $( PLATFORM_MAC_CATALYST) " " $( PLATFORM_TVOS) " " $( PLATFORM_VISIONOS) " " $( PLATFORM_WATCHOS) " ; do \
41
+ xcodebuild test \
42
+ -skipMacroValidation \
43
+ -configuration " $( CONFIG) " \
44
+ -workspace Supabase.xcworkspace \
45
+ -scheme " $( SCHEME) " \
46
+ -destination platform=" $$ platform" | xcpretty || exit 1; \
47
+ done
48
+
49
+ test-auth :
50
+ $(MAKE ) SCHEME=Auth test-library
51
+
52
+ test-functions :
53
+ $(MAKE ) SCHEME=Functions test-library
54
+
55
+ test-postgrest :
56
+ $(MAKE ) SCHEME=PostgREST test-library
57
+
58
+ test-realtime :
59
+ $(MAKE ) SCHEME=Realtime test-library
60
+
61
+ test-storage :
62
+ $(MAKE ) SCHEME=Storage test-library
42
63
43
64
test-integration : dot-env
44
65
set -o pipefail && \
45
66
xcodebuild test \
46
67
-skipMacroValidation \
47
- -workspace supabase-swift .xcworkspace \
68
+ -workspace Supabase .xcworkspace \
48
69
-scheme Supabase \
49
- -testPlan IntegrationTests \
70
+ -testPlan Integration \
50
71
-destination platform=" $( PLATFORM_IOS) " | xcpretty
51
72
52
73
@@ -80,7 +101,7 @@ build-examples:
80
101
set -o pipefail && \
81
102
xcodebuild build \
82
103
-skipMacroValidation \
83
- -workspace supabase-swift .xcworkspace \
104
+ -workspace Supabase .xcworkspace \
84
105
-scheme " $$ scheme" \
85
106
-destination platform=" $( PLATFORM_IOS) " | xcpretty; \
86
107
done
@@ -89,3 +110,7 @@ format:
89
110
@swiftformat .
90
111
91
112
.PHONY : test-library test-linux build-example format
113
+
114
+ define udid_for
115
+ $(shell xcrun simctl list devices available '$(1 ) ' | grep '$(2 ) ' | sort -r | head -1 | awk -F '[() ]' '{ print $$(NF-3 ) }')
116
+ endef
0 commit comments