Skip to content

Commit d0f9932

Browse files
committed
Run assembly tests in CI
1 parent e10bf9b commit d0f9932

File tree

2 files changed

+38
-28
lines changed

2 files changed

+38
-28
lines changed

.github/workflows/ci.yml

+36-28
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ env:
99
CARGO_TERM_COLOR: always
1010
RUST_BACKTRACE: 1
1111
# Faster compilation and error on warnings
12-
RUSTFLAGS: "-C debuginfo=0 -D warnings"
12+
RUSTFLAGS: "-C debuginfo=0" # TMP
1313
RUSTDOCFLAGS: "-D warnings"
1414
CARGO_TERM_VERBOSE: true
1515
FEATURES: malloc,block,exception,catch_all,verify_message
@@ -45,7 +45,7 @@ jobs:
4545
- name: Test macOS 11 w. ui tests
4646
os: macos-11
4747
target: x86_64-apple-darwin
48-
args: --features tests/ui
48+
test-args: --features tests/ui
4949
- name: Build macOS AArch64
5050
os: macos-11
5151
target: aarch64-apple-darwin
@@ -60,7 +60,7 @@ jobs:
6060
target: x86_64-apple-darwin
6161
rust:
6262
toolchain: nightly
63-
args: --features tests/ui
63+
test-args: --features tests/ui
6464
- name: Build macOS 32bit
6565
os: macos-10.15
6666
target: i686-apple-darwin
@@ -77,14 +77,15 @@ jobs:
7777
- name: Test GNUStep
7878
os: ubuntu-latest
7979
target: x86_64-unknown-linux-gnu
80-
features: gnustep-1-9
81-
args: --features gnustep-1-9
80+
host-args: --features block-sys/gnustep-1-9,objc-sys/gnustep-1-9
81+
args: --features block-sys/gnustep-1-9,objc-sys/gnustep-1-9
8282
- name: Test GNUStep 32bit
8383
os: ubuntu-latest
8484
target: i686-unknown-linux-gnu
8585
cflags: -m32
8686
configureflags: --target=x86-pc-linux-gnu
87-
args: --features gnustep-1-9
87+
host-args: --features block-sys/gnustep-1-9,objc-sys/gnustep-1-9
88+
args: --features block-sys/gnustep-1-9,objc-sys/gnustep-1-9
8889
- name: Test iOS simulator x86 64bit
8990
os: macos-11
9091
target: x86_64-apple-ios
@@ -270,28 +271,6 @@ jobs:
270271
if: matrix.dinghy && steps.extern-cache.outputs.cache-hit != 'true'
271272
run: cargo install cargo-dinghy --version=^0.4 --root=$HOME/extern --target=x86_64-apple-darwin
272273

273-
- name: Run Cargo Dinghy
274-
if: matrix.dinghy
275-
run: |
276-
# Launch the simulator
277-
xcrun simctl list runtimes
278-
RUNTIME_ID=$(xcrun simctl list runtimes | grep iOS | cut -d ' ' -f 7 | tail -1)
279-
export SIM_ID=$(xcrun simctl create My-iphone7 com.apple.CoreSimulator.SimDeviceType.iPhone-7 $RUNTIME_ID)
280-
xcrun simctl boot $SIM_ID
281-
282-
# Build
283-
cargo dinghy build
284-
285-
# Run tests
286-
cargo dinghy --device=$SIM_ID test --no-default-features
287-
# Enable a few features. We're doing it this way because cargo dingy
288-
# doesn't support specifying features from a workspace.
289-
sed -i -e '/\[features\]/a\
290-
default = ["exception", "verify_message", "catch_all"]
291-
' objc2/Cargo.toml
292-
cargo dinghy --device=$SIM_ID test
293-
cargo dinghy --device=$SIM_ID test --release
294-
295274
- name: Build
296275
if: ${{ !matrix.dinghy }}
297276
uses: actions-rs/cargo@v1
@@ -343,3 +322,32 @@ jobs:
343322
command: test
344323
# Not using --all-features because that would enable e.g. gnustep
345324
args: --features ${{ env.FEATURES }},${{ env.UNSTABLE_FEATURES }} ${{ env.TESTARGS }}
325+
326+
- name: Run assembly tests
327+
shell: bash
328+
run:
329+
export HOST_TARGET=$(rustc -vV | grep host | cut -f2 -d' ')
330+
331+
cargo run ${{ matrix.host-args }} --features assembly --target=$HOST_TARGET test_assembly ${{ matrix.args }}
332+
333+
- name: Run Cargo Dinghy
334+
if: matrix.dinghy
335+
run: |
336+
# Launch the simulator
337+
xcrun simctl list runtimes
338+
RUNTIME_ID=$(xcrun simctl list runtimes | grep iOS | cut -d ' ' -f 7 | tail -1)
339+
export SIM_ID=$(xcrun simctl create My-iphone7 com.apple.CoreSimulator.SimDeviceType.iPhone-7 $RUNTIME_ID)
340+
xcrun simctl boot $SIM_ID
341+
342+
# Build
343+
cargo dinghy build
344+
345+
# Run tests
346+
cargo dinghy --device=$SIM_ID test --no-default-features
347+
# Enable a few features. We're doing it this way because cargo dingy
348+
# doesn't support specifying features from a workspace.
349+
sed -i -e '/\[features\]/a\
350+
default = ["exception", "verify_message", "catch_all"]
351+
' objc2/Cargo.toml
352+
cargo dinghy --device=$SIM_ID test
353+
cargo dinghy --device=$SIM_ID test --release

tests/assembly/test_msg_send_zero_cost/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ path = "lib.rs"
99

1010
[dependencies]
1111
objc2 = { path = "../../../objc2" }
12+
objc-sys = { path = "../../../objc-sys" }
13+
block-sys = { path = "../../../block-sys" }

0 commit comments

Comments
 (0)