[libgsf] Tests: test a bunch of stuff with valgrind
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgsf] Tests: test a bunch of stuff with valgrind
- Date: Tue, 2 Dec 2014 01:08:04 +0000 (UTC)
commit 157a208d5b23f804fe3088a7f8aae2efc4117839
Author: Morten Welinder <terra gnome org>
Date: Mon Dec 1 20:06:36 2014 -0500
Tests: test a bunch of stuff with valgrind
tests/LibGsfTest.pm | 4 +-
tests/Makefile.am | 2 +
tests/common.supp | 98 +++++++++++++++++++++++++++++++++++++++++++
tests/t8000-valgrind-zip.pl | 19 ++++++++
tests/t8020-valgrind-ole.pl | 19 ++++++++
tests/t8040-valgrind-tar.pl | 24 ++++++++++
6 files changed, 164 insertions(+), 2 deletions(-)
---
diff --git a/tests/LibGsfTest.pm b/tests/LibGsfTest.pm
index 103e06d..af1e983 100644
--- a/tests/LibGsfTest.pm
+++ b/tests/LibGsfTest.pm
@@ -8,7 +8,7 @@ use XML::Parser;
$| = 1;
@LibGsfTest::ISA = qw (Exporter);
- LibGsfTest::EXPORT = qw(message
+ LibGsfTest::EXPORT = qw(message test_valgrind
test_zip
$topsrc $top_builddir
$gsf $PERL);
@@ -185,7 +185,7 @@ sub test_valgrind {
$cmd = "--gen-suppressions=all $cmd";
{
- my $suppfile = "$topsrc/test/common.supp";
+ my $suppfile = "$topsrc/tests/common.supp";
&report_skip ("file $suppfile does not exist") unless -r $suppfile;
$cmd = "--suppressions=$suppfile $cmd" if -r $suppfile;
}
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 30b6ec0..e26aca5 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -16,6 +16,8 @@ TESTS = t1000-zip-single.pl \
t1001-zip-multiple.pl \
t1002-zip-aaaa.pl \
t1003-zip-noise.pl \
+ t8000-valgrind-zip.pl \
+ t8020-valgrind-ole.pl \
t9999-epilogue.pl
SUPPS = common.supp
diff --git a/tests/common.supp b/tests/common.supp
index 6896188..234fead 100644
--- a/tests/common.supp
+++ b/tests/common.supp
@@ -1,3 +1,101 @@
# -----------------------------------------------------------------------------
# Valgrind suppressions for tests
# -----------------------------------------------------------------------------
+
+{
+ Leak/g_type_register_fundamental
+ Memcheck:Leak
+ ...
+ fun:g_type_register_fundamental
+}
+
+{
+ Leak/g_type_register_static
+ Memcheck:Leak
+ ...
+ fun:g_type_register_static
+}
+
+{
+ Leak/g_type_add_interface_static
+ Memcheck:Leak
+ ...
+ fun:g_type_add_interface_static
+}
+
+{
+ Leak/g_type_add_interface_dynamic
+ Memcheck:Leak
+ ...
+ fun:g_type_add_interface_dynamic
+}
+
+{
+ Leak/g_type_register_dynamic
+ Memcheck:Leak
+ ...
+ fun:g_type_register_dynamic
+}
+
+{
+ GLIB/IDLE_CLOSURE_LEAK1
+ Memcheck:Leak
+ fun:calloc
+ fun:g_malloc0
+ fun:g_closure_new_simple
+ ...
+ fun:complete_in_idle_cb
+}
+
+{
+ GLIB/IDLE_CLOSURE_LEAK2
+ Memcheck:Leak
+ fun:malloc
+ fun:realloc
+ fun:g_realloc
+ fun:g_closure_add_invalidate_notifier
+ fun:g_source_set_closure
+ ...
+ fun:complete_in_idle_cb
+}
+
+{
+ Leak/g_type_class_ref1
+ Memcheck:Leak
+ fun:malloc
+ ...
+ fun:g_type_class_ref
+}
+
+{
+ Leak/g_type_class_ref2
+ Memcheck:Leak
+ fun:calloc
+ ...
+ fun:g_type_class_ref
+}
+
+{
+ GLIBC/DL_INIT/MLK
+ Memcheck:Leak
+ fun:calloc
+ fun:g_malloc0
+ ...
+ fun:call_init.part.0
+ fun:_dl_init
+}
+
+{
+ GLIB/G_FILE_READ_LINK
+ Memcheck:Leak
+ fun:malloc
+ fun:g_malloc
+ fun:g_file_read_link
+}
+
+{
+ GLIBC/thread2/MLK
+ Memcheck:Leak
+ ...
+ fun:g_thread_new
+}
diff --git a/tests/t8000-valgrind-zip.pl b/tests/t8000-valgrind-zip.pl
new file mode 100755
index 0000000..e352ace
--- /dev/null
+++ b/tests/t8000-valgrind-zip.pl
@@ -0,0 +1,19 @@
+#!/usr/bin/perl -w
+# -----------------------------------------------------------------------------
+
+use strict;
+use lib ($0 =~ m|^(.*/)| ? $1 : ".");
+use LibGsfTest;
+
+my $archive = "test.zip";
+&LibGsfTest::junkfile ($archive);
+
+my @files = ('Makefile.am', 'common.supp');
+
+print STDERR "Testing zip write\n";
+&test_valgrind ("$gsf createzip $archive @files", 1);
+print STDERR "\n";
+
+print STDERR "Testing zip read\n";
+&test_valgrind ("$gsf list $archive >/dev/null", 1);
+print STDERR "\n";
diff --git a/tests/t8020-valgrind-ole.pl b/tests/t8020-valgrind-ole.pl
new file mode 100755
index 0000000..f4e79da
--- /dev/null
+++ b/tests/t8020-valgrind-ole.pl
@@ -0,0 +1,19 @@
+#!/usr/bin/perl -w
+# -----------------------------------------------------------------------------
+
+use strict;
+use lib ($0 =~ m|^(.*/)| ? $1 : ".");
+use LibGsfTest;
+
+my $archive = "test.ole";
+&LibGsfTest::junkfile ($archive);
+
+my @files = ('Makefile.am', 'common.supp');
+
+print STDERR "Testing ole write\n";
+&test_valgrind ("$gsf createole $archive @files", 1);
+print STDERR "\n";
+
+print STDERR "Testing ole read\n";
+&test_valgrind ("$gsf list $archive >/dev/null", 1);
+print STDERR "\n";
diff --git a/tests/t8040-valgrind-tar.pl b/tests/t8040-valgrind-tar.pl
new file mode 100755
index 0000000..3dd0ad4
--- /dev/null
+++ b/tests/t8040-valgrind-tar.pl
@@ -0,0 +1,24 @@
+#!/usr/bin/perl -w
+# -----------------------------------------------------------------------------
+
+use strict;
+use lib ($0 =~ m|^(.*/)| ? $1 : ".");
+use LibGsfTest;
+
+my $archive = "test.tar";
+&LibGsfTest::junkfile ($archive);
+
+my @files = ('Makefile.am', 'common.supp');
+
+if (0) {
+ print STDERR "Testing tar write\n";
+ &test_valgrind ("$gsf createole $archive @files", 1);
+ print STDERR "\n";
+} else {
+ # We don't have the tar write side, so use plain tar
+ system ("tar", "cf", $archive, @files);
+}
+
+print STDERR "Testing tar read\n";
+&test_valgrind ("$gsf list $archive >/dev/null", 1);
+print STDERR "\n";
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]