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(
run_ok
run_verbose
skip_all_unless_bwrap
skip_all_unless_nm
$CAPSULE_INIT_PROJECT_TOOL
$CAPSULE_SYMBOLS_TOOL
$CAPSULE_VERSION_TOOL
......@@ -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>)
Return a list of symbols found in I<LIBRARY>, in the same format
......
......@@ -30,6 +30,8 @@ use lib $FindBin::Bin;
use CapsuleTest;
skip_all_unless_nm;
my $test_tempdir = File::Temp->newdir();
diag "Working directory: $test_tempdir";
chdir $test_tempdir;
......
......@@ -30,6 +30,8 @@ use lib $FindBin::Bin;
use CapsuleTest;
skip_all_unless_nm;
my $test_tempdir = File::Temp->newdir();
diag "Working directory: $test_tempdir";
chdir $test_tempdir;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment