qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: aliguori@linux.vnet.ibm.com, agl@linux.vnet.ibm.com,
	mdroth@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH 8/9] qapi: Makefile, build test-visiter with generated test code
Date: Fri, 29 Apr 2011 10:22:01 -0500	[thread overview]
Message-ID: <1304090522-5861-9-git-send-email-mdroth@linux.vnet.ibm.com> (raw)
In-Reply-To: <1304090522-5861-1-git-send-email-mdroth@linux.vnet.ibm.com>

This pulls in test-qapi-visit.c/.h and test-qapi-types.h, which are
generated from qapi-schema-test.json using the --prefix arguments for
the various code generators. Useful for targetted testing of the schema
parser/code generators.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 Makefile |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index d510779..d05cf74 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 # Makefile for QEMU.
 
 GENERATED_HEADERS = config-host.h trace.h qemu-options.def qmp.h libqmp.h qdev-marshal.h
-GENERATED_HEADERS += qapi-types.h qmp-marshal-types.h qcfg-marshal.h
+GENERATED_HEADERS += qapi-types.h qmp-marshal-types.h qcfg-marshal.h test-qapi-types.h
 ifeq ($(TRACE_BACKEND),dtrace)
 GENERATED_HEADERS += trace-dtrace.h
 endif
@@ -72,7 +72,7 @@ defconfig:
 
 -include config-all-devices.mak
 
-TOOLS += test-libqmp test-qcfg qsh
+TOOLS += test-libqmp test-qcfg qsh test-visiter
 
 build-all: $(DOCS) $(TOOLS) recurse-all
 
@@ -109,6 +109,9 @@ QEMU_CFLAGS+=$(CURL_CFLAGS)
 
 QEMU_CFLAGS+=$(GLIB_CFLAGS)
 
+QEMU_CFLAGS+="-I."
+QEMU_CFLAGS+="-Iqapi"
+
 ui/cocoa.o: ui/cocoa.m
 
 ui/sdl.o audio/sdlaudio.o ui/sdl_zoom.o baum.o: QEMU_CFLAGS += $(SDL_CFLAGS)
@@ -252,7 +255,13 @@ test-qcfg: test-qcfg.o $(QCFG_OBJS) qemu-timer-common.o
 
 qapi-obj-y := qapi/qmp-output-visiter.o qapi/qmp-input-visiter.o
 
-test-visiter: test-visiter.o qfloat.o qint.o qdict.o qstring.o qlist.o qbool.o $(qapi-obj-y) error.o osdep.o qemu-malloc.o $(oslib-obj-y) qjson.o json-streamer.o json-lexer.o json-parser.o qerror.o
+test-qapi-types.h: $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py
+	$(call quiet-command,python $(SRC_PATH)/scripts/qapi-types.py --prefix="test-" < $<, "  GEN   $@")
+test-qapi-visit.c: test-qapi-visit.h
+test-qapi-visit.h: $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-visit.py
+	$(call quiet-command,python $(SRC_PATH)/scripts/qapi-visit.py --prefix="test-" < $<, "  GEN   $@")
+test-visiter.o: test-qapi-types.h test-qapi-visit.c
+test-visiter: test-visiter.o qfloat.o qint.o qdict.o qstring.o qlist.o qbool.o $(qapi-obj-y) error.o osdep.o qemu-malloc.o $(oslib-obj-y) qjson.o json-streamer.o json-lexer.o json-parser.o qerror.o test-qapi-visit.o
 
 qmp-check: build-all
 	$(call quiet-command, ./test-libqmp, "  CHECK   $@")
-- 
1.7.0.4

  parent reply	other threads:[~2011-04-29 15:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-29 15:21 [Qemu-devel] [PULL] QAPI code generator fix-ups Michael Roth
2011-04-29 15:21 ` [Qemu-devel] [PATCH 1/9] qapi: Fix type generator for structured type members Michael Roth
2011-04-29 15:21 ` [Qemu-devel] [PATCH 2/9] qapi: input visiter, don't always allocate memory for structs Michael Roth
2011-04-29 15:21 ` [Qemu-devel] [PATCH 3/9] qapi: Fix visiter generator for nested structs/qobjects Michael Roth
2011-04-29 15:21 ` [Qemu-devel] [PATCH 4/9] qapi: some basename/guardname py utility functions Michael Roth
2011-04-29 15:21 ` [Qemu-devel] [PATCH 5/9] qapi: add --prefix option to type generator Michael Roth
2011-04-29 15:21 ` [Qemu-devel] [PATCH 6/9] qapi: add --prefix option for visiter generator Michael Roth
2011-04-29 15:22 ` [Qemu-devel] [PATCH 7/9] qapi: test schema for test-visiter unit tests Michael Roth
2011-04-29 15:22 ` Michael Roth [this message]
2011-04-29 15:22 ` [Qemu-devel] [PATCH 9/9] qapi: test-visiter, pull in gen code, tests for nested structures Michael Roth

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=1304090522-5861-9-git-send-email-mdroth@linux.vnet.ibm.com \
    --to=mdroth@linux.vnet.ibm.com \
    --cc=agl@linux.vnet.ibm.com \
    --cc=aliguori@linux.vnet.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).