All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v4 1/3] qapi: Use an explicit input file
Date: Mon, 03 Mar 2014 16:42:39 +0100	[thread overview]
Message-ID: <87vbvvwaog.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <87y50rxsss.fsf@fimbulvetr.bsc.es> ("Lluís Vilanova"'s message of "Mon, 03 Mar 2014 15:25:55 +0100")

Lluís Vilanova <vilanova@ac.upc.edu> writes:

> Markus Armbruster writes:
>
>> Lluís Vilanova <vilanova@ac.upc.edu> writes:
> [...]
>>> diff --git a/scripts/qapi.py b/scripts/qapi.py
>>> index 9b3de4c..59c2b9b 100644
>>> --- a/scripts/qapi.py
>>> +++ b/scripts/qapi.py
>>> @@ -12,6 +12,7 @@
>>> # See the COPYING.LIB file in the top-level directory.
>>> 
>>> from ordereddict import OrderedDict
>>> +import os
>>> import sys
>>> 
>>> builtin_types = [
>>> @@ -37,6 +38,7 @@ builtin_type_qtypes = {
>>> 
>>> class QAPISchemaError(Exception):
>>> def __init__(self, schema, msg):
>>> +        self.base = schema.error_base
>
>> Non-obvious identifiers.  Took me some reading on to figure out that
>> this is a directory.
>
> Will fix.
>
>
>>> self.fp = schema.fp
>>> self.msg = msg
>>> self.line = self.col = 1
>>> @@ -50,12 +52,17 @@ class QAPISchemaError(Exception):
>>> self.col += 1
>>> 
>>> def __str__(self):
>>> - return "%s:%s:%s: %s" % (self.fp.name, self.line, self.col,
>>> self.msg)
>>> +        name = os.path.relpath(self.fp.name, self.base)
>>> +        return "%s:%s:%s: %s" % (name, self.line, self.col, self.msg)
>
>> Can you explain what this change does, and why it's wanted?
>
> Paths are shown as relative so that the test outputs (stderr) can be verified
> with diff. Otherwise the actual message depends on the path from which you're
> running the tests.

Hmm.  This is the applicable make rule:

$(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json
	$(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts $(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py "$^" >$*.test.out 2>$*.test.err; echo $$? >$*.test.exit, "  TEST  $*.out")
	@diff -q $(SRC_PATH)/$*.out $*.test.out
	@diff -q $(SRC_PATH)/$*.err $*.test.err
	@diff -q $(SRC_PATH)/$*.exit $*.test.exit

Since $^ is in $(SRC_PATH), it's like $(SRC_PATH)/foo.json.  If
$(SRC_PATH)/foo.json has an error, the error messages duly points to
$(SRC_PATH)/foo.json.

The "diff -q $(SRC_PATH)/$*.err $*.test.err" fails unless your SRC_PATH
matches the one that's encoded in tests/qapi-schema/foo.err.  Is that
the problem you're trying to solve?

[...]

  reply	other threads:[~2014-03-03 15:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-28 15:53 [Qemu-devel] [PATCH v4 0/3] qapi: Allow modularization of QAPI schema files Lluís Vilanova
2014-02-28 15:53 ` [Qemu-devel] [PATCH v4 1/3] qapi: Use an explicit input file Lluís Vilanova
2014-03-01  8:35   ` Markus Armbruster
2014-03-03 14:25     ` Lluís Vilanova
2014-03-03 15:42       ` Markus Armbruster [this message]
2014-03-03 16:59         ` Lluís Vilanova
2014-03-04 13:17           ` Markus Armbruster
2014-03-05  0:58             ` Lluís Vilanova
2014-02-28 15:53 ` [Qemu-devel] [PATCH v4 2/3] qapi: Add a primitive to include other files from a QAPI schema file Lluís Vilanova
2014-03-01  8:57   ` Markus Armbruster
2014-03-03 14:21     ` Lluís Vilanova
2014-03-03 15:27       ` Markus Armbruster
2014-03-03 17:04         ` Lluís Vilanova
2014-03-03 17:56         ` Eric Blake
2014-03-04  8:02           ` Markus Armbruster
2014-03-13 15:33             ` Benoît Canet
2014-03-13 15:54               ` Eric Blake
2014-03-13 18:05                 ` Lluís Vilanova
2014-03-14 16:35                   ` Benoît Canet
2014-03-14 20:24                     ` Lluís Vilanova
2014-03-14 21:55                       ` Benoît Canet
2014-03-17 14:20                 ` Benoît Canet
2014-02-28 15:53 ` [Qemu-devel] [PATCH v4 3/3] qapi: Add tests for the "include" directive Lluís Vilanova
2014-02-28 16:18 ` [Qemu-devel] [PATCH v4 0/3] qapi: Allow modularization of QAPI schema files Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vbvvwaog.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.