Selaa lähdekoodia

Add new test case for symbols file parsing

Ensure that an #include can change the name of the currently parsed
library (ELF object).
Raphael Hertzog 17 vuotta sitten
vanhempi
commit
a27d14c442

+ 7 - 1
scripts/t/200_Dpkg_Shlibs.t

@@ -1,6 +1,6 @@
 # -*- mode: cperl;-*-
 
-use Test::More tests => 62;
+use Test::More tests => 63;
 use IO::String;
 
 use strict;
@@ -175,6 +175,12 @@ is_deeply($sym, Dpkg::Shlibs::Symbol->new ( 'symbol' => 'symbol3_fake1@Base',
 is($sym_file->get_smallest_version('libfake.so.1'), "0",
    'get_smallest_version with null version');
 
+$sym = $sym_file->lookup_symbol('symbol_in_libdivert@Base', ['libdivert.so.1']);
+is_deeply($sym, Dpkg::Shlibs::Symbol->new ( 'symbol' => 'symbol_in_libdivert@Base',
+		  'minver' => '1.0~beta1', 'dep_id' => 0, 'deprecated' => 0,
+		  'depends' => 'libdivert1 #MINVER#', 'soname' => 'libdivert.so.1'),
+	    '#include can change current object');
+
 $sym_file = Dpkg::Shlibs::SymbolFile->new(file => "$srcdir/symbols.include-2");
 
 $sym = $sym_file->lookup_symbol('symbol1_fake2@Base', ['libfake.so.1']);

+ 5 - 0
scripts/t/200_Dpkg_Shlibs/symbols.fake-3

@@ -0,0 +1,5 @@
+# if included, this file will change the current "object" parsed
+# after the include it will be libdivert.so.1 instead of the object
+# of the including symbols file
+libdivert.so.1 libdivert1 #MINVER#
+ divert_something@Base 1.0

+ 2 - 0
scripts/t/200_Dpkg_Shlibs/symbols.include-1

@@ -5,3 +5,5 @@ libfake.so.1 libfake1 #MINVER#
 #include "symbols.fake-1"
  symbol3_fake1@Base 0
  symbol_after@Base 1.1
+#include "symbols.fake-3"
+ symbol_in_libdivert@Base 1.0~beta1