mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 08:11:33 +11:00
Add a test that multiboot works
This commit is contained in:
parent
aa33a46919
commit
5feb67285d
23
agb/tests/test_multiboot.rs
Normal file
23
agb/tests/test_multiboot.rs
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
#![no_std]
|
||||||
|
#![no_main]
|
||||||
|
#![feature(custom_test_frameworks)]
|
||||||
|
#![reexport_test_harness_main = "test_main"]
|
||||||
|
#![test_runner(agb::test_runner::test_runner)]
|
||||||
|
|
||||||
|
fn hello() {}
|
||||||
|
|
||||||
|
#[test_case]
|
||||||
|
fn multiboot_test(_gba: &mut agb::Gba) {
|
||||||
|
if option_env!("AGB_MULTIBOOT").is_some() {
|
||||||
|
let address = hello as usize;
|
||||||
|
assert!(
|
||||||
|
(0x0200_0000..0x0204_0000).contains(&address),
|
||||||
|
"multiboot functions should all be in ewram 0x0300_0000 and 0x0300_8000, but was actually found to be at {address:#010X}"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[agb::entry]
|
||||||
|
fn entry(_gba: agb::Gba) -> ! {
|
||||||
|
loop {}
|
||||||
|
}
|
3
justfile
3
justfile
|
@ -15,6 +15,7 @@ clippy:
|
||||||
|
|
||||||
test:
|
test:
|
||||||
just _test-debug agb
|
just _test-debug agb
|
||||||
|
just _test-multiboot
|
||||||
just _test-debug agb-fixnum
|
just _test-debug agb-fixnum
|
||||||
just _test-debug agb-hashmap
|
just _test-debug agb-hashmap
|
||||||
just _test-debug tracker/agb-tracker
|
just _test-debug tracker/agb-tracker
|
||||||
|
@ -152,6 +153,8 @@ _test-debug crate:
|
||||||
(cd "{{crate}}" && cargo test)
|
(cd "{{crate}}" && cargo test)
|
||||||
_test-debug-arm crate:
|
_test-debug-arm crate:
|
||||||
(cd "{{crate}}" && cargo test --target=armv4t-none-eabi)
|
(cd "{{crate}}" && cargo test --target=armv4t-none-eabi)
|
||||||
|
_test-multiboot:
|
||||||
|
(cd "agb" && AGB_MULTIBOOT=true RUSTFLAGS="-Clink-arg=-Tgba_mb.ld -Ctarget-cpu=arm7tdmi" cargo test --test=test_multiboot)
|
||||||
_clippy crate:
|
_clippy crate:
|
||||||
(cd "{{crate}}" && cargo clippy --examples --tests -- {{CLIPPY_ARGUMENTS}})
|
(cd "{{crate}}" && cargo clippy --examples --tests -- {{CLIPPY_ARGUMENTS}})
|
||||||
_clean crate:
|
_clean crate:
|
||||||
|
|
Loading…
Reference in a new issue