Przeglądaj źródła

scripts/t: Skip test cases when there is no c++filt available

In principle we require c++filt at run-time, but for now let's not fail
these tests on such systems.
Guillem Jover 11 lat temu
rodzic
commit
60b2a4fa31
3 zmienionych plików z 19 dodań i 1 usunięć
  1. 1 0
      debian/changelog
  2. 9 0
      scripts/t/Dpkg_Shlibs.t
  3. 9 1
      scripts/t/Dpkg_Shlibs_Cppfilt.t

+ 1 - 0
debian/changelog

@@ -82,6 +82,7 @@ dpkg (1.18.0) UNRELEASED; urgency=low
     - Fix dpkg-divert unit test to work on BSD «rm -rf» that cannot traverse
       directories with mode 000.
     - Fix dpkg-divert unit test to work when there is no /dev/full.
+    - Skip test cases when there is no c++filt available.
   * Build system:
     - Bump gettext version to 0.19:
       + Use --add-location=file in msgmerge and xgettext commands.

+ 9 - 0
scripts/t/Dpkg_Shlibs.t

@@ -21,6 +21,8 @@ use Test::More tests => 122;
 use Cwd;
 use IO::String;
 
+use Dpkg::Path qw(find_command);
+
 use_ok('Dpkg::Shlibs');
 
 my $tmp;
@@ -543,6 +545,11 @@ is ( $sym->{teststruct}{foo}, 1, 'original field "foo" not changed' );
 is ( $sym->{testfield}, 1, 'original field "testfield" not changed' );
 
 ############ Test symbol patterns ###########
+
+SKIP: {
+
+skip 'c++filt not available', 41 if not find_command('c++filt');
+
 sub load_patterns_obj {
     $obj = Dpkg::Shlibs::Objdump::Object->new();
     open $objdump, '<', "$datadir/objdump.patterns"
@@ -716,3 +723,5 @@ foreach my $sym ($pat->get_pattern_matches()) {
     ok(!$sym->{deprecated}, $sym->get_symbolname() . ': not deprecated');
     is($sym->{minver}, '100.FOUND', $sym->get_symbolname() . ': version bumped');
 }
+
+}

+ 9 - 1
scripts/t/Dpkg_Shlibs_Cppfilt.t

@@ -16,7 +16,15 @@
 use strict;
 use warnings;
 
-use Test::More tests => 124;
+use Test::More;
+
+use Dpkg::Path qw(find_command);
+
+if (find_command('c++filt')) {
+    plan tests => 124;
+} else {
+    plan skip_all => 'c++filt not available';
+}
 
 use_ok('Dpkg::Shlibs::Cppfilt');