-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
44 lines (33 loc) · 1.25 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
PLATFORM_IOS = iOS Simulator,name=iPad mini (A17 Pro)
PLATFORM_MACOS = macOS
XCCOV = xcrun xccov view --report --only-targets
DEST = -scheme 'iOS App' -destination platform="$(PLATFORM_IOS)"
default: report
build: clean
xcodebuild -workspace SoundFonts.xcworkspace build-for-testing $(DEST) -resultBundlePath $PWD
test: build
xcodebuild test-without-building $(DEST)
test-iOS:
rm -rf "$(PWD)/.DerivedData-iOS"
xcodebuild test \
-scheme 'iOS App' \
-derivedDataPath "$(PWD)/.DerivedData-iOS" \
-destination platform="$(PLATFORM_IOS)" \
-enableCodeCoverage YES \
ENABLE_TESTING_SEARCH_PATHS=YES
coverage-iOS: test-iOS
$(XCCOV) $(PWD)/.DerivedData-iOS/Logs/Test/*.xcresult > coverage_iOS.txt
echo "iOS Coverage:"
cat coverage_iOS.txt
PATTERN = (SF2Files|SoundFontInfoLib|SoundFontsFramework).framework|SooundFontsApp.app|SoundFonts.appex
percentage-iOS: coverage-iOS
awk '/$(PATTERN)/ {s+=$$4;++c} END {print s/c;}' coverage_iOS.txt > percentage_iOS.txt
echo "iOS Coverage Pct:"
cat percentage_iOS.txt
report: percentage-iOS
@if [[ -n "$$GITHUB_ENV" ]]; then \
echo "PERCENTAGE=$$(< percentage_iOS.txt)" >> $$GITHUB_ENV; \
fi
clean:
-rm -rf $(PWD)/.DerivedData-iOS coverage*.txt percentage*.txt
.PHONY: report percentage-iOS coverage-iOS test-iOS