@@ -1,7 +1,7 @@
include config.mak
-DESTDIR :=
+DESTDIR := $(PREFIX)/share/qemu/tests
.PHONY: arch_clean clean
@@ -56,5 +56,9 @@ $(libcflat): $(cflatobjs)
-include .*.d
+install:
+ mkdir -p $(DESTDIR)
+ install $(tests_and_config) $(DESTDIR)
+
clean: arch_clean
$(RM) kvmctl kvmtrace *.o *.a .*.d $(libcflat) $(cflatobjs)
@@ -27,6 +27,8 @@ tests-common = $(TEST_DIR)/vmexit.flat $(TEST_DIR)/tsc.flat \
$(TEST_DIR)/realmode.flat $(TEST_DIR)/msr.flat \
$(TEST_DIR)/hypercall.flat $(TEST_DIR)/sieve.flat
+tests_and_config = $(tests-common) $(TEST_DIR)/unittests.cfg
+
test_cases: $(tests-common) $(tests)
$(TEST_DIR)/%.o: CFLAGS += -std=gnu99 -ffreestanding -I lib -I lib/x86
new file mode 100644
@@ -0,0 +1,52 @@
+# Define your new unittest following the convention:
+# [unittest_name]
+# file = foo.flat # Name of the flat file to be used
+# smp = 2 # Number of processors the VM will use during this test
+# extra_params = -cpu qemu64,+x2apic # Additional parameters used
+
+[apic]
+file = apic.flat
+smp = 2
+extra_params: -cpu qemu64,+x2apic
+
+[smptest]
+file = smptest.flat
+smp = 2
+
+[smptest3]
+file = smptest.flat
+smp = 3
+
+[vmexit]
+file = vmexit.flat
+smp = 2
+
+[access]
+file = access.flat
+
+[emulator]
+file = emulator.flat
+
+[hypercall]
+file = hypercall.flat
+
+[idt_test]
+file = idt_test.flat
+
+[msr]
+file = msr.flat
+
+[port80]
+file = port80.flat
+
+[realmode]
+file = realmode.flat
+
+[sieve]
+file = sieve.flat
+
+[tsc]
+file = tsc.flat
+
+[xsave]
+file = xsave.flat