]> git.proxmox.com Git - qemu.git/blame - tests/Makefile
acpi_piix4: Disallow write to up/down PCI hotplug registers
[qemu.git] / tests / Makefile
CommitLineData
8959449b
KW
1export SRC_PATH
2
b93b63f5
PB
3check-unit-y = tests/check-qdict$(EXESUF)
4check-unit-y += tests/check-qfloat$(EXESUF)
5check-unit-y += tests/check-qint$(EXESUF)
6check-unit-y += tests/check-qstring$(EXESUF)
7check-unit-y += tests/check-qlist$(EXESUF)
8check-unit-y += tests/check-qjson$(EXESUF)
9check-unit-y += tests/test-qmp-output-visitor$(EXESUF)
10check-unit-y += tests/test-qmp-input-visitor$(EXESUF)
11check-unit-y += tests/test-qmp-input-strict$(EXESUF)
12check-unit-y += tests/test-qmp-commands$(EXESUF)
13check-unit-y += tests/test-string-input-visitor$(EXESUF)
14check-unit-y += tests/test-string-output-visitor$(EXESUF)
15check-unit-y += tests/test-coroutine$(EXESUF)
16
17check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
18
d1aaf543
AL
19# All QTests for now are POSIX-only, but the dependencies are
20# really in libqtest, not in the testcases themselves.
21check-qtest-i386-y = tests/rtc-test
22check-qtest-x86_64-y = $(check-qtest-i386-y)
23
b93b63f5
PB
24GENERATED_HEADERS += tests/test-qapi-types.h tests/test-qapi-visit.h tests/test-qmp-commands.h
25
26test-obj-y = tests/check-qint.o tests/check-qstring.o tests/check-qdict.o \
27 tests/check-qlist.o tests/check-qfloat.o tests/check-qjson.o \
28 tests/test-coroutine.o tests/test-string-output-visitor.o \
29 tests/test-string-input-visitor.o tests/test-qmp-output-visitor.o \
30 tests/test-qmp-input-visitor.o tests/test-qmp-input-strict.o \
31 tests/test-qmp-commands.o
32
33test-qapi-obj-y = $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y)
34test-qapi-obj-y += tests/test-qapi-visit.o tests/test-qapi-types.o
35test-qapi-obj-y += module.o
36
37$(test-obj-y): $(GENERATED_HEADERS)
38$(test-obj-y): QEMU_INCLUDES += -Itests
39
40tests/check-qint$(EXESUF): tests/check-qint.o qint.o $(tools-obj-y)
41tests/check-qstring$(EXESUF): tests/check-qstring.o qstring.o $(tools-obj-y)
42tests/check-qdict$(EXESUF): tests/check-qdict.o qdict.o qfloat.o qint.o qstring.o qbool.o qlist.o $(tools-obj-y)
43tests/check-qlist$(EXESUF): tests/check-qlist.o qlist.o qint.o $(tools-obj-y)
44tests/check-qfloat$(EXESUF): tests/check-qfloat.o qfloat.o $(tools-obj-y)
45tests/check-qjson$(EXESUF): tests/check-qjson.o $(qobject-obj-y) $(tools-obj-y)
46tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(coroutine-obj-y) $(tools-obj-y)
47
48tests/test-qapi-types.c tests/test-qapi-types.h :\
dbfe06c6 49$(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py
b93b63f5
PB
50 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o tests -p "test-" < $<, " GEN $@")
51tests/test-qapi-visit.c tests/test-qapi-visit.h :\
dbfe06c6 52$(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-visit.py
b93b63f5
PB
53 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o tests -p "test-" < $<, " GEN $@")
54tests/test-qmp-commands.h tests/test-qmp-marshal.c :\
dbfe06c6 55$(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py
b93b63f5 56 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o tests -p "test-" < $<, " GEN $@")
dbfe06c6
AL
57
58
b93b63f5
PB
59tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y)
60tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y)
61tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y)
62tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y)
63tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y)
64tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y)
2d7799f2 65
d2a16f74
BS
66tests/rtc-test$(EXESUF): tests/rtc-test.o $(trace-obj-y)
67
49ee3590
AL
68# QTest rules
69
70TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS)))
71QTEST_TARGETS=$(foreach TARGET,$(TARGETS), $(if $(check-qtest-$(TARGET)-y), $(TARGET),))
72check-qtest-$(CONFIG_POSIX)=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y))
73
74qtest-obj-y = tests/libqtest.o $(oslib-obj-y)
75$(check-qtest-y): $(qtest-obj-y)
76
b93b63f5
PB
77.PHONY: check-help
78check-help:
79 @echo "Regression testing targets:"
80 @echo
81 @echo " make check Run all tests"
49ee3590
AL
82 @echo " make check-qtest-TARGET Run qtest tests for given target"
83 @echo " make check-qtest Run qtest tests"
b93b63f5
PB
84 @echo " make check-unit Run qobject tests"
85 @echo " make check-block Run block tests"
86 @echo " make check-report.html Generates an HTML test report"
87 @echo
88 @echo "Please note that HTML reports do not regenerate if the unit tests"
89 @echo "has not changed."
90 @echo
91 @echo "The variable SPEED can be set to control the gtester speed setting."
92 @echo "Default options are -k and (for make V=1) --verbose; they can be"
93 @echo "changed with variable GTESTER_OPTIONS."
2d7799f2 94
b93b63f5 95.SECONDARY:
e38ac962 96
b93b63f5
PB
97SPEED = quick
98GTESTER_OPTIONS = -k $(if $(V),--verbose,-q)
dbfe06c6 99
b93b63f5 100# gtester tests, possibly with verbose output
dbfe06c6 101
49ee3590
AL
102.PHONY: $(patsubst %, check-qtest-%, $(QTEST_TARGETS))
103$(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: $(check-qtest-y)
104 $(call quiet-command,QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
105 gtester $(GTESTER_OPTIONS) -m=$(SPEED) $(check-qtest-$*-y),"GTESTER $@")
106
b93b63f5
PB
107.PHONY: $(patsubst %, check-%, $(check-unit-y))
108$(patsubst %, check-%, $(check-unit-y)): check-%: %
109 $(call quiet-command,gtester $(GTESTER_OPTIONS) -m=$(SPEED) $*,"GTESTER $*")
dbfe06c6 110
b93b63f5 111# gtester tests with XML output
8959449b 112
49ee3590
AL
113$(patsubst %, check-report-qtest-%.xml, $(QTEST_TARGETS)): check-report-qtest-%.xml: $(check-qtest-y)
114 $(call quiet-command,QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
115 gtester -q $(GTESTER_OPTIONS) -o $@ -m=$(SPEED) $(check-qtest-$*-y),"GTESTER $@")
116
b93b63f5
PB
117check-report-unit.xml: $(check-unit-y)
118 $(call quiet-command,gtester -q $(GTESTER_OPTIONS) -o $@ -m=$(SPEED) $^, "GTESTER $@")
b8c6f29e 119
b93b63f5 120# Reports and overall runs
b8c6f29e 121
49ee3590 122check-report.xml: $(patsubst %,check-report-qtest-%.xml, $(QTEST_TARGETS)) check-report-unit.xml
b93b63f5 123 $(call quiet-command,$(SRC_PATH)/scripts/gtester-cat $^ > $@, " GEN $@")
b8c6f29e 124
b93b63f5
PB
125check-report.html: check-report.xml
126 $(call quiet-command,gtester-report $< > $@, " GEN $@")
127
128
129# Other tests
130
131.PHONY: check-tests/qemu-iotests-quick.sh
132check-tests/qemu-iotests-quick.sh: tests/qemu-iotests-quick.sh qemu-img$(EXESUF) qemu-io$(EXESUF)
133 $<
134
135# Consolidated targets
136
49ee3590
AL
137.PHONY: check-qtest check-unit check
138check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
b93b63f5
PB
139check-unit: $(patsubst %,check-%, $(check-unit-y))
140check-block: $(patsubst %,check-%, $(check-block-y))
49ee3590 141check: check-unit check-qtest