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

tests/init-project: Include two libraries in the shim

parent 6b710b96
No related branches found
No related tags found
1 merge request!311Build capsule-capture-libs from a bundled copy of libcapsule
......@@ -155,6 +155,13 @@ then
dest="$package_name";
fi;
: "${PKG_CONFIG:=pkg-config}"
: "${CAPSULE_MKINC:="$($PKG_CONFIG --variable=makeinc capsule)"}"
: "${CAPSULE_SYMBOLS_TOOL:="$($PKG_CONFIG --variable=CAPSULE_SYMBOLS_TOOL capsule)"}"
: "${CAPSULE_VERSION_TOOL:="$($PKG_CONFIG --variable=CAPSULE_VERSION_TOOL capsule)"}"
: "${runtime_tree:="/host"}"
: "${search_tree:="/"}"
if [ -z "$ver" ];
then
if [ "x$first_target" != "x$first_target_maybe_ver" ];
......@@ -165,13 +172,6 @@ then
fi;
fi;
: "${PKG_CONFIG:=pkg-config}"
: "${CAPSULE_MKINC:="$($PKG_CONFIG --variable=makeinc capsule)"}"
: "${CAPSULE_SYMBOLS_TOOL:="$($PKG_CONFIG --variable=CAPSULE_SYMBOLS_TOOL capsule)"}"
: "${CAPSULE_VERSION_TOOL:="$($PKG_CONFIG --variable=CAPSULE_VERSION_TOOL capsule)"}"
: "${runtime_tree:="/host"}"
: "${search_tree:="/"}"
echo "Generating project for $package_name, shims for $runtime_tree libraries: $*";
echo "Creating project directory $dest";
......
......@@ -62,7 +62,8 @@ if (length $ENV{CAPSULE_TESTS_UNINSTALLED}) {
run_ok([$CAPSULE_INIT_PROJECT_TOOL,
'--search-tree=/',
'--runtime-tree=/run/host',
'libz.so.1']);
'libz.so.1/1.2.3',
'libjpeg.so.62']);
run_ok([
'sh', '-euc', 'cd "$1"; shift; ./configure "$@"',
'sh', "$test_tempdir/libz-proxy",
......@@ -73,7 +74,11 @@ run_ok(['make', '-C', "$test_tempdir/libz-proxy", 'V=1'], '>&2');
ok(-e "$test_tempdir/libz-proxy/libz.la");
ok(-e "$test_tempdir/libz-proxy/.libs/libz.so");
ok(-e "$test_tempdir/libz-proxy/.libs/libz.so.1");
ok(-e "$test_tempdir/libz-proxy/.libs/libz.so.1.0.0");
ok(-e "$test_tempdir/libz-proxy/.libs/libz.so.1.2.3");
ok(-e "$test_tempdir/libz-proxy/libjpeg.la");
ok(-e "$test_tempdir/libz-proxy/.libs/libjpeg.so");
ok(-e "$test_tempdir/libz-proxy/.libs/libjpeg.so.62");
ok(-e "$test_tempdir/libz-proxy/.libs/libjpeg.so.62.0.0");
{
local $/ = undef; # read entire file in one go
open(my $fh, '<', "$test_tempdir/libz-proxy/shim/libz.so.1.c");
......@@ -86,6 +91,18 @@ ok(-e "$test_tempdir/libz-proxy/.libs/libz.so.1.0.0");
'Search tree is not used at runtime');
close $fh;
}
{
local $/ = undef; # read entire file in one go
open(my $fh, '<', "$test_tempdir/libz-proxy/shim/libjpeg.so.62.c");
my $source = <$fh>;
like($source, qr{\.default_prefix\s*=\s*"/host"},
'Configure-time runtime tree takes precedence');
unlike($source, qr{\.default_prefix\s*=\s*"/run/host"},
'Init-time runtime tree is not used');
unlike($source, qr{\.default_prefix\s*=\s*"/"},
'Search tree is not used at runtime');
close $fh;
}
run_ok([$CAPSULE_SYMBOLS_TOOL, 'libz.so.1'],
'>', \$output);
......
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