Skip to content

Commit

Permalink
Fix running id_retain_autoreleased in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Mar 2, 2022
1 parent de0071e commit 908f914
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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\
Expand Down
8 changes: 7 additions & 1 deletion objc2/tests/id_retain_autoreleased.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 908f914

Please sign in to comment.