From: Andrew Cooper Date: Tue, 8 Dec 2015 12:37:04 +0000 (+0000) Subject: XTF Selftests X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d1e092ff9a4cc279e960bc9dced3048ec8af9ab9;p=people%2Froyger%2Fxen-test-framework.git XTF Selftests Provide a sanity test of the environment and infrastructure provided by the test framework itself. These are all expected to pass. Signed-off-by: Andrew Cooper --- diff --git a/tests/selftest/Makefile b/tests/selftest/Makefile new file mode 100644 index 0000000..258795c --- /dev/null +++ b/tests/selftest/Makefile @@ -0,0 +1,10 @@ +ROOT := $(abspath $(CURDIR)/../..) + +include $(ROOT)/build/common.mk + +NAME := selftest +TEST-ENVS := $(ALL_ENVIRONMENTS) + +obj-perenv += main.o + +include $(ROOT)/build/gen.mk diff --git a/tests/selftest/main.c b/tests/selftest/main.c new file mode 100644 index 0000000..d8f5a96 --- /dev/null +++ b/tests/selftest/main.c @@ -0,0 +1,34 @@ +#include +#include +#include + +#include + +static void test_int3_breakpoint(void) +{ + printk("Test: int3 breakpoint\n"); + + /* + * Check that a breakpoint returns normally from the trap handler. + */ + asm volatile ("int3"); +} + +void test_main(void) +{ + printk("XTF Selftests\n"); + + test_int3_breakpoint(); + + xtf_success(); +} + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */