]> xenbits.xensource.com Git - people/royger/xen-test-framework.git/commitdiff
XTF Selftests
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 8 Dec 2015 12:37:04 +0000 (12:37 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 18 Dec 2015 18:31:11 +0000 (18:31 +0000)
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 <andrew.cooper3@citrix.com>
tests/selftest/Makefile [new file with mode: 0644]
tests/selftest/main.c [new file with mode: 0644]

diff --git a/tests/selftest/Makefile b/tests/selftest/Makefile
new file mode 100644 (file)
index 0000000..258795c
--- /dev/null
@@ -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 (file)
index 0000000..d8f5a96
--- /dev/null
@@ -0,0 +1,34 @@
+#include <xtf/test.h>
+#include <xtf/report.h>
+#include <xtf/console.h>
+
+#include <xtf/traps.h>
+
+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:
+ */