]> err.no Git - dpkg/commitdiff
scripts/t: Integrate more tightly into build system
authorFrank Lichtenheld <djpig@debian.org>
Tue, 25 Sep 2007 02:07:43 +0000 (04:07 +0200)
committerFrank Lichtenheld <djpig@debian.org>
Thu, 27 Sep 2007 17:02:13 +0000 (19:02 +0200)
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.

scripts/Makefile.am
scripts/t/200_Dpkg_Shlibs.t
scripts/t/200_Dpkg_Shlibs/ld.so.conf
scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/inf_recurse.conf
scripts/t/200_Dpkg_Shlibs/ld.so.conf.d/recursive.conf

index 50f9dab6fb3d0d783087c1727c52a57fa73f9e28..4d1d97d6d6a0cd367466644d5f08bc7dd128b7ec 100644 (file)
@@ -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)
index 1163fdc3b92c34ff04bf421246a8d54112b99d5c..7a02d41f719a1b2b5015ac242c36e376bdee9c5a 100644 (file)
@@ -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;
 
index cbbf7bd987dfb1c5e29142b6e901126b2aa93b45..23861b714421011980409a60a0e8adfc722a7248 100644 (file)
@@ -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
 
index a8e88c0c22118de1be1aee5246b703d566eab7d9..d0f90f2cd7b4f837914fcde3c625d566ba2b9cda 100644 (file)
@@ -1 +1 @@
-include t/200_Dpkg_Shlibs/ld.so.conf
+include t.tmp/ld.so.conf
index 8e6fe25f45e333f5641093efd3e30837a3a83337..bcc534bcedd95df2e9979223e8a52b6fe4418efb 100644 (file)
@@ -1 +1 @@
-include t/200_Dpkg_Shlibs/ld.so.conf_2
+include t.tmp/ld.so.conf_2