From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVCCS-0001Ye-2R for qemu-devel@nongnu.org; Tue, 19 Jun 2018 04:41:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVCCR-0005vl-7q for qemu-devel@nongnu.org; Tue, 19 Jun 2018 04:41:16 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:35086) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fVCCR-0005vU-0u for qemu-devel@nongnu.org; Tue, 19 Jun 2018 04:41:15 -0400 Received: by mail-wm0-x241.google.com with SMTP id j15-v6so20504292wme.0 for ; Tue, 19 Jun 2018 01:41:14 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <87po0nyzrg.fsf@dusky.pond.sub.org> References: <20180321115211.17937-1-marcandre.lureau@redhat.com> <20180321115211.17937-4-marcandre.lureau@redhat.com> <87po0nyzrg.fsf@dusky.pond.sub.org> From: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= Date: Tue, 19 Jun 2018 10:41:12 +0200 Message-ID: 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: Markus Armbruster Cc: QEMU On Tue, Jun 19, 2018 at 9:57 AM, Markus Armbruster wrot= e: > 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)): chec= k-%.json: $(SRC_PATH)/%.json >> "TEST","$*.out") >> @# Sanitize error messages (make them independent of build directo= ry) >> @perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff -u $(SRC_PA= TH)/$*.err - >> + @if test "$(QAPI_REGENERATE)" =3D=3D 1 ; then cp $*.test.out $(SRC= _PATH)/$*.out ; fi >> + @if test "$(QAPI_REGENERATE)" =3D=3D 1 ; then cp $*.test.err $(SRC= _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. --=20 Marc-Andr=C3=A9 Lureau