-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
51 lines (41 loc) · 1.56 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
PLATFORM_IOS = iOS Simulator,name=iPad mini (A17 Pro)
PLATFORM_MACOS = macOS
XCCOV = xcrun xccov view --report --only-targets
default: report
test-iOS:
rm -rf "$(PWD)/.DerivedData-iOS"
USE_UNSAFE_FLAGS="1" xcodebuild test \
-scheme AUv3-Support-iOS \
-derivedDataPath "$(PWD)/.DerivedData-iOS" \
-destination platform="$(PLATFORM_IOS)" \
-enableCodeCoverage YES
coverage-iOS: test-iOS
$(XCCOV) $(PWD)/.DerivedData-iOS/Logs/Test/*.xcresult > coverage_iOS.txt
echo "iOS Coverage:"
cat coverage_iOS.txt
percentage-iOS: coverage-iOS
awk '/ AUv3-Support / { print $$4 }' coverage_iOS.txt > percentage_iOS.txt
echo "iOS Coverage Pct:"
cat percentage_iOS.txt
test-macOS:
rm -rf "$(PWD)/.DerivedData-macOS"
USE_UNSAFE_FLAGS="1" xcodebuild test \
-scheme AUv3-Support-macOS \
-derivedDataPath "$(PWD)/.DerivedData-macOS" \
-destination platform="$(PLATFORM_MACOS)" \
-enableCodeCoverage YES
coverage-macOS: test-macOS
$(XCCOV) $(PWD)/.DerivedData-macOS/Logs/Test/*.xcresult > coverage_macOS.txt
echo "macOS Coverage:"
cat coverage_macOS.txt
percentage-macOS: coverage-macOS
awk '/ AUv3-Support / { print $$4 }' coverage_macOS.txt > percentage_macOS.txt
echo "macOS Coverage Pct:"
cat percentage_macOS.txt
report: percentage-iOS percentage-macOS
@if [[ -n "$$GITHUB_ENV" ]]; then \
echo "PERCENTAGE=$$(< percentage_macOS.txt)" >> $$GITHUB_ENV; \
fi
.PHONY: report test-iOS test-macOS coverage-iOS coverage-macOS coverage-iOS percentage-macOS percentage-iOS
clean:
-rm -rf $(PWD)/.DerivedData-macOS $(PWD)/.DerivedData-iOS coverage*.txt percentage*.txt