diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5bd803a34..9f8dba124 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -302,6 +302,13 @@ jobs: args: --features ${{ env.FEATURES }} ${{ env.TESTARGS }} - name: Test in release mode + if: ${{ !matrix.dinghy }} + uses: actions-rs/cargo@v1 + with: + command: test + args: --no-default-features ${{ env.TESTARGS }} --release + + - name: Test in release mode with features if: ${{ !matrix.dinghy }} uses: actions-rs/cargo@v1 with: @@ -346,10 +353,12 @@ jobs: xcrun simctl boot $SIM_ID # Build - cargo dinghy build + cargo dinghy --device=$SIM_ID build # Run tests cargo dinghy --device=$SIM_ID test --no-default-features + cargo dinghy --device=$SIM_ID test --release + # Enable a few features. We're doing it this way because cargo dingy # doesn't support specifying features from a workspace. sed -i -e '/\[features\]/a\ diff --git a/objc2/tests/id_retain_autoreleased.rs b/objc2/tests/id_retain_autoreleased.rs index 84a259dc3..d25e4e762 100644 --- a/objc2/tests/id_retain_autoreleased.rs +++ b/objc2/tests/id_retain_autoreleased.rs @@ -55,7 +55,13 @@ fn test_retain_autoreleased() { // When compiled in release mode / with optimizations enabled, // subsequent usage of `retain_autoreleased` will succeed in retaining // the autoreleased value! - let expected = if cfg!(all(debug_assertions, not(gnustep))) { + let expected = if cfg!(gnustep) { + 1 + } else if cfg!(any( + debug_assertions, + feature = "exception", + feature = "verify_message" + )) { 2 } else { 1