Message ID | 1380008620-13796-2-git-send-email-armbru@redhat.com |
---|---|
State | New |
Headers | show |
24.09.2013 11:43, armbru@redhat.com wrote: > From: Markus Armbruster <armbru@redhat.com> > > Commit 4f193e3 added the test, but screwed up in-tree builds > (SRCDIR=.): the tests's output overwrites the expected output, and is > thus compared to itself. [] > .PHONY: $(patsubst %, check-%, $(check-qapi-schema-y)) > $(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json > - $(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts $(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py <$^ >$*.out 2>$*.err; echo $$? >$*.exit, " TEST $*.out") > - @diff -q $(SRC_PATH)/$*.out $*.out > - @diff -q $(SRC_PATH)/$*.err $*.err > - @diff -q $(SRC_PATH)/$*.exit $*.exit > + $(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts $(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py <$^ >$*.test.out 2>$*.test.err; echo $$? >$*.test.exit, " TEST $*.out") > + @diff -q $(SRC_PATH)/$*.out $*.test.out > + @diff -q $(SRC_PATH)/$*.err $*.test.err > + @diff -q $(SRC_PATH)/$*.exit $*.test.exit Hmm. Maybe these new files should be cleaned up somehow by `make clean' ? Thanks, /mjt
Michael Tokarev <mjt@tls.msk.ru> writes: > 24.09.2013 11:43, armbru@redhat.com wrote: >> From: Markus Armbruster <armbru@redhat.com> >> >> Commit 4f193e3 added the test, but screwed up in-tree builds >> (SRCDIR=.): the tests's output overwrites the expected output, and is >> thus compared to itself. > > [] >> .PHONY: $(patsubst %, check-%, $(check-qapi-schema-y)) >> $(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: >> $(SRC_PATH)/%.json >> - $(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts $(PYTHON) >> $(SRC_PATH)/tests/qapi-schema/test-qapi.py <$^ >$*.out 2>$*.err; >> echo $$? >$*.exit, " TEST $*.out") >> - @diff -q $(SRC_PATH)/$*.out $*.out >> - @diff -q $(SRC_PATH)/$*.err $*.err >> - @diff -q $(SRC_PATH)/$*.exit $*.exit >> + $(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts $(PYTHON) >> $(SRC_PATH)/tests/qapi-schema/test-qapi.py <$^ >$*.test.out >> 2>$*.test.err; echo $$? >$*.test.exit, " TEST $*.out") >> + @diff -q $(SRC_PATH)/$*.out $*.test.out >> + @diff -q $(SRC_PATH)/$*.err $*.test.err >> + @diff -q $(SRC_PATH)/$*.exit $*.test.exit > > Hmm. Maybe these new files should be cleaned up somehow by > `make clean' ? Guess so. However, "make clean" doesn't clean *anything* in tests/ right now. Separate fix?
24.09.2013 11:43, armbru@redhat.com wrote: > From: Markus Armbruster <armbru@redhat.com> > > Commit 4f193e3 added the test, but screwed up in-tree builds > (SRCDIR=.): the tests's output overwrites the expected output, and is > thus compared to itself. Thanks, applied to the trivial patches queue. The `clean' target for tests/ would be nice to have, too... ;) /mjt
diff --git a/tests/.gitignore b/tests/.gitignore index ae5280e..75f06a1 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -21,3 +21,4 @@ test-thread-pool test-x86-cpuid test-xbzrle *-test +qapi-schema/*.test.* diff --git a/tests/Makefile b/tests/Makefile index 994fef1..915ae5e 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -261,10 +261,10 @@ check-tests/test-qapi.py: tests/test-qapi.py .PHONY: $(patsubst %, check-%, $(check-qapi-schema-y)) $(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json - $(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts $(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py <$^ >$*.out 2>$*.err; echo $$? >$*.exit, " TEST $*.out") - @diff -q $(SRC_PATH)/$*.out $*.out - @diff -q $(SRC_PATH)/$*.err $*.err - @diff -q $(SRC_PATH)/$*.exit $*.exit + $(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts $(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py <$^ >$*.test.out 2>$*.test.err; echo $$? >$*.test.exit, " TEST $*.out") + @diff -q $(SRC_PATH)/$*.out $*.test.out + @diff -q $(SRC_PATH)/$*.err $*.test.err + @diff -q $(SRC_PATH)/$*.exit $*.test.exit # Consolidated targets