Skip to contentSkip to conversation

w32: Support tests (make check)

PATCH Superseded Stefan Weil 4 participants 5 messages Mar 14, 2012

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 w32: Support tests (make check)

Adding $(EXESUF) is needed to make those tests work on w32 hosts, too.

v2:
Rebased, added new tests, tests sorted alphabetically.

v3:
Rebased, $(EXESUF) for qemu-img, qemu-io which were recently added.

Cc Anthony Liguori <[email protected]>
Cc Kevin Wolf <[email protected]>
Cc Andreas Färber <[email protected]>

---

This is the 3rd version of my patch. The 1st was sent in February, and since then some other newer (!) patches were committed, so I had to rebase my patch two times.

Just to avoid misunderstandings: it's a patch for the test maintainer (Anthony?), not for the w32 maintainer (me), so I don't send a pull request. As far as I understood Anthony, it was in his queue, but obviously it got lost there. Maybe it's possible to commit it now.

Andreas, I added your reviewed-by from v2. v3 includes additional changes, so could you please check that the reviewed-by is still valid?

Cheers,
Stefan W.

 tests/Makefile |   40 ++++++++++++++++++++++++----------------
 1 files changed, 24 insertions(+), 16 deletions(-)
tests/Makefile +24 -16
index c78ade1..43f4f24 100644
@@ -1,19 +1,27 @@
 export SRC_PATH
 
-CHECKS = check-qdict check-qfloat check-qint check-qstring check-qlist
-CHECKS += check-qjson test-qmp-output-visitor test-qmp-input-visitor
-CHECKS += test-string-input-visitor test-string-output-visitor test-coroutine
+CHECKS = check-qdict$(EXESUF)
+CHECKS += check-qfloat$(EXESUF)
+CHECKS += check-qint$(EXESUF)
+CHECKS += check-qjson$(EXESUF)
+CHECKS += check-qlist$(EXESUF)
+CHECKS += check-qstring$(EXESUF)
+CHECKS += test-coroutine$(EXESUF)
+CHECKS += test-qmp-input-visitor$(EXESUF)
+CHECKS += test-qmp-output-visitor$(EXESUF)
+CHECKS += test-string-input-visitor$(EXESUF)
+CHECKS += test-string-output-visitor$(EXESUF)
 CHECKS += $(SRC_PATH)/tests/qemu-iotests-quick.sh
 
 check-qint.o check-qstring.o check-qdict.o check-qlist.o check-qfloat.o check-qjson.o test-coroutine.o: $(GENERATED_HEADERS)
 
-check-qint: check-qint.o qint.o $(tools-obj-y)
-check-qstring: check-qstring.o qstring.o $(tools-obj-y)
-check-qdict: check-qdict.o qdict.o qfloat.o qint.o qstring.o qbool.o qlist.o $(tools-obj-y)
-check-qlist: check-qlist.o qlist.o qint.o $(tools-obj-y)
-check-qfloat: check-qfloat.o qfloat.o $(tools-obj-y)
-check-qjson: check-qjson.o $(qobject-obj-y) $(tools-obj-y)
-test-coroutine: test-coroutine.o qemu-timer-common.o async.o $(coroutine-obj-y) $(tools-obj-y)
+check-qint$(EXESUF): check-qint.o qint.o $(tools-obj-y)
+check-qstring$(EXESUF): check-qstring.o qstring.o $(tools-obj-y)
+check-qdict$(EXESUF): check-qdict.o qdict.o qfloat.o qint.o qstring.o qbool.o qlist.o $(tools-obj-y)
+check-qlist$(EXESUF): check-qlist.o qlist.o qint.o $(tools-obj-y)
+check-qfloat$(EXESUF): check-qfloat.o qfloat.o $(tools-obj-y)
+check-qjson$(EXESUF): check-qjson.o $(qobject-obj-y) $(tools-obj-y)
+test-coroutine$(EXESUF): test-coroutine.o qemu-timer-common.o async.o $(coroutine-obj-y) $(tools-obj-y)
 
 test-qmp-input-visitor.o test-qmp-output-visitor.o \
 test-string-input-visitor.o test-string-output-visitor.o \
@@ -31,21 +39,21 @@ $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py
 
 
 test-string-output-visitor.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types.h test-qapi-visit.c test-qapi-visit.h) $(qapi-obj-y)
-test-string-output-visitor: test-string-output-visitor.o $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o
+test-string-output-visitor$(EXESUF): test-string-output-visitor.o $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o
 
 test-string-input-visitor.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types.h test-qapi-visit.c test-qapi-visit.h) $(qapi-obj-y)
-test-string-input-visitor: test-string-input-visitor.o $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o
+test-string-input-visitor$(EXESUF): test-string-input-visitor.o $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o
 
 test-qmp-output-visitor.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types.h test-qapi-visit.c test-qapi-visit.h) $(qapi-obj-y)
-test-qmp-output-visitor: test-qmp-output-visitor.o $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o
+test-qmp-output-visitor$(EXESUF): test-qmp-output-visitor.o $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o
 
 test-qmp-input-visitor.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types.h test-qapi-visit.c test-qapi-visit.h) $(qapi-obj-y)
-test-qmp-input-visitor: test-qmp-input-visitor.o $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o
+test-qmp-input-visitor$(EXESUF): test-qmp-input-visitor.o $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o
 
 test-qmp-commands.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types.h test-qapi-visit.c test-qapi-visit.h test-qmp-marshal.c test-qmp-commands.h) $(qapi-obj-y)
-test-qmp-commands: test-qmp-commands.o $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o $(qapi-dir)/test-qmp-marshal.o module.o
+test-qmp-commands$(EXESUF): test-qmp-commands.o $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o $(qapi-dir)/test-qmp-marshal.o module.o
 
-$(SRC_PATH)/tests/qemu-iotests-quick.sh: qemu-img qemu-io
+$(SRC_PATH)/tests/qemu-iotests-quick.sh: qemu-img$(EXESUF) qemu-io$(EXESUF)
 
 
 .PHONY: check check-block
Signature · 1 line
1.7.9
#1 lore raw

Am 14.03.2012 07:44, schrieb Stefan Weil:

Quoted 7 lines

Adding $(EXESUF) is needed to make those tests work on w32 hosts, too.

v2:
Rebased, added new tests, tests sorted alphabetically.

v3:
Rebased, $(EXESUF) for qemu-img, qemu-io which were recently added.

I have no idea if there's any chance of qemu-iotests successfully on win32, but in order to make it actually run I think you would have to change the file names in tests/qemu-iotests-quick.sh as well.

Kevin

#2 lore raw

Il 14/03/2012 10:10, Kevin Wolf ha scritto:

Quoted 3 lines

I have no idea if there's any chance of qemu-iotests successfully on win32, but in order to make it actually run I think you would have to change the file names in tests/qemu-iotests-quick.sh as well.

I think the shell is able to add the suffix automatically, it's just make that needs it explicitly.

Paolo

#3 lore raw

Am 14.03.2012 14:39, schrieb Paolo Bonzini:

Quoted 9 lines

Il 14/03/2012 10:10, Kevin Wolf ha scritto:

Quoted 3 lines

I have no idea if there's any chance of qemu-iotests successfully on win32, but in order to make it actually run I think you would have to change the file names in tests/qemu-iotests-quick.sh as well.

I think the shell is able to add the suffix automatically, it's just make that needs it explicitly.

Paolo

Yes, tests/qemu-iotests-quick.sh does not need a patch to run the iotests on w32 or w64.

There are some other issues to solve for MinGW based hosts:

* hostname does not support -s (is this option really needed?)

* there is no bc command (maybe the shell would be enough)

* TEST_DIR must not be an absolute path

* qemu-io does not read from stdin

* wrong order of arguments to qemu-io -c write, read

* other small issues

All these points can be fixed, and I already did run some of the tests.

The patch here only fixes make. Without it, make fails with linker errors.

Regards,
Stefan W.

Reviewed-by on v3 1/1
#4 lore raw
In reply to Stefan Weil

Am 14.03.2012 07:44, schrieb Stefan Weil:

Quoted 18 lines

Adding $(EXESUF) is needed to make those tests work on w32 hosts, too.

v2:
Rebased, added new tests, tests sorted alphabetically.

v3:
Rebased, $(EXESUF) for qemu-img, qemu-io which were recently added.

Cc Anthony Liguori <[email protected]>
Cc Kevin Wolf <[email protected]>
Cc Andreas Färber <[email protected]>

---

This is the 3rd version of my patch. The 1st was sent in February, and since then some other newer (!) patches were committed, so I had to rebase my patch two times.

[...]

Quoted 2 lines

Andreas, I added your reviewed-by from v2. v3 includes additional changes, so could you please check that the reviewed-by is still valid?

Apart from what Kevin pointed out, adding $(EXESUF) and shortening the lines still looks good to me, so in case you want this as an intermediate step,

Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg