From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVEvd-0002D4-4R for qemu-devel@nongnu.org; Tue, 19 Jun 2018 07:36:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVEvZ-0006Kz-Sl for qemu-devel@nongnu.org; Tue, 19 Jun 2018 07:36:05 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35048 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fVEvZ-0006Kj-Lq for qemu-devel@nongnu.org; Tue, 19 Jun 2018 07:36:01 -0400 From: Markus Armbruster References: <20180321115211.17937-1-marcandre.lureau@redhat.com> <20180321115211.17937-4-marcandre.lureau@redhat.com> <87po0nyzrg.fsf@dusky.pond.sub.org> Date: Tue, 19 Jun 2018 13:35:59 +0200 In-Reply-To: (=?utf-8?Q?=22Marc-Andr=C3=A9?= Lureau"'s message of "Tue, 19 Jun 2018 10:41:12 +0200") Message-ID: <87wouvvwio.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 03/49] qapi: add 'if' to top-level expressions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Cc: Markus Armbruster , QEMU Marc-Andr=C3=A9 Lureau writes: > On Tue, Jun 19, 2018 at 9:57 AM, Markus Armbruster wr= ote: >> Marc-Andr=C3=A9 Lureau writes: >> >>> Accept 'if' key in top-level elements, accepted as string or list of >>> string type. The following patches will modify the test visitor to >>> check the value is correctly saved, and generate #if/#endif code (as a >>> single #if/endif line or a series for a list). >>> >>> Example of 'if' key: >>> { 'struct': 'TestIfStruct', 'data': { 'foo': 'int' }, >>> 'if': 'defined(TEST_IF_STRUCT)' } >>> >>> The generated code is for now *unconditional*. Later patches generate >>> the conditionals. >>> >>> A following patch for qapi-code-gen.txt will provide more complete >>> documentation for 'if' usage. >>> >>> Signed-off-by: Marc-Andr=C3=A9 Lureau >>> Reviewed-by: Markus Armbruster >> [...] >>> diff --git a/tests/Makefile.include b/tests/Makefile.include >>> index 0b277036df..f77ad2ba3b 100644 >>> --- a/tests/Makefile.include >>> +++ b/tests/Makefile.include >>> @@ -436,6 +436,10 @@ qapi-schema +=3D args-unknown.json >>> qapi-schema +=3D bad-base.json >>> qapi-schema +=3D bad-data.json >>> qapi-schema +=3D bad-ident.json >>> +qapi-schema +=3D bad-if.json >>> +qapi-schema +=3D bad-if-empty.json >>> +qapi-schema +=3D bad-if-empty-list.json >>> +qapi-schema +=3D bad-if-list.json >>> qapi-schema +=3D bad-type-bool.json >>> qapi-schema +=3D bad-type-dict.json >>> qapi-schema +=3D bad-type-int.json >>> @@ -933,6 +937,8 @@ $(patsubst %, check-%, $(check-qapi-schema-y)): che= ck-%.json: $(SRC_PATH)/%.json >>> "TEST","$*.out") >>> @# Sanitize error messages (make them independent of build direct= ory) >>> @perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff -u $(SRC_P= ATH)/$*.err - >>> + @if test "$(QAPI_REGENERATE)" =3D=3D 1 ; then cp $*.test.out $(SR= C_PATH)/$*.out ; fi >>> + @if test "$(QAPI_REGENERATE)" =3D=3D 1 ; then cp $*.test.err $(SR= C_PATH)/$*.err ; fi >>> @diff -u $(SRC_PATH)/$*.out $*.test.out >>> @diff -u $(SRC_PATH)/$*.exit $*.test.exit >>> >> >> Huh? > > Oops, leftover. Do you have an alternative? I could propose it as a > seperate patch if it's generally useful. I guess what you're trying to do here is updating expected test output. So far, everybody does that by hand. A make target to do that (check-accept?) would be nice. Trivial to do if we had a single test harness, but of course we have many. My R-by stands with this hunk dropped.