-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
30 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,28 @@ | ||
PLATFORM_IOS = iOS Simulator,name=iPhone SE (2nd generation) | ||
PLATFORM_IOS = iOS Simulator,name=iPhone SE (3rd generation) | ||
|
||
DEST = -scheme MotionCollector -destination platform="$(PLATFORM_IOS)" | ||
default: percentage | ||
|
||
default: coverage | ||
|
||
build: clean | ||
xcodebuild build $(DEST) | ||
|
||
test: build | ||
xcodebuild test $(DEST) -enableCodeCoverage YES ENABLE_TESTING_SEARCH_PATHS=YES -resultBundlePath $PWD | ||
test-ios: | ||
xcodebuild clean \ | ||
-scheme MotionCollector \ | ||
-derivedDataPath ".DerivedData-ios" \ | ||
-destination platform="$(PLATFORM_IOS)" | ||
xcodebuild test \ | ||
-scheme MotionCollector \ | ||
-derivedDataPath ".DerivedData-ios" \ | ||
-destination platform="$(PLATFORM_IOS)" \ | ||
-enableCodeCoverage YES | ||
|
||
# Extract coverage info for SoundFonts -- expects defintion of env variable GITHUB_ENV | ||
COV = xcrun xccov view --report --only-targets | ||
|
||
cov.txt: test | ||
xcrun xccov view --report --only-targets WD.xcresult > cov.txt | ||
@cat cov.txt | ||
coverage: test-ios | ||
$(COV) .DerivedData-ios/Logs/Test/*.xcresult > coverage.txt | ||
@cat coverage.txt | ||
|
||
PATTERN = MotionCollector.app | ||
|
||
percentage.txt: cov.txt | ||
awk '/$(PATTERN)/ {s+=$$4;++c} END {print s/c;}' < cov.txt > percentage.txt | ||
percentage: coverage | ||
awk '/$(PATTERN)/ {s+=$$4;++c} END {print s/c;}' < coverage.txt > percentage.txt | ||
@cat percentage.txt | ||
|
||
coverage: percentage.txt | ||
@if [[ -n "$$GITHUB_ENV" ]]; then \ | ||
echo "PERCENTAGE=$$(< percentage.txt)" >> $$GITHUB_ENV; \ | ||
fi | ||
|
||
clean: | ||
@echo "-- removing cov.txt percentage.txt" | ||
@-rm -rf cov.txt percentage.txt WD WD.xcresult | ||
xcodebuild clean \ | ||
-scheme MotionCollector \ | ||
-destination platform="$(PLATFORM_IOS)" | ||
|
||
.PHONY: build test coverage clean | ||
.PHONY: build test coverage percentage clean |