<feed xmlns='http://www.w3.org/2005/Atom'>
<title>bwlp/qemu.git/tests/qapi-schema/unknown-escape.exit, branch spice_video_codecs</title>
<subtitle>Experimental fork of QEMU with video encoding patches</subtitle>
<id>https://git.openslx.org/bwlp/qemu.git/atom/tests/qapi-schema/unknown-escape.exit?h=spice_video_codecs</id>
<link rel='self' href='https://git.openslx.org/bwlp/qemu.git/atom/tests/qapi-schema/unknown-escape.exit?h=spice_video_codecs'/>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/'/>
<updated>2019-10-22T07:26:12+00:00</updated>
<entry>
<title>qapi: Speed up frontend tests</title>
<updated>2019-10-22T07:26:12+00:00</updated>
<author>
<name>Markus Armbruster</name>
</author>
<published>2019-10-18T07:43:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=f01338cce692ac54109f09bc6c7b5567611e2d24'/>
<id>urn:sha1:f01338cce692ac54109f09bc6c7b5567611e2d24</id>
<content type='text'>
"make check-qapi-schema" takes around 10s user + system time for me.
With -j, it takes a bit over 3s real time.  We have worse tests.  It's
still annoying when you work on the QAPI generator.

Some 1.4s user + system time is consumed by make figuring out what to
do, measured by making a target that does nothing.  There's nothing I
can do about that right now.  But let's see what we can do about the
other 8s.

Almost 7s are spent running test-qapi.py for every test case, the rest
normalizing and diffing test-qapi.py output.  We have 190 test cases.

If I downgrade to python2, it's 4.5s, but python2 is a goner.

Hacking up test-qapi.py to exit(0) without doing anything makes it
only marginally faster.  The problem is Python startup overhead.

Our configure puts -B into $(PYTHON).  Running without -B is faster:
4.4s.

We could improve the Makefile to run test cases only when the test
case or the generator changed.  But I'm after improvement in the case
where the generator changed.

test-qapi.py is designed to be the simplest possible building block
for a shell script to do the complete job (it's actually a Makefile,
not a shell script; no real difference).  Python is just not meant for
that.  It's for bigger blocks.

Move the post-processing and diffing into test-qapi.py, and make it
capable of testing multiple schema files.  Set executable bits while
there.

Running it once per test case now takes slightly longer than 8s.  But
running it once for all of them takes under 0.2s.

Messing with the Makefile to run it only on the tests that need
retesting is clearly not worth the bother.

Expected error output changes because the new normalization strips off
$(SRCDIR)/tests/qapi-schema/ instead of just $(SRCDIR)/.

The .exit files go away, because there is no exit status to test
anymore.

Signed-off-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Reviewed-by: Eric Blake &lt;eblake@redhat.com&gt;
Message-Id: &lt;20191018074345.24034-5-armbru@redhat.com&gt;
</content>
</entry>
<entry>
<title>qapi: Support (subset of) \u escapes in strings</title>
<updated>2015-05-05T16:39:02+00:00</updated>
<author>
<name>Eric Blake</name>
</author>
<published>2015-05-04T15:05:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=a7f5966b297330f6492020019544ae87c45d699b'/>
<id>urn:sha1:a7f5966b297330f6492020019544ae87c45d699b</id>
<content type='text'>
The handling of \ inside QAPI strings was less than ideal, and
really only worked JSON's \/, \\, \", and our extension of \'
(an obvious extension, when you realize we use '' instead of ""
for strings).  For other things, like '\n', it resulted in a
literal 'n' instead of a newline.

Of course, at the moment, we really have no use for escaped
characters, as QAPI has to map to C identifiers, and we currently
support ASCII only for that.  But down the road, we may add
support for default values for string parameters to a command
or struct; if that happens, it would be nice to correctly support
all JSON escape sequences, such as \n or \uXXXX.  This gets us
closer, by supporting Unicode escapes in the ASCII range.

Since JSON does not require \OCTAL or \xXX escapes, and our QMP
implementation does not understand them either, I intentionally
reject it here, but it would be an easy addition if we desired it.
Likewise, intentionally refusing the NUL byte means we don't have
to worry about C strings being shorter than the qapi input.

Signed-off-by: Eric Blake &lt;eblake@redhat.com&gt;
Reviewed-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Signed-off-by: Markus Armbruster &lt;armbru@redhat.com&gt;
</content>
</entry>
</feed>
