From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYDR5-0003H4-UA for qemu-devel@nongnu.org; Sat, 05 Sep 2015 09:23:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYDR1-0006hX-O7 for qemu-devel@nongnu.org; Sat, 05 Sep 2015 09:23:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38769) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYDR1-0006hR-IF for qemu-devel@nongnu.org; Sat, 05 Sep 2015 09:23:11 -0400 References: <1441290623-13631-1-git-send-email-armbru@redhat.com> <1441290623-13631-6-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <55EAECBD.6070807@redhat.com> Date: Sat, 5 Sep 2015 07:23:09 -0600 MIME-Version: 1.0 In-Reply-To: <1441290623-13631-6-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6bWIPGR3m9qFmHwwIpGPMPtExtqSRJWX3" Subject: Re: [Qemu-devel] [PATCH RFC v4 05/32] tests/qapi-schema: Convert test harness to QAPISchemaVisitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --6bWIPGR3m9qFmHwwIpGPMPtExtqSRJWX3 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/03/2015 08:29 AM, Markus Armbruster wrote: > The old code prints the result of parsing (list of expression > dictionaries), and partial results of semantic analysis (list of enum > dictionaries, list of struct dictionaries). >=20 > The new code prints a trace of a schema visit, i.e. what the back-ends > are going to use. Built-in and array types are omitted, because > they're boring. >=20 > Signed-off-by: Markus Armbruster > Reviewed-by: Eric Blake > --- > +++ b/tests/qapi-schema/test-qapi.py > @@ -15,11 +15,35 @@ from pprint import pprint > import os > import sys > =20 > -try: > - exprs =3D QAPISchema(sys.argv[1]).get_exprs() > -except SystemExit: > - raise Don't we still need a try wrapped around... > +schema =3D QAPISchema(sys.argv[1]) > +schema.visit(QAPISchemaTestVisitor()) =2E..this, to guarantee non-zero exit status if an exception caused by refactoring breaks the pretty-printing? (It happened to me when I tried to rename to _tag_name, and my only indication that something was wrong was that qapi-tests/qapi-schema-test.out was truncated due to this script aborting early after trying to access the old spelling tag_name). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --6bWIPGR3m9qFmHwwIpGPMPtExtqSRJWX3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJV6uy+AAoJEKeha0olJ0NqiHQH/jmRGl/3jzbdkcJTZCr2X9Ah UbqGVpEaWMqtOSSWexvyYfPSZi6d3y65mnIBD3GWOgxS2jakZo3QGEnszGovvO++ bUSeu8WUq898MMu5Fd1HLfNsYoUb9GyrPDr/8mcDX15FnkUHrccwQT1zhwXFcxXY aIw6E/83br3U0K8TikvNx0UmbRtI+uzAkbFGaB1ntdhAYHHoLIqx96ZmiaEu6Nnh RaJlczQjDioHXQ5/RoEYh8Lew3E6yHUi5zjW25et/Qaje7dCIM8pPvqYZoEQVdNw wlfZABZpCB2u6kLEStYq0i8uPvasnkwJcXScmgIAnCPSYqxtoVCEZBDhuxD9oIk= =vUEp -----END PGP SIGNATURE----- --6bWIPGR3m9qFmHwwIpGPMPtExtqSRJWX3--