|
1 | 1 | #!/bin/bash
|
2 | 2 | # A test script I use to test on my local devices
|
3 | 3 |
|
| 4 | +set -euxo pipefail |
| 5 | + |
| 6 | +export CARGO_TARGET_DIR=$HOME/Desktop/objc2-target |
4 | 7 | export MACOSX_DEPLOYMENT_TARGET=10.12
|
5 |
| -export IPHONEOS_DEPLOYMENT_TARGET=10.0 |
6 |
| -export FEATURES=std,block,exception,catch-all,unstable-static-class,unstable-static-sel |
| 8 | +export CRATES='--package=block2 --package=objc-sys --package=objc2 --package=objc2-encode --package=objc2-proc-macros --package=tests' |
| 9 | +export FRAMEWORKS_MACOS_10_13='--package=objc2-app-kit --package=objc2-automator --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-core-data --package=objc2-core-wlan --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-external-accessory --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-input-method-kit --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-osa-kit --package=objc2-quartz-core --package=objc2-service-management --package=objc2-store-kit --package=objc2-web-kit' |
| 10 | +export FRAMEWORKS_IOS_9='--package=objc2-foundation --package=objc2-metal' |
| 11 | + |
| 12 | +# Test on macOS 32bit |
| 13 | +export SDKROOT=$HOME/Desktop/MacOSX10.13.sdk |
| 14 | +cargo test $CRATES |
| 15 | +cargo test $CRATES --features=unstable-static-class,unstable-static-sel |
| 16 | +cargo test $CRATES $FRAMEWORKS_MACOS_10_13 --features=block2,exception,catch-all,all |
| 17 | +cargo test $CRATES --release |
| 18 | +cargo test -Zbuild-std --target=i686-apple-darwin $CRATES |
| 19 | +cargo test -Zbuild-std --target=i686-apple-darwin $CRATES $FRAMEWORKS_MACOS_10_13 --features=block2,exception,catch-all,all |
| 20 | +cargo test -Zbuild-std --target=i686-apple-darwin $CRATES --release |
| 21 | +unset SDKROOT |
7 | 22 |
|
8 | 23 | # Start the simulator
|
9 | 24 | open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
|
10 | 25 |
|
11 | 26 | # Test on the simulator
|
12 |
| -cargo dinghy --device sim test |
13 |
| -cargo dinghy --device sim test --features=$FEATURES |
14 |
| -cargo dinghy --device sim test --release |
| 27 | +IPHONEOS_DEPLOYMENT_TARGET=10.0 cargo dinghy --device sim test $CRATES |
| 28 | +IPHONEOS_DEPLOYMENT_TARGET=10.0 cargo dinghy --device sim test $CRATES --features=unstable-static-class,unstable-static-sel |
| 29 | +IPHONEOS_DEPLOYMENT_TARGET=10.0 cargo dinghy --device sim test $CRATES $FRAMEWORKS_IOS_9 --features=block2,exception,catch-all,all |
| 30 | +IPHONEOS_DEPLOYMENT_TARGET=10.0 cargo dinghy --device sim test $CRATES --release |
15 | 31 |
|
16 | 32 | # Test on my iPad mini 1st generation iOS 9.3
|
17 | 33 | # Followed this guide to set it up:
|
18 | 34 | # https://github.com/sonos/dinghy/blob/main/docs/ios.md
|
19 | 35 | #
|
20 | 36 | # We use build-std and earlier nightly because the target is armv7-apple-ios, which was removed in:
|
21 | 37 | # https://github.com/rust-lang/rust/pull/104385
|
22 |
| -IPHONEOS_DEPLOYMENT_TARGET=9.0 cargo +nightly-2023-09-23 dinghy --device ipad test -Zbuild-std |
23 |
| -IPHONEOS_DEPLOYMENT_TARGET=9.0 cargo +nightly-2023-09-23 dinghy --device ipad test -Zbuild-std --features=$FEATURES |
24 |
| -IPHONEOS_DEPLOYMENT_TARGET=9.0 cargo +nightly-2023-09-23 dinghy --device ipad test -Zbuild-std --release |
25 |
| - |
26 |
| -# Test on macOS 32bit |
27 |
| -export SDKROOT=(pwd)/ideas/MacOSX10.13.sdk |
28 |
| -export CARGO_BUILD_TARGET=i686-apple-darwin |
29 |
| -cargo +nightly test -Zbuild-std |
30 |
| -cargo +nightly test -Zbuild-std --features=$FEATURES |
31 |
| -cargo +nightly test -Zbuild-std --release |
| 38 | +# |
| 39 | +# Requires: `cargo install cargo-dinghy@0.6.8` |
| 40 | +export DINGHY_LOG=trace |
| 41 | +IPHONEOS_DEPLOYMENT_TARGET=9.0 cargo +nightly-2023-09-23 dinghy --device ipad test -Zbuild-std $CRATES |
| 42 | +IPHONEOS_DEPLOYMENT_TARGET=9.0 cargo +nightly-2023-09-23 dinghy --device ipad test -Zbuild-std $CRATES --features=unstable-static-class,unstable-static-sel |
| 43 | +IPHONEOS_DEPLOYMENT_TARGET=9.0 cargo +nightly-2023-09-23 dinghy --device ipad test -Zbuild-std $CRATES $FRAMEWORKS_IOS_9 --features=block2,exception,catch-all,all |
| 44 | +IPHONEOS_DEPLOYMENT_TARGET=9.0 cargo +nightly-2023-09-23 dinghy --device ipad test -Zbuild-std $CRATES --release |
0 commit comments