Message ID | 1358886309-26258-8-git-send-email-ehabkost@redhat.com |
---|---|
State | New |
Headers | show |
On Tue, Jan 22, 2013 at 06:25:07PM -0200, Eduardo Habkost wrote: > To make unit tests that depend on target-specific files, use > check-unit-<arch>-y and test-obj-<arch>-y. > > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Please drop this patch. I will submit a new version of patch 8/9 that doesn't require it. > --- > tests/Makefile | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/tests/Makefile b/tests/Makefile > index d86e95a..41172d6 100644 > --- a/tests/Makefile > +++ b/tests/Makefile > @@ -112,9 +112,21 @@ tests/fdc-test$(EXESUF): tests/fdc-test.o > tests/hd-geo-test$(EXESUF): tests/hd-geo-test.o > tests/tmp105-test$(EXESUF): tests/tmp105-test.o > > -# QTest rules > +# unit test rules: > > TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS))) > + > +# target-specific tests/objs: > + > +test-obj-y += $(foreach TARGET,$(TARGETS), $(test-obj-$(TARGET)-y)) > +check-unit-y += $(foreach TARGET,$(TARGETS), $(check-unit-$(TARGET)-y)) > + > +$(foreach TARGET,$(TARGETS),$(eval $(test-obj-$(TARGET)-y): QEMU_INCLUDES += -Itarget-$(TARGET))) > + > +$(test-obj-y): QEMU_INCLUDES += -Itests > + > +# QTest rules > + > QTEST_TARGETS=$(foreach TARGET,$(TARGETS), $(if $(check-qtest-$(TARGET)-y), $(TARGET),)) > check-qtest-$(CONFIG_POSIX)=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y)) > > -- > 1.8.1 > >
diff --git a/tests/Makefile b/tests/Makefile index d86e95a..41172d6 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -112,9 +112,21 @@ tests/fdc-test$(EXESUF): tests/fdc-test.o tests/hd-geo-test$(EXESUF): tests/hd-geo-test.o tests/tmp105-test$(EXESUF): tests/tmp105-test.o -# QTest rules +# unit test rules: TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS))) + +# target-specific tests/objs: + +test-obj-y += $(foreach TARGET,$(TARGETS), $(test-obj-$(TARGET)-y)) +check-unit-y += $(foreach TARGET,$(TARGETS), $(check-unit-$(TARGET)-y)) + +$(foreach TARGET,$(TARGETS),$(eval $(test-obj-$(TARGET)-y): QEMU_INCLUDES += -Itarget-$(TARGET))) + +$(test-obj-y): QEMU_INCLUDES += -Itests + +# QTest rules + QTEST_TARGETS=$(foreach TARGET,$(TARGETS), $(if $(check-qtest-$(TARGET)-y), $(TARGET),)) check-qtest-$(CONFIG_POSIX)=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y))
To make unit tests that depend on target-specific files, use check-unit-<arch>-y and test-obj-<arch>-y. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- tests/Makefile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)