diff options
Diffstat (limited to 't')
-rwxr-xr-x | t/buildsystems/03-bs-auto-buildable.t | 4 | ||||
-rwxr-xr-x | t/buildsystems/buildsystem_tests.t | 2 | ||||
-rwxr-xr-x | t/override_target.t | 3 | ||||
-rwxr-xr-x | t/size.t | 3 | ||||
-rwxr-xr-x | t/syntax/syntax-progs.t | 8 |
5 files changed, 14 insertions, 6 deletions
diff --git a/t/buildsystems/03-bs-auto-buildable.t b/t/buildsystems/03-bs-auto-buildable.t index 77845ced..b2c82e26 100755 --- a/t/buildsystems/03-bs-auto-buildable.t +++ b/t/buildsystems/03-bs-auto-buildable.t @@ -59,7 +59,9 @@ my %options = ( 'sourcedir' => $sourcedir, ); make_path($sourcedir, $builddir); -my @bs = load_all_buildsystems([ $Test::DH::ROOT_DIR ], %options); +use Config; +my $libpath = $ENV{AUTOPKGTEST_TMP} ? $Config{vendorlib} : $Test::DH::ROOT_DIR; +my @bs = load_all_buildsystems([ $libpath ], %options); my %bs; my @names = map { $_->NAME() } @bs; diff --git a/t/buildsystems/buildsystem_tests.t b/t/buildsystems/buildsystem_tests.t index aae80877..ac39b6d9 100755 --- a/t/buildsystems/buildsystem_tests.t +++ b/t/buildsystems/buildsystem_tests.t @@ -17,7 +17,7 @@ use_ok( 'Debian::Debhelper::Dh_Lib' ); use_ok( 'Debian::Debhelper::Buildsystem' ); use_ok( 'Debian::Debhelper::Dh_Buildsystems' ); -my $TOPDIR = "../.."; +my $TOPDIR = $ENV{AUTOPKGTEST_TMP} ? '/usr/bin' : '../..'; my @STEPS = qw(configure build test install clean); my $BS_CLASS = 'Debian::Debhelper::Buildsystem'; diff --git a/t/override_target.t b/t/override_target.t index b56c9862..2ef0baa3 100755 --- a/t/override_target.t +++ b/t/override_target.t @@ -8,10 +8,11 @@ plan(tests => 1); system("mkdir -p t/tmp/debian"); system("cp debian/control debian/compat debian/changelog t/tmp/debian"); open (OUT, ">", "t/tmp/debian/rules") || die "$!"; +my $binpath = $ENV{AUTOPKGTEST_TMP} ? '/usr/bin' : '../..'; print OUT <<EOF; #!/usr/bin/make -f %: - PATH=../..:\$\$PATH PERL5LIB=../.. ../../dh \$@ --without autoreconf + PATH=../..:\$\$PATH PERL5LIB=../.. $binpath/dh \$@ --without autoreconf override_dh_update_autotools_config override_dh_strip_nondeterminism: @@ -7,7 +7,8 @@ use strict; use warnings; use Test::More; -my @progs=grep { -x $_ } glob("dh_*"); +my $binpath = $ENV{AUTOPKGTEST_TMP} ? '/usr/bin' : '.'; +my @progs=grep { -x $_ } glob("$binpath/dh_*"); plan(tests => (@progs + @progs)); diff --git a/t/syntax/syntax-progs.t b/t/syntax/syntax-progs.t index 0dbdb2a2..0317c6e2 100755 --- a/t/syntax/syntax-progs.t +++ b/t/syntax/syntax-progs.t @@ -8,11 +8,15 @@ use lib dirname(dirname(__FILE__)); # Need Test::More to set PERL5LIB use Test::DH; +use Config; +my $binpath = $ENV{AUTOPKGTEST_TMP} ? '/usr/bin' : '.'; +my $libpath = $ENV{AUTOPKGTEST_TMP} ? $Config{vendorlib} : '.'; + my @targets; if ($0 =~ m{syntax-progs\.t$}) { - @targets = grep { -x $_ } glob("dh_*"), "dh"; + @targets = grep { -x $_ } glob("$binpath/dh_*"), "$binpath/dh"; } else { - @targets = (glob("Debian/Debhelper/*.pm"), glob("Debian/Debhelper/*/*.pm")); + @targets = (glob("$libpath/Debian/Debhelper/*.pm"), glob("$libpath/Debian/Debhelper/*/*.pm")); } plan(tests => scalar(@targets)); |