qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: akong@redhat.com, qemu-devel@nongnu.org,
	Anthony Liguori <anthony@codemonkey.ws>,
	mdroth@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH v2 1/9] tests: QAPI schema parser tests
Date: Tue, 20 Aug 2013 00:02:26 +0200	[thread overview]
Message-ID: <521295F2.90102@redhat.com> (raw)
In-Reply-To: <1374939721-7876-2-git-send-email-armbru@redhat.com>

On 07/27/13 17:41, Markus Armbruster wrote:
> The parser handles erroneous input badly.  To be improved shortly.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

> diff --git a/tests/Makefile b/tests/Makefile
> index cdbb79e..ddb957c 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile

> @@ -233,13 +242,24 @@ check-report.html: check-report.xml
>  check-tests/qemu-iotests-quick.sh: tests/qemu-iotests-quick.sh qemu-img$(EXESUF) qemu-io$(EXESUF)
>  	$<
>  
> +.PHONY: check-tests/test-qapi.py
> +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
> +

Unfortunately, this doesn't catch errors/differences when someone builds
qemu in the source tree, and runs "make check" there. In that case,
whatever output "test-qapi.py" produces, overwrites the in-tree file,
and the diff commands compare files with themselves.

Also, why is 2/9 a good idea, namely, using "qapi-schema-test.json" as a
test file itself? Whoever adds a new test, for anything that uses the
schema, now has to update the .out file as well. (And, due to the above,
only realizes this burden when someone else tries to make-check his/her
code outside of the tree...)

Thanks,
Laszlo

  reply	other threads:[~2013-08-19 22:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-27 15:41 [Qemu-devel] [PATCH v2 0/9] Our QAPI parser is a hack, replace it Markus Armbruster
2013-07-27 15:41 ` [Qemu-devel] [PATCH v2 1/9] tests: QAPI schema parser tests Markus Armbruster
2013-08-19 22:02   ` Laszlo Ersek [this message]
2013-08-20  6:58     ` Markus Armbruster
2013-07-27 15:41 ` [Qemu-devel] [PATCH v2 2/9] tests: Use qapi-schema-test.json as schema parser test Markus Armbruster
2013-07-27 15:41 ` [Qemu-devel] [PATCH v2 3/9] qapi.py: Restructure lexer and parser Markus Armbruster
2013-07-27 15:41 ` [Qemu-devel] [PATCH v2 4/9] qapi.py: Decent syntax error reporting Markus Armbruster
2013-07-27 15:41 ` [Qemu-devel] [PATCH v2 5/9] qapi.py: Reject invalid characters in schema file Markus Armbruster
2013-07-27 15:41 ` [Qemu-devel] [PATCH v2 6/9] qapi.py: Fix schema parser to check syntax systematically Markus Armbruster
2013-07-27 15:41 ` [Qemu-devel] [PATCH v2 7/9] qapi.py: Fix diagnosing non-objects at a schema's top-level Markus Armbruster
2013-07-27 15:42 ` [Qemu-devel] [PATCH v2 8/9] qapi.py: Rename expr_eval to expr in parse_schema() Markus Armbruster
2013-07-27 15:42 ` [Qemu-devel] [PATCH v2 9/9] qapi.py: Permit comments starting anywhere on the line Markus Armbruster
2013-07-29 20:24 ` [Qemu-devel] [PATCH v2 0/9] Our QAPI parser is a hack, replace it Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=521295F2.90102@redhat.com \
    --to=lersek@redhat.com \
    --cc=akong@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=armbru@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).