Skip to content
Snippets Groups Projects
Commit 58cb6dce authored by Simon McVittie's avatar Simon McVittie
Browse files

Skip some tests on systems with older nm, like SteamOS brewmaster

parent 97334f4c
No related branches found
No related tags found
1 merge request!311Build capsule-capture-libs from a bundled copy of libcapsule
...@@ -34,6 +34,7 @@ our @EXPORT = qw( ...@@ -34,6 +34,7 @@ our @EXPORT = qw(
run_ok run_ok
run_verbose run_verbose
skip_all_unless_bwrap skip_all_unless_bwrap
skip_all_unless_nm
$CAPSULE_INIT_PROJECT_TOOL $CAPSULE_INIT_PROJECT_TOOL
$CAPSULE_SYMBOLS_TOOL $CAPSULE_SYMBOLS_TOOL
$CAPSULE_VERSION_TOOL $CAPSULE_VERSION_TOOL
...@@ -208,6 +209,23 @@ sub skip_all_unless_bwrap { ...@@ -208,6 +209,23 @@ sub skip_all_unless_bwrap {
} }
} }
=item skip_all_unless_nm()
If we cannot run B<nm>(1) to implement B<get_symbols_with_nm>, log a
TAP report that all tests have been skipped (as if via
C<plan skip_all =E<gt> ...>), and exit.
=cut
sub skip_all_unless_nm {
if (! run([split(' ', $NM),
qw(--dynamic --extern-only --defined-only
--with-symbol-versions /bin/true)], '>/dev/null')) {
plan(skip_all =>
'Cannot run nm (no support for --with-symbol-versions?)');
}
}
=item get_symbols_with_nm(I<LIBRARY>) =item get_symbols_with_nm(I<LIBRARY>)
Return a list of symbols found in I<LIBRARY>, in the same format Return a list of symbols found in I<LIBRARY>, in the same format
......
...@@ -30,6 +30,8 @@ use lib $FindBin::Bin; ...@@ -30,6 +30,8 @@ use lib $FindBin::Bin;
use CapsuleTest; use CapsuleTest;
skip_all_unless_nm;
my $test_tempdir = File::Temp->newdir(); my $test_tempdir = File::Temp->newdir();
diag "Working directory: $test_tempdir"; diag "Working directory: $test_tempdir";
chdir $test_tempdir; chdir $test_tempdir;
......
...@@ -30,6 +30,8 @@ use lib $FindBin::Bin; ...@@ -30,6 +30,8 @@ use lib $FindBin::Bin;
use CapsuleTest; use CapsuleTest;
skip_all_unless_nm;
my $test_tempdir = File::Temp->newdir(); my $test_tempdir = File::Temp->newdir();
diag "Working directory: $test_tempdir"; diag "Working directory: $test_tempdir";
chdir $test_tempdir; chdir $test_tempdir;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment