diff options
author | 2022-08-12 00:34:12 +0000 | |
---|---|---|
committer | 2022-08-12 00:34:12 +0000 | |
commit | 0e530549de322684c50e858c6bb985afb5479dbe (patch) | |
tree | 21efc15cdadf74ac03a2e210f15eff1542f33e82 /cortex-m-rt | |
parent | e46e2310adc86a5a09a1858a23ecdde2a2c6963f (diff) | |
parent | 3a15a6b4b320fa328e8ab99c31f81536960dd280 (diff) | |
download | cortex-m-0e530549de322684c50e858c6bb985afb5479dbe.tar.gz cortex-m-0e530549de322684c50e858c6bb985afb5479dbe.tar.zst cortex-m-0e530549de322684c50e858c6bb985afb5479dbe.zip |
Merge #447
447: Add implementation for critical-section 1.0 r=adamgreig a=Dirbaio
Picking up #433 since it seems stalled. Changes from #433 are:
- Update to `critical-section 1.0.0-alpha.2`
- Use `bool` restore token
- Name Cargo feature `critical-section-single-core`.
TODO before merging:
- [x] Wait for `critical-section 1.0` release https://github.com/rust-embedded/critical-section/pull/19
Co-Authored-By: Markus Reiter `@reitermarkus`
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
Diffstat (limited to 'cortex-m-rt')
-rwxr-xr-x | cortex-m-rt/ci/script.sh | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/cortex-m-rt/ci/script.sh b/cortex-m-rt/ci/script.sh index 4683566..2941e48 100755 --- a/cortex-m-rt/ci/script.sh +++ b/cortex-m-rt/ci/script.sh @@ -7,10 +7,13 @@ main() { cargo check --target "$TARGET" --features device + # A `critical_section` implementation is always needed. + needed_features=cortex-m/critical-section-single-core + if [ "$TARGET" = x86_64-unknown-linux-gnu ] && [ "$TRAVIS_RUST_VERSION" = stable ]; then ( cd macros && cargo check && cargo test ) - cargo test --features device --test compiletest + cargo test --features "device,${needed_features}" --test compiletest fi local examples=( @@ -43,25 +46,25 @@ main() { if [ "$TARGET" != x86_64-unknown-linux-gnu ]; then # Only test on stable and nightly, not MSRV. if [ "$TRAVIS_RUST_VERSION" = stable ] || [ "$TRAVIS_RUST_VERSION" = nightly ]; then - RUSTDOCFLAGS="-Cpanic=abort" cargo test --doc + RUSTDOCFLAGS="-Cpanic=abort" cargo test --features "${needed_features}" --doc fi for linker in "${linkers[@]}"; do for ex in "${examples[@]}"; do - cargo rustc --target "$TARGET" --example "$ex" -- $linker - cargo rustc --target "$TARGET" --example "$ex" --release -- $linker + cargo rustc --target "$TARGET" --example "$ex" --features "${needed_features}" -- $linker + cargo rustc --target "$TARGET" --example "$ex" --features "${needed_features}" --release -- $linker done for ex in "${fail_examples[@]}"; do - ! cargo rustc --target "$TARGET" --example "$ex" -- $linker - ! cargo rustc --target "$TARGET" --example "$ex" --release -- $linker + ! cargo rustc --target "$TARGET" --example "$ex" --features "${needed_features}" -- $linker + ! cargo rustc --target "$TARGET" --example "$ex" --features "${needed_features}" --release -- $linker done - cargo rustc --target "$TARGET" --example device --features device -- $linker - cargo rustc --target "$TARGET" --example device --features device --release -- $linker + cargo rustc --target "$TARGET" --example device --features "device,${needed_features}" -- $linker + cargo rustc --target "$TARGET" --example device --features "device,${needed_features}" --release -- $linker - cargo rustc --target "$TARGET" --example minimal --features set-sp -- $linker - cargo rustc --target "$TARGET" --example minimal --features set-sp --release -- $linker - cargo rustc --target "$TARGET" --example minimal --features set-vtor -- $linker - cargo rustc --target "$TARGET" --example minimal --features set-vtor --release -- $linker + cargo rustc --target "$TARGET" --example minimal --features "set-sp,${needed_features}" -- $linker + cargo rustc --target "$TARGET" --example minimal --features "set-sp,${needed_features}" --release -- $linker + cargo rustc --target "$TARGET" --example minimal --features "set-vtor,${needed_features}" -- $linker + cargo rustc --target "$TARGET" --example minimal --features "set-vtor,${needed_features}" --release -- $linker done fi @@ -69,9 +72,9 @@ main() { thumbv6m-none-eabi|thumbv7m-none-eabi) for linker in "${linkers[@]}"; do env RUSTFLAGS="$linker -C link-arg=-Tlink.x" cargo run \ - --target "$TARGET" --example qemu | grep "x = 42" + --target "$TARGET" --features "${needed_features}" --example qemu | grep "x = 42" env RUSTFLAGS="$linker -C link-arg=-Tlink.x" cargo run \ - --target "$TARGET" --example qemu --release | grep "x = 42" + --target "$TARGET" --features "${needed_features}" --example qemu --release | grep "x = 42" done ;; |