Patchwork [10/15] test: eliminate libcheck tests and have make check use gtester

login
register
mail settings
Submitter Anthony Liguori
Date Jan. 10, 2012, 7:10 p.m.
Message ID <1326222656-26588-10-git-send-email-aliguori@us.ibm.com>
Download mbox | patch
Permalink /patch/135286/
State New
Headers show

Comments

Anthony Liguori - Jan. 10, 2012, 7:10 p.m.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 Makefile       |    4 ++--
 configure      |   32 --------------------------------
 tests/Makefile |   11 ++++++-----
 3 files changed, 8 insertions(+), 39 deletions(-)
Eduardo Habkost - Jan. 12, 2012, 12:17 p.m.
On Tue, Jan 10, 2012 at 01:10:51PM -0600, Anthony Liguori wrote:
[...]
> @@ -733,10 +732,6 @@ for opt do
>    ;;
>    --enable-fdt) fdt="yes"
>    ;;
> -  --disable-check-utests) check_utests="no"
> -  ;;
> -  --enable-check-utests) check_utests="yes"
> -  ;;
>    --disable-nptl) nptl="no"
>    ;;
>    --enable-nptl) nptl="yes"

You forgot to remove this:

@@ -2825,7 +2825,6 @@ fi
 echo "SDL support       $sdl"
 echo "curses support    $curses"
 echo "curl support      $curl"
-echo "check support     $check_utests"
 echo "mingw32 support   $mingw32"
 echo "Audio drivers     $audio_drv_list"
 echo "Extra audio cards $audio_card_list"
Markus Armbruster - Jan. 13, 2012, 10:58 a.m.
Deserves more prominent notice, so here goes:

Anthony Liguori <aliguori@us.ibm.com> writes:

[...]
> @@ -733,10 +732,6 @@ for opt do
>    ;;
>    --enable-fdt) fdt="yes"
>    ;;
> -  --disable-check-utests) check_utests="no"
> -  ;;
> -  --enable-check-utests) check_utests="yes"
> -  ;;
>    --disable-nptl) nptl="no"
>    ;;
>    --enable-nptl) nptl="yes"

Just drop the option from your configure command line.

[...]

Patch

diff --git a/Makefile b/Makefile
index 4823144..e2ec3d6 100644
--- a/Makefile
+++ b/Makefile
@@ -77,7 +77,7 @@  defconfig:
 
 -include config-all-devices.mak
 
-build-all: $(DOCS) $(TOOLS) $(CHECKS) recurse-all
+build-all: $(DOCS) $(TOOLS) recurse-all
 
 config-host.h: config-host.h-timestamp
 config-host.h-timestamp: config-host.mak
@@ -204,7 +204,7 @@  clean:
 # avoid old build problems by removing potentially incorrect old files
 	rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
 	rm -f qemu-options.def
-	rm -f *.o *.d *.a *.lo $(TOOLS) $(CHECKS) qemu-ga TAGS cscope.* *.pod *~ */*~
+	rm -f *.o *.d *.a *.lo $(TOOLS) qemu-ga TAGS cscope.* *.pod *~ */*~
 	rm -Rf .libs
 	rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d block/*.o block/*.d net/*.o net/*.d fsdev/*.o fsdev/*.d ui/*.o ui/*.d qapi/*.o qapi/*.d qga/*.o qga/*.d
 	rm -f qemu-img-cmds.h
diff --git a/configure b/configure
index b2e622c..b79289c 100755
--- a/configure
+++ b/configure
@@ -176,7 +176,6 @@  mixemu="no"
 aix="no"
 blobs="yes"
 pkgversion=""
-check_utests=""
 pie=""
 zero_malloc=""
 trace_backend="nop"
@@ -733,10 +732,6 @@  for opt do
   ;;
   --enable-fdt) fdt="yes"
   ;;
-  --disable-check-utests) check_utests="no"
-  ;;
-  --enable-check-utests) check_utests="yes"
-  ;;
   --disable-nptl) nptl="no"
   ;;
   --enable-nptl) nptl="yes"
@@ -1014,8 +1009,6 @@  echo "  --disable-curl           disable curl connectivity"
 echo "  --enable-curl            enable curl connectivity"
 echo "  --disable-fdt            disable fdt device tree"
 echo "  --enable-fdt             enable fdt device tree"
-echo "  --disable-check-utests   disable check unit-tests"
-echo "  --enable-check-utests    enable check unit-tests"
 echo "  --disable-bluez          disable bluez stack connectivity"
 echo "  --enable-bluez           enable bluez stack connectivity"
 echo "  --disable-slirp          disable SLIRP userspace network connectivity"
@@ -1923,26 +1916,6 @@  EOF
 fi # test "$curl"
 
 ##########################################
-# check framework probe
-
-if test "$check_utests" != "no" ; then
-  cat > $TMPC << EOF
-#include <check.h>
-int main(void) { suite_create("qemu test"); return 0; }
-EOF
-  check_libs=`$pkg_config --libs check 2>/dev/null`
-  if compile_prog "" $check_libs ; then
-    check_utests=yes
-    libs_tools="$check_libs $libs_tools"
-  else
-    if test "$check_utests" = "yes" ; then
-      feature_not_found "check"
-    fi
-    check_utests=no
-  fi
-fi # test "$check_utests"
-
-##########################################
 # bluez support probe
 if test "$bluez" != "no" ; then
   cat > $TMPC << EOF
@@ -2799,10 +2772,6 @@  if test "$softmmu" = yes ; then
     if [ "$guest_agent" = "yes" ]; then
       tools="qemu-ga\$(EXESUF) $tools"
     fi
-    if [ "$check_utests" = "yes" ]; then
-      checks="$checks"
-    fi
-    test_progs="$checks check-qdict check-qfloat check-qint check-qstring check-qlist check-qjson test-coroutine test-qmp-output-visitor test-qmp-input-visitor"
   fi
 fi
 
@@ -3274,7 +3243,6 @@  if test "$trace_default" = "yes"; then
 fi
 
 echo "TOOLS=$tools" >> $config_host_mak
-echo "CHECKS=$test_progs" >> $config_host_mak
 echo "ROMS=$roms" >> $config_host_mak
 echo "MAKE=$make" >> $config_host_mak
 echo "INSTALL=$install" >> $config_host_mak
diff --git a/tests/Makefile b/tests/Makefile
index cff9ff3..1105004 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,3 +1,7 @@ 
+CHECKS = check-qdict check-qfloat check-qint check-qstring check-qlist
+CHECKS += check-qjson test-qmp-output-visitor test-qmp-input-visitor
+CHECKS += test-coroutine
+
 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)
@@ -30,8 +34,5 @@  test-qmp-commands.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types
 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
 
 .PHONY: check
-check: $(patsubst %,run-check-%,$(CHECKS))
-
-run-check-%: %
-	./$<
-
+check: $(CHECKS)
+	gtester $(CHECKS)