Commit 37e97c48 authored by Simon McVittie's avatar Simon McVittie
Browse files

tests: Allow even more variations of what a $libdir looks like



Exherbo uses the traditional-cross-compilation-style prefix,
/usr/<tuple>, which broke the tests' assumptions.
Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
parent 30c429a4
......@@ -39,7 +39,7 @@ sub tolerant_readlink ($)
skip_all_unless_bwrap;
my $LIBDIR = qr{/(?:usr/)?lib(?:32|64|x32)?(?:/\w+-linux-gnu\w*)?(?:/i686)?(?:/cmov)?};
my $LIBDIR = qr{/(?:usr/(?:\w+-(?:\w+-)?linux-gnu\w*/)?)?lib(?:32|64|x32)?(?:/\w+-linux-gnu\w*)?(?:/i686)?(?:/cmov)?};
my $test_tempdir = File::Temp->newdir();
diag "Working directory: $test_tempdir";
......
......@@ -30,6 +30,8 @@ use lib $FindBin::Bin;
use CapsuleTest;
my $LIBDIR = qr{/(?:usr/(?:\w+-(?:\w+-)?linux-gnu\w*/)?)?lib(?:32|64|x32)?(?:/\w+-linux-gnu\w*)?(?:/i686)?(?:/cmov)?};
skip_all_unless_bwrap;
my $test_tempdir = File::Temp->newdir();
......@@ -52,7 +54,7 @@ $path = $4;
is($root, $host);
is($soname, 'libz.so.1');
like($version, qr{^1\.[0-9]+\.[0-9]+$});
like($path, qr{^\Q$host\E(/(?:usr/)?lib(?:32|64|x32|/.*-linux-gnu.*)?/libz\.so\.\Q$version\E)$});
like($path, qr{^\Q$host\E($LIBDIR/libz\.so\.\Q$version\E)$});
$path =~ s/^\Q$host\E//;
ok(-e $path);
......@@ -71,7 +73,7 @@ TODO: {
local $TODO = 'returns 1 for some reason';
like($version, qr{^1\.[0-9]+\.[0-9]+$});
}
like($path, qr{^(/?(?:usr/)?lib(?:32|64|x32|/.*-linux-gnu.*)?/libz\.so\.\Q$version\E)$});
like($path, qr{^($LIBDIR/libz\.so\.\Q$version\E)$});
ok(-e $1);
# A different way
......@@ -89,7 +91,7 @@ TODO: {
local $TODO = 'returns 1 for some reason';
like($version, qr{^1\.[0-9]+\.[0-9]+$});
}
like($path, qr{^(/?(?:usr/)?lib(?:32|64|x32|/.*-linux-gnu.*)?/libz\.so\.\Q$version\E)$});
like($path, qr{^($LIBDIR/libz\.so\.\Q$version\E)$});
ok(-e $path);
# Another different way
......@@ -108,7 +110,7 @@ TODO: {
local $TODO = 'returns 1 for some reason';
like($version, qr{^1\.[0-9]+\.[0-9]+$});
}
like($path, qr{^(/?(?:usr/)?lib(?:32|64|x32|/.*-linux-gnu.*)?/libz\.so\.\Q$3\E)$});
like($path, qr{^($LIBDIR/libz\.so\.\Q$3\E)$});
ok(-e $path);
done_testing;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment