Browse Source

test: Do not fail on missing fakeroot just skip them

Guillem Jover 7 years ago
parent
commit
6ec8b1b4b1
3 changed files with 12 additions and 4 deletions
  1. 4 0
      debian/changelog
  2. 6 2
      scripts/t/dpkg_buildpackage.t
  3. 2 2
      t-func/atlocal.in

+ 4 - 0
debian/changelog

@@ -1,5 +1,9 @@
 dpkg (1.18.14) UNRELEASED; urgency=medium
 
+  [ Guillem Jover ]
+  * Test suite:
+    - Do not fail tests on missing fakeroot, just skip them.
+
   [ Updated man pages translations ]
   * German (Helge Kreutzmann).
 

+ 6 - 2
scripts/t/dpkg_buildpackage.t

@@ -16,8 +16,8 @@
 use strict;
 use warnings;
 
-use Test::More tests => 12;
-use Test::Dpkg qw(test_neutralize_checksums);
+use Test::More;
+use Test::Dpkg qw(:needs test_neutralize_checksums);
 
 use File::Spec::Functions qw(rel2abs);
 use File::Compare;
@@ -28,6 +28,10 @@ use Dpkg::IPC;
 use Dpkg::Build::Types;
 use Dpkg::Substvars;
 
+test_needs_command('fakeroot');
+
+plan tests => 12;
+
 my $srcdir = rel2abs($ENV{srcdir} || '.');
 my $datadir = "$srcdir/t/dpkg_buildpackage";
 my $tmpdir = 't.tmp/dpkg_buildpackage';

+ 2 - 2
t-func/atlocal.in

@@ -27,8 +27,8 @@ if [ "$(id -u)" = 0 ]; then
 elif which fakeroot >/dev/null; then
   ASROOT=fakeroot
 else
-  echo "error: cannot run as root(ish)" >&2
-  exit 1
+  echo "skip: needs to run as root(ish)" >&2
+  exit 0
 fi
 export ASROOT