qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC v4 05/32] tests/qapi-schema: Convert test ha


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH RFC v4 05/32] tests/qapi-schema: Convert test harness to QAPISchemaVisitor
Date: Sat, 5 Sep 2015 07:23:09 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

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).
> 
> 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.
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
> ---

> +++ b/tests/qapi-schema/test-qapi.py
> @@ -15,11 +15,35 @@ from pprint import pprint
>  import os
>  import sys
>  
> -try:
> -    exprs = QAPISchema(sys.argv[1]).get_exprs()
> -except SystemExit:
> -    raise

Don't we still need a try wrapped around...

> +schema = QAPISchema(sys.argv[1])
> +schema.visit(QAPISchemaTestVisitor())

...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).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]