From: Frank Lichtenheld Date: Tue, 25 Sep 2007 02:07:43 +0000 (+0200) Subject: scripts/t: Integrate more tightly into build system X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6432291b26a13b64293af6284796bfaff6afe38;p=dpkg scripts/t: Integrate more tightly into build system rename 'test' target to 'check' so that it gets called automatically on 'make check' and 'make distcheck'. Also make it actually working in 'distcheck'. That part is still a bit hacky. --- diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 50f9dab6..4d1d97d6 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -132,8 +132,15 @@ uninstall-local: rm -f $(DESTDIR)$(sysconfdir)/alternatives/README rm -f $(DESTDIR)$(sbindir)/install-info -TEST_FILES= t/*.t +TEST_FILES= $(srcdir)/t/*.t TEST_VERBOSE= 0 -test: - PERL_DL_NONLAZY=1 $(PERL) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '.')" $(TEST_FILES) +clean-local: + chmod -R +w t.tmp + rm -fr t.tmp + +check: $(TEST_FILES) $(wildcard $(srcdir)/t/200_Dpkg_Shlibs/ld.so.conf*) +# a bit hacky... + $(mkdir_p) t.tmp + cp -dRl $(srcdir)/t/200_Dpkg_Shlibs/ld.so.conf* t.tmp/ + srcdir=$(srcdir) PERL_DL_NONLAZY=1 $(PERL) -I$(srcdir) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '.')" $(TEST_FILES) diff --git a/scripts/t/200_Dpkg_Shlibs.t b/scripts/t/200_Dpkg_Shlibs.t index 1163fdc3..7a02d41f 100644 --- a/scripts/t/200_Dpkg_Shlibs.t +++ b/scripts/t/200_Dpkg_Shlibs.t @@ -10,7 +10,10 @@ use_ok('Dpkg::Shlibs'); my @save_paths = @Dpkg::Shlibs::librarypaths; @Dpkg::Shlibs::librarypaths = (); -Dpkg::Shlibs::parse_ldso_conf("t/200_Dpkg_Shlibs/ld.so.conf"); +my $srcdir = $ENV{srcdir} || '.'; +$srcdir .= '/t/200_Dpkg_Shlibs'; + +Dpkg::Shlibs::parse_ldso_conf("t.tmp/ld.so.conf"); use Data::Dumper; is_deeply([qw(/nonexistant32 /nonexistant/lib64 @@ -21,8 +24,8 @@ use_ok('Dpkg::Shlibs::Objdump'); my $obj = Dpkg::Shlibs::Objdump::Object->new; -open my $objdump, '<', "t/200_Dpkg_Shlibs/objdump.libc6-2.6" - or die "t/200_Dpkg_Shlibs/objdump.libc6-2.6: $!"; +open my $objdump, '<', "$srcdir/objdump.libc6-2.6" + or die "$srcdir/objdump.libc6-2.6: $!"; $obj->_parse($objdump); close $objdump; @@ -55,17 +58,17 @@ is( scalar @syms, 9, 'undefined && dynamic' ); my $obj_old = Dpkg::Shlibs::Objdump::Object->new; -open $objdump, '<', "t/200_Dpkg_Shlibs/objdump.libc6-2.3" - or die "t/200_Dpkg_Shlibs/objdump.libc6-2.3: $!"; +open $objdump, '<', "$srcdir/objdump.libc6-2.3" + or die "$srcdir/objdump.libc6-2.3: $!"; $obj_old->_parse($objdump); close $objdump; use_ok('Dpkg::Shlibs::SymbolFile'); -my $sym_file = Dpkg::Shlibs::SymbolFile->new("t/200_Dpkg_Shlibs/symbol_file.tmp"); -my $sym_file_dup = Dpkg::Shlibs::SymbolFile->new("t/200_Dpkg_Shlibs/symbol_file.tmp"); -my $sym_file_old = Dpkg::Shlibs::SymbolFile->new("t/200_Dpkg_Shlibs/symbol_file.tmp"); +my $sym_file = Dpkg::Shlibs::SymbolFile->new("$srcdir/symbol_file.tmp"); +my $sym_file_dup = Dpkg::Shlibs::SymbolFile->new("$srcdir/symbol_file.tmp"); +my $sym_file_old = Dpkg::Shlibs::SymbolFile->new("$srcdir/symbol_file.tmp"); $sym_file->merge_symbols($obj_old, "2.3.6.ds1-13"); $sym_file_old->merge_symbols($obj_old, "2.3.6.ds1-13"); @@ -92,12 +95,12 @@ my $save_file = new File::Temp; $sym_file->save($save_file->filename); $sym_file_dup->load($save_file->filename); -$sym_file_dup->{file} = "t/200_Dpkg_Shlibs/symbol_file.tmp"; +$sym_file_dup->{file} = "$srcdir/symbol_file.tmp"; is_deeply($sym_file_dup, $sym_file, 'save -> load' ); # Test include mechanism of SymbolFile -$sym_file = Dpkg::Shlibs::SymbolFile->new("t/200_Dpkg_Shlibs/symbols.include-1"); +$sym_file = Dpkg::Shlibs::SymbolFile->new("$srcdir/symbols.include-1"); $sym = $sym_file->lookup_symbol('symbol_before@Base', ['libfake.so.1']); is_deeply($sym, { 'minver' => '0.9', 'dep_id' => 0, 'deprecated' => 0, @@ -119,7 +122,7 @@ is_deeply($sym, { 'minver' => '1.1', 'dep_id' => 0, 'deprecated' => 0, 'depends' => 'libfake1 #MINVER#', 'soname' => 'libfake.so.1' }, 'overrides order with #include'); -$sym_file = Dpkg::Shlibs::SymbolFile->new("t/200_Dpkg_Shlibs/symbols.include-2"); +$sym_file = Dpkg::Shlibs::SymbolFile->new("$srcdir/symbols.include-2"); $sym = $sym_file->lookup_symbol('symbol1_fake2@Base', ['libfake.so.1']); is_deeply($sym, { 'minver' => '1.0', 'dep_id' => 1, 'deprecated' => 0, @@ -130,8 +133,8 @@ is_deeply($sym, { 'minver' => '1.0', 'dep_id' => 1, 'deprecated' => 0, # without versions and with visibility attribute) $obj = Dpkg::Shlibs::Objdump::Object->new; -open $objdump, '<', "t/200_Dpkg_Shlibs/objdump.glib-ia64" - or die "t/200_Dpkg_Shlibs/objdump.glib-ia64: $!"; +open $objdump, '<', "$srcdir/objdump.glib-ia64" + or die "$srcdir/objdump.glib-ia64: $!"; $obj->_parse($objdump); close $objdump; diff --git a/scripts/t/200_Dpkg_Shlibs/ld.so.conf b/scripts/t/200_Dpkg_Shlibs/ld.so.conf index cbbf7bd9..23861b71 100644 --- a/scripts/t/200_Dpkg_Shlibs/ld.so.conf +++ b/scripts/t/200_Dpkg_Shlibs/ld.so.conf @@ -5,5 +5,5 @@ /nonexistant/lib64 include /nonexistant/*.conf -include t/200_Dpkg_Shlibs/ld.so.conf.d/*.conf +include t.tmp/ld.so.conf.d/*.conf diff --git a/scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/inf_recurse.conf b/scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/inf_recurse.conf index a8e88c0c..d0f90f2c 100644 --- a/scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/inf_recurse.conf +++ b/scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/inf_recurse.conf @@ -1 +1 @@ -include t/200_Dpkg_Shlibs/ld.so.conf +include t.tmp/ld.so.conf diff --git a/scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/recursive.conf b/scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/recursive.conf index 8e6fe25f..bcc534bc 100644 --- a/scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/recursive.conf +++ b/scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/recursive.conf @@ -1 +1 @@ -include t/200_Dpkg_Shlibs/ld.so.conf_2 +include t.tmp/ld.so.conf_2