diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/.gitignore | 8 | ||||
-rw-r--r-- | tests/Makefile.include | 44 | ||||
-rw-r--r-- | tests/qapi-schema/include-relpath-sub.json | 2 | ||||
-rw-r--r-- | tests/qapi-schema/include-relpath.err | 0 | ||||
-rw-r--r-- | tests/qapi-schema/include-relpath.exit | 1 | ||||
-rw-r--r-- | tests/qapi-schema/include-relpath.json | 1 | ||||
-rw-r--r-- | tests/qapi-schema/include-relpath.out | 20 | ||||
-rw-r--r-- | tests/qapi-schema/include/relpath.json | 1 | ||||
-rw-r--r-- | tests/qapi-schema/include/sub-module.json | 5 | ||||
-rw-r--r-- | tests/qapi-schema/qapi-schema-test.json | 3 | ||||
-rw-r--r-- | tests/qapi-schema/qapi-schema-test.out | 9 | ||||
-rw-r--r-- | tests/qapi-schema/sub-sub-module.json | 6 |
12 files changed, 70 insertions, 30 deletions
diff --git a/tests/.gitignore b/tests/.gitignore index f2bf85c8c4..c88f8f2537 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -12,9 +12,17 @@ test-* !test-*.c !docker/test-* test-qapi-commands.[ch] +include/test-qapi-commands-sub-module.[ch] +test-qapi-commands-sub-sub-module.[ch] test-qapi-events.[ch] +include/test-qapi-events-sub-module.[ch] +test-qapi-events-sub-sub-module.[ch] test-qapi-types.[ch] +include/test-qapi-types-sub-module.[ch] +test-qapi-types-sub-sub-module.[ch] test-qapi-visit.[ch] +include/test-qapi-visit-sub-module.[ch] +test-qapi-visit-sub-sub-module.[ch] test-qapi-introspect.[ch] *-test qapi-schema/*.test.* diff --git a/tests/Makefile.include b/tests/Makefile.include index 5527581f67..97e1cb90a3 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -441,7 +441,6 @@ qapi-schema += include-format-err.json qapi-schema += include-nested-err.json qapi-schema += include-no-file.json qapi-schema += include-non-file.json -qapi-schema += include-relpath.json qapi-schema += include-repetition.json qapi-schema += include-self-cycle.json qapi-schema += include-simple.json @@ -508,8 +507,18 @@ qapi-schema += unknown-expr-key.json check-qapi-schema-y := $(addprefix tests/qapi-schema/, $(qapi-schema)) -GENERATED_FILES += tests/test-qapi-types.h tests/test-qapi-visit.h \ - tests/test-qapi-commands.h tests/test-qapi-events.h \ +GENERATED_FILES += tests/test-qapi-types.h \ + tests/include/test-qapi-types-sub-module.h \ + tests/test-qapi-types-sub-sub-module.h \ + tests/test-qapi-visit.h \ + tests/include/test-qapi-visit-sub-module.h \ + tests/test-qapi-visit-sub-sub-module.h \ + tests/test-qapi-commands.h \ + tests/include/test-qapi-commands-sub-module.h \ + tests/test-qapi-commands-sub-sub-module.h \ + tests/test-qapi-events.h \ + tests/include/test-qapi-events-sub-module.h \ + tests/test-qapi-events-sub-sub-module.h \ tests/test-qapi-introspect.h test-obj-y = tests/check-qnum.o tests/check-qstring.o tests/check-qdict.o \ @@ -537,7 +546,12 @@ QEMU_CFLAGS += -I$(SRC_PATH)/tests # Deps that are common to various different sets of tests below test-util-obj-y = libqemuutil.a test-qom-obj-y = $(qom-obj-y) $(test-util-obj-y) -test-qapi-obj-y = tests/test-qapi-visit.o tests/test-qapi-types.o \ +test-qapi-obj-y = tests/test-qapi-types.o \ + tests/include/test-qapi-types-sub-module.o \ + tests/test-qapi-types-sub-sub-module.o \ + tests/test-qapi-visit.o \ + tests/include/test-qapi-visit-sub-module.o \ + tests/test-qapi-visit-sub-sub-module.o \ tests/test-qapi-introspect.o \ $(test-qom-obj-y) benchmark-crypto-obj-y = $(authz-obj-y) $(crypto-obj-y) $(test-qom-obj-y) @@ -613,12 +627,32 @@ tests/test-replication$(EXESUF): tests/test-replication.o $(test-util-obj-y) \ $(test-block-obj-y) tests/test-qapi-types.c tests/test-qapi-types.h \ +tests/include/test-qapi-types-sub-module.c \ +tests/include/test-qapi-types-sub-module.h \ +tests/test-qapi-types-sub-sub-module.c \ +tests/test-qapi-types-sub-sub-module.h \ tests/test-qapi-visit.c tests/test-qapi-visit.h \ +tests/include/test-qapi-visit-sub-module.c \ +tests/include/test-qapi-visit-sub-module.h \ +tests/test-qapi-visit-sub-sub-module.c \ +tests/test-qapi-visit-sub-sub-module.h \ tests/test-qapi-commands.h tests/test-qapi-commands.c \ +tests/include/test-qapi-commands-sub-module.h \ +tests/include/test-qapi-commands-sub-module.c \ +tests/test-qapi-commands-sub-sub-module.h \ +tests/test-qapi-commands-sub-sub-module.c \ tests/test-qapi-events.c tests/test-qapi-events.h \ +tests/include/test-qapi-events-sub-module.c \ +tests/include/test-qapi-events-sub-module.h \ +tests/test-qapi-events-sub-sub-module.c \ +tests/test-qapi-events-sub-sub-module.h \ tests/test-qapi-introspect.c tests/test-qapi-introspect.h: \ tests/test-qapi-gen-timestamp ; -tests/test-qapi-gen-timestamp: $(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(qapi-py) +tests/test-qapi-gen-timestamp: \ + $(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json \ + $(SRC_PATH)/tests/qapi-schema/include/sub-module.json \ + $(SRC_PATH)/tests/qapi-schema/sub-sub-module.json \ + $(qapi-py) $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-gen.py \ -o tests -p "test-" $<, \ "GEN","$(@:%-timestamp=%)") diff --git a/tests/qapi-schema/include-relpath-sub.json b/tests/qapi-schema/include-relpath-sub.json deleted file mode 100644 index 4bd4af4162..0000000000 --- a/tests/qapi-schema/include-relpath-sub.json +++ /dev/null @@ -1,2 +0,0 @@ -{ 'enum': 'Status', - 'data': [ 'good', 'bad', 'ugly' ] } diff --git a/tests/qapi-schema/include-relpath.err b/tests/qapi-schema/include-relpath.err deleted file mode 100644 index e69de29bb2..0000000000 --- a/tests/qapi-schema/include-relpath.err +++ /dev/null diff --git a/tests/qapi-schema/include-relpath.exit b/tests/qapi-schema/include-relpath.exit deleted file mode 100644 index 573541ac97..0000000000 --- a/tests/qapi-schema/include-relpath.exit +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/tests/qapi-schema/include-relpath.json b/tests/qapi-schema/include-relpath.json deleted file mode 100644 index 05018f3908..0000000000 --- a/tests/qapi-schema/include-relpath.json +++ /dev/null @@ -1 +0,0 @@ -{ 'include': 'include/relpath.json' } diff --git a/tests/qapi-schema/include-relpath.out b/tests/qapi-schema/include-relpath.out deleted file mode 100644 index cf8636b78f..0000000000 --- a/tests/qapi-schema/include-relpath.out +++ /dev/null @@ -1,20 +0,0 @@ -module None -object q_empty -enum QType - prefix QTYPE - member none - member qnull - member qnum - member qstring - member qdict - member qlist - member qbool -module include-relpath.json -include include/relpath.json -module include/relpath.json -include include-relpath-sub.json -module include-relpath-sub.json -enum Status - member good - member bad - member ugly diff --git a/tests/qapi-schema/include/relpath.json b/tests/qapi-schema/include/relpath.json deleted file mode 100644 index 45dee24704..0000000000 --- a/tests/qapi-schema/include/relpath.json +++ /dev/null @@ -1 +0,0 @@ -{ 'include': '../include-relpath-sub.json' } diff --git a/tests/qapi-schema/include/sub-module.json b/tests/qapi-schema/include/sub-module.json new file mode 100644 index 0000000000..f2bdbd3990 --- /dev/null +++ b/tests/qapi-schema/include/sub-module.json @@ -0,0 +1,5 @@ +# *-*- Mode: Python -*-* + +# Sub-module of ../qapi-schema-test.json + +{ 'include': '../sub-sub-module.json' } diff --git a/tests/qapi-schema/qapi-schema-test.json b/tests/qapi-schema/qapi-schema-test.json index 70612f394e..1f130a0491 100644 --- a/tests/qapi-schema/qapi-schema-test.json +++ b/tests/qapi-schema/qapi-schema-test.json @@ -130,6 +130,9 @@ 'sizes': ['size'], 'any': ['any'] } } +# for testing sub-modules +{ 'include': 'include/sub-module.json' } + # testing commands { 'command': 'user_def_cmd', 'data': {} } { 'command': 'user_def_cmd1', 'data': {'ud1a': 'UserDefOne'} } diff --git a/tests/qapi-schema/qapi-schema-test.out b/tests/qapi-schema/qapi-schema-test.out index 97f671ca5f..baba4c8384 100644 --- a/tests/qapi-schema/qapi-schema-test.out +++ b/tests/qapi-schema/qapi-schema-test.out @@ -176,6 +176,15 @@ object UserDefNativeListUnion case string: q_obj_strList-wrapper case sizes: q_obj_sizeList-wrapper case any: q_obj_anyList-wrapper +include include/sub-module.json +module include/sub-module.json +include sub-sub-module.json +module sub-sub-module.json +enum Status + member good + member bad + member ugly +module qapi-schema-test.json command user_def_cmd None -> None gen=True success_response=True boxed=False oob=False preconfig=False object q_obj_user_def_cmd1-arg diff --git a/tests/qapi-schema/sub-sub-module.json b/tests/qapi-schema/sub-sub-module.json new file mode 100644 index 0000000000..524ef9b83f --- /dev/null +++ b/tests/qapi-schema/sub-sub-module.json @@ -0,0 +1,6 @@ +# *-*- Mode: Python -*-* + +# Sub-module of sub-module include/sub-module.json of qapi-schema-test.json + +{ 'enum': 'Status', + 'data': [ 'good', 'bad', 'ugly' ] } |