Skip to content

Commit

Permalink
tests: Test m68k using QEMU
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jan 5, 2025
1 parent 3f757be commit 0e136c1
Show file tree
Hide file tree
Showing 10 changed files with 676 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/.cspell/project-dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ sltui
sreg
srlv
stbar
stdarch
stdcx
stilp
stlxp
Expand Down
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ updates:
- /
# crates with [workspace] table are not recognized by the above 'directory: /'
- /tests/avr
# - /tests/m68k # This has a path dependency on a crate that does not exist at checkout that is initialized by the script.
- /tests/msp430
- /tests/no-std-qemu
- /tests/xtensa
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ jobs:
- stable
- nightly-2023-08-24 # Rust 1.74, LLVM 17 (oldest version that MaybeUninit register is supported)
- nightly
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: taiki-e/checkout-action@v1
Expand Down Expand Up @@ -435,6 +435,8 @@ jobs:
apt_packages+=(
avr-libc
gcc-avr
gcc-m68k-linux-gnu
libc6-dev-m68k-cross
qemu-system-sparc
simavr
)
Expand Down Expand Up @@ -470,6 +472,13 @@ jobs:
| tar xzf - --strip-components 1 -C "${HOME}"/tsim
printf '%s\n' "${HOME}"/tsim/tsim/linux-x64 >>"${GITHUB_PATH}"
fi
# https://github.com/taiki-e/dockerfiles/pkgs/container/qemu-user
retry docker create --name qemu-user ghcr.io/taiki-e/qemu-user
mkdir -p -- qemu-user
docker cp -- qemu-user:/usr/bin qemu-user/bin
docker rm -f -- qemu-user >/dev/null
sudo mv -- qemu-user/bin/qemu-* /usr/bin/
rm -rf -- ./qemu-user
elif [[ "${{ matrix.rust }}" == "stable" ]]; then
retry espup install --targets esp32,esp32s2,esp32s3
fi
Expand Down
3 changes: 3 additions & 0 deletions tests/m68k/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[target.m68k-unknown-linux-gnu]
linker = "m68k-linux-gnu-gcc"
runner = "qemu-m68k -L /usr/m68k-linux-gnu"
1 change: 1 addition & 0 deletions tests/m68k/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rust-src
46 changes: 46 additions & 0 deletions tests/m68k/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[package]
name = "no-core"
version = "0.0.0"
edition = "2021"
publish = false

[features]
default = ["isize", "usize", "i8", "u8"]
# NB: Sync feature list with tools/no-std.sh
isize = []
usize = []
i8 = []
u8 = []
i16 = []
u16 = []
i32 = []
u32 = []
i64 = []
u64 = []

[dependencies]
# atomic-maybe-uninit = { path = "../.." }

core = { path = "rust-src/core" }
paste = "1"

[workspace]
resolver = "2"

[lints.rust]
rust_2018_idioms = "warn"
single_use_lifetimes = "warn"
# unsafe_op_in_unsafe_fn = "warn" # Set at crate-level instead since https://github.com/rust-lang/rust/pull/100081 is not available on MSRV

[profile.dev]
codegen-units = 1
lto = true
opt-level = "s"
panic = "abort"

[profile.release]
codegen-units = 1
lto = true
# TODO: panic in cas test with -C opt-level=3
opt-level = "s"
panic = "abort"
1 change: 1 addition & 0 deletions tests/m68k/build.rs
Loading

0 comments on commit 0e136c1

Please sign in to comment.