diff mbox series

[v2,10/11] qapi: meson: add test flag to allow skip generators

Message ID 20230911111324.74940-1-victortoso@redhat.com (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Victor Toso Sept. 11, 2023, 11:13 a.m. UTC
The next patch adds a generator that also validates qapi
documentation. We don't want to execute it with a test schema.

Signed-off-by: Victor Toso <victortoso@redhat.com>
---
 scripts/qapi/main.py | 4 ++++
 tests/meson.build    | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Victor Toso Sept. 11, 2023, 11:26 a.m. UTC | #1
Hi,

Sorry, this two are part of v2, did a mistake with
git-send-email. I'll add them to the right thread with
--in-reply-to shortly (without cc, to avoid spamming people's
inbox)

v2: https://lists.gnu.org/archive/html/qemu-devel/2023-09/msg02383.html

Cheers,
Victor

On Mon, Sep 11, 2023 at 01:13:23PM +0200, Victor Toso wrote:
> The next patch adds a generator that also validates qapi
> documentation. We don't want to execute it with a test schema.
> 
> Signed-off-by: Victor Toso <victortoso@redhat.com>
> ---
>  scripts/qapi/main.py | 4 ++++
>  tests/meson.build    | 2 +-
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/qapi/main.py b/scripts/qapi/main.py
> index 316736b6a2..7efdcc6b8d 100644
> --- a/scripts/qapi/main.py
> +++ b/scripts/qapi/main.py
> @@ -33,6 +33,7 @@ def generate(schema_file: str,
>               prefix: str,
>               unmask: bool = False,
>               builtins: bool = False,
> +             test_schema: bool = False,
>               gen_tracing: bool = False) -> None:
>      """
>      Generate C code for the given schema into the target directory.
> @@ -75,6 +76,8 @@ def main() -> int:
>      parser.add_argument('-u', '--unmask-non-abi-names', action='store_true',
>                          dest='unmask',
>                          help="expose non-ABI names in introspection")
> +    parser.add_argument('-t', '--tests', action='store_true',
> +                        help="flag generator that is running with a test schema")
>  
>      # Option --suppress-tracing exists so we can avoid solving build system
>      # problems.  TODO Drop it when we no longer need it.
> @@ -96,6 +99,7 @@ def main() -> int:
>                   prefix=args.prefix,
>                   unmask=args.unmask,
>                   builtins=args.builtins,
> +                 test_schema=args.tests,
>                   gen_tracing=not args.suppress_tracing)
>      except QAPIError as err:
>          print(err, file=sys.stderr)
> diff --git a/tests/meson.build b/tests/meson.build
> index debaa4505e..ed0844a6a0 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -43,7 +43,7 @@ test_qapi_files = custom_target('Test QAPI files',
>                                               'qapi-schema/include/sub-module.json',
>                                               'qapi-schema/sub-sub-module.json'),
>                                  command: [ qapi_gen, '-o', meson.current_build_dir(),
> -                                           '-b', '-p', 'test-', '@INPUT0@',
> +                                           '-t', '-b', '-p', 'test-', '@INPUT0@',
>                                             '--suppress-tracing' ],
>                                  depend_files: qapi_gen_depends)
>  
> -- 
> 2.41.0
> 
>
diff mbox series

Patch

diff --git a/scripts/qapi/main.py b/scripts/qapi/main.py
index 316736b6a2..7efdcc6b8d 100644
--- a/scripts/qapi/main.py
+++ b/scripts/qapi/main.py
@@ -33,6 +33,7 @@  def generate(schema_file: str,
              prefix: str,
              unmask: bool = False,
              builtins: bool = False,
+             test_schema: bool = False,
              gen_tracing: bool = False) -> None:
     """
     Generate C code for the given schema into the target directory.
@@ -75,6 +76,8 @@  def main() -> int:
     parser.add_argument('-u', '--unmask-non-abi-names', action='store_true',
                         dest='unmask',
                         help="expose non-ABI names in introspection")
+    parser.add_argument('-t', '--tests', action='store_true',
+                        help="flag generator that is running with a test schema")
 
     # Option --suppress-tracing exists so we can avoid solving build system
     # problems.  TODO Drop it when we no longer need it.
@@ -96,6 +99,7 @@  def main() -> int:
                  prefix=args.prefix,
                  unmask=args.unmask,
                  builtins=args.builtins,
+                 test_schema=args.tests,
                  gen_tracing=not args.suppress_tracing)
     except QAPIError as err:
         print(err, file=sys.stderr)
diff --git a/tests/meson.build b/tests/meson.build
index debaa4505e..ed0844a6a0 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -43,7 +43,7 @@  test_qapi_files = custom_target('Test QAPI files',
                                              'qapi-schema/include/sub-module.json',
                                              'qapi-schema/sub-sub-module.json'),
                                 command: [ qapi_gen, '-o', meson.current_build_dir(),
-                                           '-b', '-p', 'test-', '@INPUT0@',
+                                           '-t', '-b', '-p', 'test-', '@INPUT0@',
                                            '--suppress-tracing' ],
                                 depend_files: qapi_gen_depends)