Skip to content

Commit 86c7b8c

Browse files
committed
tests work
1 parent a56ef14 commit 86c7b8c

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

Makefile

+3-4
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ ovmf:
5353

5454
kernel_build:
5555
@cargo build $(CARGO_ARGS)
56-
56+
5757
kernel_test:
58-
@cargo test $(CARGO_ARGS)
58+
@cargo rustc $(CARGO_ARGS) -- --test
5959

6060
$(ISO): gen_build_dirs limine ovmf
6161
@cp target/x86_64-unknown-none/$(PROFILE)/monoos $(KERNEL_BIN)
@@ -70,8 +70,7 @@ run: kernel_build iso
7070
@qemu-system-x86_64 $(QEMU_ARGS)
7171

7272
test: kernel_test iso
73-
override QEMU_ARGS += -display none
74-
@qemu-system-x86_64 $(QEMU_ARGS)
73+
@qemu-system-x86_64 $(QEMU_ARGS) -display none
7574

7675
miri:
7776
@MIRI_NO_STD=1 cargo miri run --target x86_64-unknown-none

src/tests.rs

+6-13
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ pub struct Test {
55
}
66

77
pub fn test_runner(tests: &[&Test]) {
8-
log::info!("running {} tests", tests.len());
8+
log::info!("running {} test(s)", tests.len());
99

10-
let mut successful = 0;
10+
let mut passed = 0;
1111
let mut suppressed = 0;
1212

1313
for test in tests {
@@ -18,20 +18,13 @@ pub fn test_runner(tests: &[&Test]) {
1818
} else {
1919
suppressed += 1;
2020
}
21+
22+
passed += 1;
2123
}
2224

23-
log::info!("");
2425
log::info!(
25-
"tests completed. {} successful; {} suppressed",
26-
successful,
26+
"tests completed: {} passed; {} suppressed",
27+
passed,
2728
suppressed
2829
);
2930
}
30-
31-
#[cfg(test)]
32-
mod tests {
33-
#[mono_proc::test]
34-
fn testtest() {
35-
assert!(true);
36-
}
37-
}

0 commit comments

Comments
 (0)