Skip to content

Commit

Permalink
Make tests compile on stable
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed May 10, 2024
1 parent 6b35e34 commit c375275
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ jobs:

- name: Test Foundation with unstable features
if: ${{ matrix.nightly }}
run: cargo test $ARGS $PUBLIC_CRATES -ptests $INTERESTING_FEATURES -pobjc2-foundation --features=catch-all $UNSTABLE_FEATURES
run: cargo test $ARGS $PUBLIC_CRATES -ptests $INTERESTING_FEATURES -pobjc2-foundation --features=catch-all $UNSTABLE_FEATURES ${{ matrix.sdk != '10.12' && '--features=unstable-simd' || '' }}

# TODO: Re-enable this on all of Foundation once we do some form of
# availability checking.
Expand Down
2 changes: 2 additions & 0 deletions crates/tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ all = [
"objc2-foundation/NSObjCRuntime",
]

unstable-simd = []

apple = ["block2/apple", "objc2/apple", "objc2-foundation/apple"]
gnustep-1-7 = ["block2/gnustep-1-7", "objc2/gnustep-1-7", "objc2-foundation/gnustep-1-7"]
gnustep-1-8 = ["gnustep-1-7", "block2/gnustep-1-8", "objc2/gnustep-1-8", "objc2-foundation/gnustep-1-8"]
Expand Down
1 change: 1 addition & 0 deletions crates/tests/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ fn main() {
builder.compiler("clang");
builder.file("extern/encode_utils.m");
builder.file("extern/test_object.m");
#[cfg(feature = "unstable-simd")]
builder.file("extern/test_simd_return.m");
println!("cargo:rerun-if-changed=extern/encode_utils.m");
println!("cargo:rerun-if-changed=extern/test_object.m");
Expand Down
4 changes: 2 additions & 2 deletions crates/tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! This is used so that we don't need to add a `build.rs` script to `block2`.
#![no_std]
#![cfg_attr(feature = "apple", feature(repr_simd))]
#![cfg_attr(all(feature = "apple", feature = "unstable-simd"), feature(repr_simd))]

use std::os::raw::c_void;

Expand All @@ -23,7 +23,7 @@ mod test_foundation_retain_semantics;
#[cfg(test)]
mod test_object;
#[cfg(test)]
#[cfg(feature = "apple")]
#[cfg(all(feature = "apple", feature = "unstable-simd"))]
mod test_simd_return;

#[no_mangle]
Expand Down

0 comments on commit c375275

Please sign in to comment.