/riscv-hs-tests

RISC-V HS-mode hypervisor extension tests

Primary LanguageC

riscv-hs-tests

WIP

riscv-hs-tests is a HS-mode test suite.

Writing tests

Write a test like src/test_example.c:

#include "test_helpers.h"

void test_example(void)
{
	LOG("This is a test");
	ASSERT(1, "This check will pass");
	ASSERT(0, "This check will fail");
}

Add it to src/all_tests.c:

void test_example(void);
test_case all_test_cases[] = { ..., test_example };

Add it to Makefile

objects += ... test_example.o

Build and run

$ make
$ qemu-system-riscv64 -M virt -kernel build/riscv-hs-tests.elf

If you want to run riscv-hs-tests with GDB debugging, use the provided .gdbinit file:

$ qemu-system-riscv64 -M virt -kernel build/riscv-hs-tests.elf -s -S
$ gdb

More details in the wiki.

Thanks