Skip to content

Commit

Permalink
tests: Use esp32s2 to test xtensa
Browse files Browse the repository at this point in the history
esp32 has atomic CAS so not suitable target to test here.
  • Loading branch information
taiki-e committed Jun 1, 2024
1 parent 861ad6f commit e358b38
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -499,14 +499,14 @@ jobs:
sudo mv "opensbi-${OPENSBI_VERSION}-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin" /usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.bin
sudo mv "opensbi-${OPENSBI_VERSION}-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.elf" /usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.elf
rm -rf "opensbi-${OPENSBI_VERSION}-rv-bin"
- run: espup install --targets esp32
- run: espup install --targets esp32s2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(matrix.rust, 'nightly')
- run: tools/no-std.sh
- run: tools/build.sh +esp xtensa-esp32-none-elf
- run: tools/build.sh +esp xtensa-esp32s2-none-elf
if: startsWith(matrix.rust, 'nightly')
- run: tools/no-std.sh +esp xtensa-esp32-none-elf
- run: tools/no-std.sh +esp xtensa-esp32s2-none-elf
if: startsWith(matrix.rust, 'nightly')

miri:
Expand Down
4 changes: 2 additions & 2 deletions tests/xtensa/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[target.xtensa-esp32-none-elf]
runner = "wokwi-server --chip esp32"
[target.xtensa-esp32s2-none-elf]
runner = "wokwi-server --chip esp32s2"
12 changes: 8 additions & 4 deletions tests/xtensa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ test-helper = { path = "../helper" }

paste = "1"

[target.xtensa-esp32-none-elf.dependencies]
esp-println = { version = "0.9", default-features = false, features = ["uart", "esp32"] }
esp32-hal = "0.18"
xtensa-lx-rt = { version = "0.16", features = ["esp32"] }
[target.xtensa-esp32s2-none-elf.dependencies]
esp-println = { version = "0.9", default-features = false, features = ["uart", "esp32s2"] }
esp-hal = { version = "0.17", features = ["esp32s2"] }
xtensa-lx-rt = { version = "0.16", features = ["esp32s2"] }
spin = { version = "0.9", features = ["portable_atomic"] } # used in xtensa-lx-rt

[workspace]
resolver = "2"
Expand All @@ -33,3 +34,6 @@ opt-level = 'z'

[profile.release]
opt-level = 'z'

[patch.crates-io]
portable-atomic = { path = "../.." } # used in xtensa-lx-rt via spin
4 changes: 3 additions & 1 deletion tests/xtensa/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mod helper;

use portable_atomic::*;

use esp32_hal as _;
use esp_hal as _;
use esp_println::{print, println};

#[xtensa_lx_rt::entry]
Expand Down Expand Up @@ -82,6 +82,8 @@ fn main() -> ! {
test_atomic_float!(f32);
test_atomic_float!(f64);

println!("all tests passed");

#[allow(clippy::empty_loop)] // this test crate is #![no_std]
loop {}
}
Expand Down

0 comments on commit e358b38

Please sign in to comment.