]> Git Repo - qemu.git/blame - tests/Makefile
Merge remote-tracking branch 'bonzini/build-urgent' into staging
[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)
2d496105 16check-unit-y += tests/test-visitor-serialization$(EXESUF)
2278a69e 17check-unit-y += tests/test-iov$(EXESUF)
b93b63f5
PB
18
19check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
20
d1aaf543
AL
21# All QTests for now are POSIX-only, but the dependencies are
22# really in libqtest, not in the testcases themselves.
6c806637 23check-qtest-i386-y = tests/fdc-test$(EXESUF)
0e8a8c8f 24check-qtest-i386-y += tests/hd-geo-test$(EXESUF)
fba0c40b 25check-qtest-i386-y += tests/rtc-test$(EXESUF)
d1aaf543 26check-qtest-x86_64-y = $(check-qtest-i386-y)
f91837a7
BS
27check-qtest-sparc-y = tests/m48t59-test$(EXESUF)
28check-qtest-sparc64-y = tests/m48t59-test$(EXESUF)
d1aaf543 29
b93b63f5
PB
30GENERATED_HEADERS += tests/test-qapi-types.h tests/test-qapi-visit.h tests/test-qmp-commands.h
31
32test-obj-y = tests/check-qint.o tests/check-qstring.o tests/check-qdict.o \
33 tests/check-qlist.o tests/check-qfloat.o tests/check-qjson.o \
34 tests/test-coroutine.o tests/test-string-output-visitor.o \
35 tests/test-string-input-visitor.o tests/test-qmp-output-visitor.o \
36 tests/test-qmp-input-visitor.o tests/test-qmp-input-strict.o \
2d496105 37 tests/test-qmp-commands.o tests/test-visitor-serialization.o
b93b63f5 38
136594f1 39test-qapi-obj-y = $(qobject-obj-y) $(qapi-obj-y) qemu-tool.o
b93b63f5
PB
40test-qapi-obj-y += tests/test-qapi-visit.o tests/test-qapi-types.o
41test-qapi-obj-y += module.o
42
b93b63f5
PB
43$(test-obj-y): QEMU_INCLUDES += -Itests
44
0ef3dd6c
PB
45tests/check-qint$(EXESUF): tests/check-qint.o qint.o
46tests/check-qstring$(EXESUF): tests/check-qstring.o qstring.o
47tests/check-qdict$(EXESUF): tests/check-qdict.o qdict.o qfloat.o qint.o qstring.o qbool.o qlist.o
48tests/check-qlist$(EXESUF): tests/check-qlist.o qlist.o qint.o
49tests/check-qfloat$(EXESUF): tests/check-qfloat.o qfloat.o
136594f1 50tests/check-qjson$(EXESUF): tests/check-qjson.o $(qobject-obj-y) qemu-tool.o
2b84c2be 51tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(coroutine-obj-y) $(tools-obj-y) $(block-obj-y) iov.o libqemustub.a
2278a69e 52tests/test-iov$(EXESUF): tests/test-iov.o iov.o
b93b63f5
PB
53
54tests/test-qapi-types.c tests/test-qapi-types.h :\
dbfe06c6 55$(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py
b93b63f5
PB
56 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o tests -p "test-" < $<, " GEN $@")
57tests/test-qapi-visit.c tests/test-qapi-visit.h :\
dbfe06c6 58$(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-visit.py
b93b63f5
PB
59 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o tests -p "test-" < $<, " GEN $@")
60tests/test-qmp-commands.h tests/test-qmp-marshal.c :\
dbfe06c6 61$(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py
b93b63f5 62 $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o tests -p "test-" < $<, " GEN $@")
dbfe06c6
AL
63
64
b93b63f5
PB
65tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y)
66tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y)
67tests/test-qmp-output-visitor$(EXESUF): tests/test-qmp-output-visitor.o $(test-qapi-obj-y)
68tests/test-qmp-input-visitor$(EXESUF): tests/test-qmp-input-visitor.o $(test-qapi-obj-y)
69tests/test-qmp-input-strict$(EXESUF): tests/test-qmp-input-strict.o $(test-qapi-obj-y)
70tests/test-qmp-commands$(EXESUF): tests/test-qmp-commands.o tests/test-qmp-marshal.o $(test-qapi-obj-y)
2d496105 71tests/test-visitor-serialization$(EXESUF): tests/test-visitor-serialization.o $(test-qapi-obj-y)
2d7799f2 72
d2a16f74 73tests/rtc-test$(EXESUF): tests/rtc-test.o $(trace-obj-y)
f91837a7 74tests/m48t59-test$(EXESUF): tests/m48t59-test.o $(trace-obj-y)
fd4567d9 75tests/fdc-test$(EXESUF): tests/fdc-test.o tests/libqtest.o $(trace-obj-y)
0e8a8c8f 76tests/hd-geo-test$(EXESUF): tests/hd-geo-test.o tests/libqtest.o $(trace-obj-y)
d2a16f74 77
49ee3590
AL
78# QTest rules
79
80TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS)))
81QTEST_TARGETS=$(foreach TARGET,$(TARGETS), $(if $(check-qtest-$(TARGET)-y), $(TARGET),))
82check-qtest-$(CONFIG_POSIX)=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y))
83
2b84c2be 84qtest-obj-y = tests/libqtest.o $(oslib-obj-y) libqemustub.a
49ee3590
AL
85$(check-qtest-y): $(qtest-obj-y)
86
b93b63f5
PB
87.PHONY: check-help
88check-help:
89 @echo "Regression testing targets:"
90 @echo
91 @echo " make check Run all tests"
49ee3590
AL
92 @echo " make check-qtest-TARGET Run qtest tests for given target"
93 @echo " make check-qtest Run qtest tests"
b93b63f5
PB
94 @echo " make check-unit Run qobject tests"
95 @echo " make check-block Run block tests"
96 @echo " make check-report.html Generates an HTML test report"
97 @echo
98 @echo "Please note that HTML reports do not regenerate if the unit tests"
99 @echo "has not changed."
100 @echo
101 @echo "The variable SPEED can be set to control the gtester speed setting."
102 @echo "Default options are -k and (for make V=1) --verbose; they can be"
103 @echo "changed with variable GTESTER_OPTIONS."
2d7799f2 104
b93b63f5
PB
105SPEED = quick
106GTESTER_OPTIONS = -k $(if $(V),--verbose,-q)
dbfe06c6 107
b93b63f5 108# gtester tests, possibly with verbose output
dbfe06c6 109
49ee3590
AL
110.PHONY: $(patsubst %, check-qtest-%, $(QTEST_TARGETS))
111$(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: $(check-qtest-y)
112 $(call quiet-command,QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
113 gtester $(GTESTER_OPTIONS) -m=$(SPEED) $(check-qtest-$*-y),"GTESTER $@")
114
b93b63f5
PB
115.PHONY: $(patsubst %, check-%, $(check-unit-y))
116$(patsubst %, check-%, $(check-unit-y)): check-%: %
117 $(call quiet-command,gtester $(GTESTER_OPTIONS) -m=$(SPEED) $*,"GTESTER $*")
dbfe06c6 118
b93b63f5 119# gtester tests with XML output
8959449b 120
49ee3590
AL
121$(patsubst %, check-report-qtest-%.xml, $(QTEST_TARGETS)): check-report-qtest-%.xml: $(check-qtest-y)
122 $(call quiet-command,QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
123 gtester -q $(GTESTER_OPTIONS) -o $@ -m=$(SPEED) $(check-qtest-$*-y),"GTESTER $@")
124
b93b63f5
PB
125check-report-unit.xml: $(check-unit-y)
126 $(call quiet-command,gtester -q $(GTESTER_OPTIONS) -o $@ -m=$(SPEED) $^, "GTESTER $@")
b8c6f29e 127
b93b63f5 128# Reports and overall runs
b8c6f29e 129
49ee3590 130check-report.xml: $(patsubst %,check-report-qtest-%.xml, $(QTEST_TARGETS)) check-report-unit.xml
b93b63f5 131 $(call quiet-command,$(SRC_PATH)/scripts/gtester-cat $^ > $@, " GEN $@")
b8c6f29e 132
b93b63f5
PB
133check-report.html: check-report.xml
134 $(call quiet-command,gtester-report $< > $@, " GEN $@")
135
136
137# Other tests
138
139.PHONY: check-tests/qemu-iotests-quick.sh
140check-tests/qemu-iotests-quick.sh: tests/qemu-iotests-quick.sh qemu-img$(EXESUF) qemu-io$(EXESUF)
141 $<
142
143# Consolidated targets
144
49ee3590
AL
145.PHONY: check-qtest check-unit check
146check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
b93b63f5
PB
147check-unit: $(patsubst %,check-%, $(check-unit-y))
148check-block: $(patsubst %,check-%, $(check-block-y))
49ee3590 149check: check-unit check-qtest
14117c7b
EH
150
151-include $(wildcard tests/*.d)
This page took 0.192537 seconds and 4 git commands to generate.