Received: from eggs.gnu.org ([2001:4830:134:3::10]:49003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUzJV-0003BF-Dq for qemu-devel@nongnu.org; Tue, 01 Apr 2014 10:05:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WUzJN-0006Yw-TG for qemu-devel@nongnu.org; Tue, 01 Apr 2014 10:05:17 -0400 Received: from roura.ac.upc.edu ([147.83.33.10]:41361 helo=roura.ac.upc.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUzJN-0006Wq-4s for qemu-devel@nongnu.org; Tue, 01 Apr 2014 10:05:09 -0400 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <20140331191631.21034.25433.stgit@fimbulvetr.bsc.es> <20140331191642.21034.11615.stgit@fimbulvetr.bsc.es> <5339C534.4000806@redhat.com> Date: Tue, 01 Apr 2014 16:05:03 +0200 In-Reply-To: <5339C534.4000806@redhat.com> (Eric Blake's message of "Mon, 31 Mar 2014 13:42:44 -0600") Message-ID: <87bnwlrvqo.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v6 2/4] qapi: Use an explicit input file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: =?utf-8?Q?Beno=C3=AEt?= Canet , Markus Armbruster , qemu-devel@nongnu.org, Luiz Capitulino Eric Blake writes: > On 03/31/2014 01:16 PM, Llu=C3=ADs Vilanova wrote: [...] >> @@ -368,7 +368,8 @@ check-tests/test-qapi.py: tests/test-qapi.py >>=20 >> .PHONY: $(patsubst %, check-%, $(check-qapi-schema-y)) >> $(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH= )/%.json >> - $(call quiet-command, PYTHONPATH=3D$(SRC_PATH)/scripts $(PYTHON) $(SRC= _PATH)/tests/qapi-schema/test-qapi.py <$^ >$*.test.out 2>$*.test.err; echo = $$? >$*.test.exit, " TEST $*.out") >> + $(call quiet-command, PYTHONPATH=3D$(SRC_PATH)/scripts $(PYTHON) $(SRC= _PATH)/tests/qapi-schema/test-qapi.py "$^" >$*.test.out 2>$*.test.err; echo= $$? >$*.test.exit, " TEST $*.out") > Why is this line still long? Shouldn't it have been split in 1/4? And > why is this form using an argument of the input file, instead of adding > a -i option like all the others? The "test-qapi.py" was already not using arguments, so I did not add suppor= t for it, since it has one single mandatory argument. [...] >> +++ b/tests/qapi-schema/test-qapi.py >> @@ -12,10 +12,11 @@ >>=20 >> from qapi import * >> from pprint import pprint >> +import os >> import sys >>=20 >> try: >> - exprs =3D parse_schema(sys.stdin) >> + exprs =3D parse_schema(sys.argv[1]) > Here's where I found it inconsistent with the rest of the patch. It > seems it would be better to either use -i everywhere, or use sys.argv[1] > everywhere. I just did not want to add argument parsing when there's only one mandatory argument. >> +++ b/tests/qapi-schema/trailing-comma-list.err >> @@ -1 +1 @@ >> -:2:36: Expected "{", "[" or string >> +tests/qapi-schema/trailing-comma-list.json:2:36: Expected "{", "[" or s= tring > These are some long error messages; is it also worth trimming the > leading "tests/qapi-schema/" in the sed script where you massage the > data before doing the diff on expected errors? I'm neutral about this, since the user will barely ever look at the test contents. Lluis --=20 "And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Norton Juster in The Phantom Tollbooth