summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-11-29 12:52:15 +0000
committerRichard W.M. Jones <rjones@redhat.com>2011-11-29 12:52:15 +0000
commitaa4eb4cd109dda0dc7dfdd66a5163a18b0be2277 (patch)
tree6cea41fe1e3acb5fa4960cecee1380ba407287f3
parent6ccae55ddcf0c08cd1b1cdbc07afeed043ad410d (diff)
downloadlibguestfs-aa4eb4cd109dda0dc7dfdd66a5163a18b0be2277.tar.gz
libguestfs-aa4eb4cd109dda0dc7dfdd66a5163a18b0be2277.tar.xz
libguestfs-aa4eb4cd109dda0dc7dfdd66a5163a18b0be2277.zip
extra tests: Run OCaml tests under valgrind.
-rw-r--r--extratests/Makefile.am11
-rw-r--r--extratests/suppressions32
2 files changed, 41 insertions, 2 deletions
diff --git a/extratests/Makefile.am b/extratests/Makefile.am
index a3b9a2f0..739f1c2a 100644
--- a/extratests/Makefile.am
+++ b/extratests/Makefile.am
@@ -42,7 +42,11 @@ GUESTS = $(shell virsh -c $(LIBVIRT_DEFAULT_URI) list --all | \
tail -n +3 | \
awk '{print $$2}')
-extra-tests: test-tools-null test-tools-internal test-tools-real
+extra-tests: \
+ test-tools-null \
+ test-tools-internal \
+ test-tools-real \
+ test-ocaml
# Null invocations of the basic tools shouldn't leak memory.
test-tools-null:
@@ -92,7 +96,6 @@ test-tools-real:
if [ $$r -ne 0 ]; then exit $$r; fi; \
done
-
# XXX Not tested:
# ../clone/virt-sysprep
# ../edit/virt-edit
@@ -102,3 +105,7 @@ test-tools-real:
# ../sparsify/virt-sparsify (OCaml)
# ../tools/virt-win-reg (Perl)
# ../tools/virt-make-fs (Perl)
+
+# Test OCaml bindings under valgrind.
+test-ocaml:
+ $(MAKE) -C ../ocaml VG="$(VG)" check
diff --git a/extratests/suppressions b/extratests/suppressions
index c5738547..97d4b789 100644
--- a/extratests/suppressions
+++ b/extratests/suppressions
@@ -58,3 +58,35 @@
fun:calloc
obj:/usr/lib/libnl.so.1.1
}
+
+# OCaml, by design, doesn't bother to free the major heap before
+# calling exit. Ignore that leak.
+{
+ ocaml_heap_leak
+ Memcheck:Leak
+ ...
+ fun:caml_alloc_for_heap
+}
+# On the other hand, these seem to be a real bugs in OCaml:
+{
+ ocaml_heap_leak_2
+ Memcheck:Leak
+ fun:malloc
+ fun:caml_thread_new_descriptor
+ fun:caml_thread_new
+}
+{
+ ocaml_heap_leak_3
+ Memcheck:Leak
+ fun:malloc
+ fun:caml_thread_new_descriptor
+ fun:caml_thread_initialize
+}
+{
+ ocaml_heap_leak_4
+ Memcheck:Leak
+ ...
+ fun:pthread_create*
+ ...
+ fun:caml_thread_new
+}