qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] ca0ac7: tests/qapi-schema: Make test-qapi.py


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] ca0ac7: tests/qapi-schema: Make test-qapi.py print arrays
Date: Tue, 05 Mar 2019 13:06:35 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: ca0ac758d6fad30676ded90d3975f282d57a4435
      
https://github.com/qemu/qemu/commit/ca0ac758d6fad30676ded90d3975f282d57a4435
  Author: Markus Armbruster <address@hidden>
  Date:   2019-03-05 (Tue, 05 Mar 2019)

  Changed paths:
    M tests/qapi-schema/qapi-schema-test.out
    M tests/qapi-schema/test-qapi.py

  Log Message:
  -----------
  tests/qapi-schema: Make test-qapi.py print arrays

The next few commits mess with array types, and having the changes
exposed in output of test-qapi.py will be useful.

Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
[Rationale added to commit message]


  Commit: 0f20628b24ecc1e085ec536a43ea9f6cc1605ad2
      
https://github.com/qemu/qemu/commit/0f20628b24ecc1e085ec536a43ea9f6cc1605ad2
  Author: Markus Armbruster <address@hidden>
  Date:   2019-03-05 (Tue, 05 Mar 2019)

  Changed paths:
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out

  Log Message:
  -----------
  tests/qapi-schema: Cover conditional arrays

Commit 967c885108f neglected to cover arrays of conditional types.  Do
that now.

Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: dddee4d7ba3c0992a32f805c02cb612775dfba54
      
https://github.com/qemu/qemu/commit/dddee4d7ba3c0992a32f805c02cb612775dfba54
  Author: Markus Armbruster <address@hidden>
  Date:   2019-03-05 (Tue, 05 Mar 2019)

  Changed paths:
    M scripts/qapi/commands.py
    M scripts/qapi/common.py
    M scripts/qapi/doc.py

  Log Message:
  -----------
  qapi: Pass file name to QAPIGen constructor instead of methods

Not much of an improvement now, but the next commit will profit.

Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 709395f8f627808175307f0c298ce71614fa67d0
      
https://github.com/qemu/qemu/commit/709395f8f627808175307f0c298ce71614fa67d0
  Author: Markus Armbruster <address@hidden>
  Date:   2019-03-05 (Tue, 05 Mar 2019)

  Changed paths:
    M scripts/qapi/common.py
    M tests/.gitignore
    M tests/Makefile.include
    R tests/qapi-schema/include-relpath-sub.json
    R tests/qapi-schema/include-relpath.err
    R tests/qapi-schema/include-relpath.exit
    R tests/qapi-schema/include-relpath.json
    R tests/qapi-schema/include-relpath.out
    R tests/qapi-schema/include/relpath.json
    A tests/qapi-schema/include/sub-module.json
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out
    A tests/qapi-schema/sub-sub-module.json

  Log Message:
  -----------
  qapi: Fix code generation for sub-modules in other directories

The #include directives to pull in sub-modules use file names relative
to the main module.  Works only when all modules are in the same
directory, or the main module's output directory is in the compiler's
include path.  Use relative file names instead.

The dummy variable we generate to avoid empty .o files has an invalid
name for sub-modules in other directories.  Fix that.

Both messed up in commit 252dc3105fc "qapi: Generate separate .h, .c
for each module".  Escaped testing because tests/qapi-schema-test.json
doesn't cover sub-modules in other directories, only
tests/qapi-schema/include-relpath.json does, and we generate and
compile C code only for the former, not the latter.  Fold the latter
into the former.  This would have caught the mistakes fixed in this
commit.

Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: b359f4b203fc8a3cc2967bf55d532dcf05928c8a
      
https://github.com/qemu/qemu/commit/b359f4b203fc8a3cc2967bf55d532dcf05928c8a
  Author: Markus Armbruster <address@hidden>
  Date:   2019-03-05 (Tue, 05 Mar 2019)

  Changed paths:
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out
    M tests/test-clone-visitor.c
    M tests/test-qmp-cmds.c
    M tests/test-qobject-input-visitor.c
    M tests/test-qobject-output-visitor.c

  Log Message:
  -----------
  tests: Rename UserDefNativeListUnion to UserDefListUnion

The lists in UserDefNativeListUnion aren't "native", they're lists of
built-in types.  The next commit will add a list of a user-defined
type.  Drop "Native", and adjust the tests using the type.

Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 5e12eb987b3299a5da4172fe744e91dbd00b6516
      
https://github.com/qemu/qemu/commit/5e12eb987b3299a5da4172fe744e91dbd00b6516
  Author: Markus Armbruster <address@hidden>
  Date:   2019-03-05 (Tue, 05 Mar 2019)

  Changed paths:
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out

  Log Message:
  -----------
  tests/qapi-schema: Cover forward reference to sub-module

The forward reference from the main module to the sub-module works
fine, except for an issue visible in qapi-schema-test.out: the array
type wrapped around the forward reference ends up in the main module,
not the sub-module.  The next commit will explain why that's bad, and
fix it.

Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 56a4689582433125d7042ba506a081e08dc264d4
      
https://github.com/qemu/qemu/commit/56a4689582433125d7042ba506a081e08dc264d4
  Author: Markus Armbruster <address@hidden>
  Date:   2019-03-05 (Tue, 05 Mar 2019)

  Changed paths:
    M scripts/qapi/common.py
    M tests/qapi-schema/include/sub-module.json
    M tests/qapi-schema/qapi-schema-test.out

  Log Message:
  -----------
  qapi: Fix array first used in a different module

We generally put implicitly defined types in whatever module triggered
their definition.  This is wrong for array types, as the included test
case demonstrates.  Let's have a closer look at it.

Type 'Status' is defined sub-sub-module.json.  Array type ['Status']
occurs in main module qapi-schema-test.json and in
include/sub-module.json.  The main module's use is first, so the array
type gets put into the main module.

The generated C headers define StatusList in qapi-types.h.  But
include/qapi-types-sub-module.h uses it without including
qapi-types.h.  Oops.

To fix that, put the array type into its element type's module.

Now StatusList gets generated into qapi-types-sub-module.h, which all
its users include.

Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: a3e3b0a7bd5de211a62cdf2d6c12b96d3c403560
      
https://github.com/qemu/qemu/commit/a3e3b0a7bd5de211a62cdf2d6c12b96d3c403560
  Author: Peter Maydell <address@hidden>
  Date:   2019-03-05 (Tue, 05 Mar 2019)

  Changed paths:
    M scripts/qapi/commands.py
    M scripts/qapi/common.py
    M scripts/qapi/doc.py
    M tests/.gitignore
    M tests/Makefile.include
    R tests/qapi-schema/include-relpath-sub.json
    R tests/qapi-schema/include-relpath.err
    R tests/qapi-schema/include-relpath.exit
    R tests/qapi-schema/include-relpath.json
    R tests/qapi-schema/include-relpath.out
    R tests/qapi-schema/include/relpath.json
    A tests/qapi-schema/include/sub-module.json
    M tests/qapi-schema/qapi-schema-test.json
    M tests/qapi-schema/qapi-schema-test.out
    A tests/qapi-schema/sub-sub-module.json
    M tests/qapi-schema/test-qapi.py
    M tests/test-clone-visitor.c
    M tests/test-qmp-cmds.c
    M tests/test-qobject-input-visitor.c
    M tests/test-qobject-output-visitor.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2019-03-05' into 
staging

QAPI patches for 2019-03-05

# gpg: Signature made Tue 05 Mar 2019 16:47:17 GMT
# gpg:                using RSA key 3870B400EB918653
# gpg: Good signature from "Markus Armbruster <address@hidden>" [full]
# gpg:                 aka "Markus Armbruster <address@hidden>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-qapi-2019-03-05:
  qapi: Fix array first used in a different module
  tests/qapi-schema: Cover forward reference to sub-module
  tests: Rename UserDefNativeListUnion to UserDefListUnion
  qapi: Fix code generation for sub-modules in other directories
  qapi: Pass file name to QAPIGen constructor instead of methods
  tests/qapi-schema: Cover conditional arrays
  tests/qapi-schema: Make test-qapi.py print arrays

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/c99b58326d92...a3e3b0a7bd5d



reply via email to

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