Refactor util/mkdef.pl for clearer separation of functionality
[openssl.git] / test / recipes / 01-test_symbol_presence.t
index 619519c5b5edd865235d49f997524984de9a25f7..015dee95d25b7d2c177cf18663ff58bcfdd5a738 100644 (file)
@@ -23,7 +23,7 @@ my $testcount = scalar @libnames;
 plan tests => $testcount * 2;
 
 note
-    "NOTE: developper test!  It's possible that it won't run on your\n",
+    "NOTE: developer test!  It's possible that it won't run on your\n",
     "platform, and that's perfectly fine.  This is mainly for developers\n",
     "on Unix to check that our shared libraries are consistent with the\n",
     "ordinals (util/*.num in the source tree), something that should be\n",
@@ -49,15 +49,16 @@ foreach my $libname (@libnames) {
         my @def_lines;
         indir $bldtop => sub {
             my $mkdefpath = srctop_file("util", "mkdef.pl");
-            @def_lines = map { s|\R$||; $_ } `$^X $mkdefpath $libname linux 2> /dev/null`;
-            ok($? == 0, "running 'cd $bldtop; $^X $mkdefpath $libname linux' => $?");
+            my $libnumpath = srctop_file("util", "lib$libname.num");
+            @def_lines = map { s|\R$||; $_ } `$^X $mkdefpath --ordinals $libnumpath --name $libname --OS linux 2> /dev/null`;
+            ok($? == 0, "running 'cd $bldtop; $^X $mkdefpath --ordinals $libnumpath --name $libname --OS linux' => $?");
         }, create => 0, cleanup => 0;
 
         note "Number of lines in \@nm_lines before massaging: ", scalar @nm_lines;
         note "Number of lines in \@def_lines before massaging: ", scalar @def_lines;
 
         # Massage the nm output to only contain defined symbols
-        @nm_lines = sort map { s| .*||; $_ } grep(m|.* [BCDT] .*|, @nm_lines);
+        @nm_lines = sort map { s| .*||; $_ } grep(m|.* [BCDST] .*|, @nm_lines);
 
         # Massage the mkdef.pl output to only contain global symbols
         # The output we got is in Unix .map format, which has a global
@@ -69,6 +70,7 @@ foreach my $libname (@libnames) {
             map { s|;||; s|\s+||g; $_ }
             grep { $in_global = 1 if m|global:|;
                    $in_global = 0 if m|local:|;
+                   $in_global = 0 if m|\}|;
                    $in_global && m|;|; } @def_lines;
 
         note "Number of lines in \@nm_lines after massaging: ", scalar @nm_lines;