[test_runner] Add test_runner program
This change introduces test_runner, which runs unit or integration tests
and then tells the kernel to exit QEMU with a status code indicating the
number of failed tests.
The test_runner program is not loaded by default. Use the test manifest
to enable it:
./configure --manifest=assets/manifests/test.yml
A number of tests from the old src/tests have moved over. More to come,
as well as moving code from testapp before getting rid of it.
The test.sh script has been repurposed to be a "headless" version of
qemu.sh for running tests, and it exits with the appropriate exit code.
(Though ./qemu.sh gained the ability to exit with the correct exit code
as well.) Exit codes from kernel panics have been updated so that the
bash scripts should exit with code 127.
This commit is contained in:
@@ -63,8 +63,8 @@ void panic_handler(const cpu_state *regs)
|
||||
if (__atomic_sub_fetch(&remaining, 1, order) == 0) {
|
||||
// No remaining CPUs, if we're running on QEMU,
|
||||
// tell it to exit
|
||||
constexpr uint32_t exit_code = 0;
|
||||
asm ( "out %0, %1" :: "a"(exit_code), "Nd"(0xf4) );
|
||||
constexpr uint32_t exit_code = 255;
|
||||
asm ( "outl %%eax, %%dx" :: "a"(exit_code), "d"(0xf4) );
|
||||
}
|
||||
|
||||
while (1) asm ("hlt");
|
||||
|
||||
Reference in New Issue
Block a user