-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvements to Makefile for running simulator tests
- Loading branch information
Showing
2 changed files
with
21 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
[target.aarch64-apple-ios-sim] | ||
runner = "cargo dinghy -p auto-ios-aarch64-sim runner" | ||
|
||
[target.aarch64-apple-ios] | ||
runner = "cargo dinghy -p auto-ios-aarch64 runner" | ||
|
||
[target.x86_64-apple-ios] | ||
runner = "cargo dinghy -p auto-ios-x86_64 runner" |
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,27 +1,34 @@ | ||
.PHONEY: test | ||
|
||
#RUNTIME_ID=$(shell xcrun simctl list runtimes | grep iOS | cut -d ' ' -f 7 | tail -1) | ||
DEVICE_ID?=$(shell xcrun simctl list devices 'iOS' --json | jq '.devices | with_entries( select(.key|contains("iOS"))) | .[] | [ .[].name ] | map( select(contains("iPhone")) ) | sort | .[0] ' | jq -r) | ||
BOOTED_SIM=$(shell xcrun simctl list devices --json | jq -r '.devices | to_entries | map(select( .key | contains("iOS") )) | sort_by(.key) | reverse | .[0].value | map(select( (.name|contains("${DEVICE_ID}")) and .state == "Booted" ) ) | sort_by(.name) | .[0].name') | ||
|
||
DEVICE_ID=$(shell xcrun simctl list devices 'iOS' --json | jq '.devices | with_entries( select(.key|contains("iOS"))) | .[] | [ .[].name ] | map( select(contains("iPhone")) ) | sort | .[0] ' | jq -r) | ||
|
||
TARGET=aarch64-apple-ios | ||
TARGET?=aarch64-apple-ios-sim | ||
|
||
build: | ||
cargo build --target $(TARGET) | ||
@echo TARGET: ${TARGET} | ||
cargo build --target ${TARGET} | ||
|
||
run-example: | ||
cargo run --example accelerometer | ||
|
||
build-macos: | ||
cargo build --target aarch64-apple-darwin | ||
|
||
boot-sim: | ||
@echo DEVICE ID: $(DEVICE_ID) | ||
xcrun simctl list devices | ||
xcrun simctl list devices booted | grep iPhone || xcrun simctl boot "$(DEVICE_ID)" | ||
@echo DEVICE ID: ${DEVICE_ID}, BOOTED: ${BOOTED_SIM} | ||
ifeq ($(BOOTED_SIM),null) | ||
@echo BOOTING SIM: ${DEVICE_ID} | ||
xcrun simctl boot "${DEVICE_ID}" | ||
endif | ||
|
||
test: boot-sim | ||
cargo dinghy --platform auto-ios-x86_64 test | ||
test-sim: boot-sim | ||
@echo DEVICE ID: ${DEVICE_ID} | ||
cargo dinghy --platform auto-ios-aarch64-sim --device "${DEVICE_ID}" test | ||
xcrun simctl shutdown "${DEVICE_ID}" | ||
|
||
bundle: | ||
cargo bundle --format ios --target $(TARGET) --release | ||
cargo bundle --format ios --target ${TARGET} --release | ||
|
||
.EXPORT_ALL_VARIABLES: | ||
LLVM_CONFIG_PATH=$(shell brew --prefix llvm)/bin/llvm-config |