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

tests: Rename exec_is to shell_is


This more accurately reflects what it actually does.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 03e54617
No related branches found
No related tags found
1 merge request!311Build capsule-capture-libs from a bundled copy of libcapsule
...@@ -40,25 +40,25 @@ bwrap --ro-bind / / --ro-bind / "${host}" --dev-bind /dev /dev \ ...@@ -40,25 +40,25 @@ bwrap --ro-bind / / --ro-bind / "${host}" --dev-bind /dev /dev \
${CAPSULE_SYMBOLS} libcapsule.so.0 "${host}" > output ${CAPSULE_SYMBOLS} libcapsule.so.0 "${host}" > output
pass "Ran ${CAPSULE_SYMBOLS} libcapsule.so.0 ${host}" pass "Ran ${CAPSULE_SYMBOLS} libcapsule.so.0 ${host}"
exec_is 'grep "^capsule_init" output' 0 "capsule_init " \ shell_is 'grep "^capsule_init" output' 0 "capsule_init " \
"capsule_init is part of libcapsule's ABI" "capsule_init is part of libcapsule's ABI"
exec_is 'grep -v "^capsule" output' 1 "" \ shell_is 'grep -v "^capsule" output' 1 "" \
"all of libcapsule's ABI matches /^capsule/" "all of libcapsule's ABI matches /^capsule/"
# Try the same thing without a prefix # Try the same thing without a prefix
${CAPSULE_SYMBOLS} libcapsule.so.0 / > output ${CAPSULE_SYMBOLS} libcapsule.so.0 / > output
pass "Ran ${CAPSULE_SYMBOLS} libcapsule.so.0 /" pass "Ran ${CAPSULE_SYMBOLS} libcapsule.so.0 /"
exec_is 'grep "^capsule_init" output' 0 "capsule_init " \ shell_is 'grep "^capsule_init" output' 0 "capsule_init " \
"capsule_init is an unversioned symbol" "capsule_init is an unversioned symbol"
exec_is 'grep -v "^capsule" output' 1 "" \ shell_is 'grep -v "^capsule" output' 1 "" \
"all of libcapsule's ABI matches /^capsule/" "all of libcapsule's ABI matches /^capsule/"
# How about versioned symbols? # How about versioned symbols?
${CAPSULE_SYMBOLS} libjpeg.so.62 / > output ${CAPSULE_SYMBOLS} libjpeg.so.62 / > output
pass "Ran ${CAPSULE_SYMBOLS} libjpeg.so.62 /" pass "Ran ${CAPSULE_SYMBOLS} libjpeg.so.62 /"
exec_is 'grep "^jpeg_destroy " output' 0 'jpeg_destroy @@LIBJPEG_6.2' \ shell_is 'grep "^jpeg_destroy " output' 0 'jpeg_destroy @@LIBJPEG_6.2' \
"jpeg_destroy is a versioned symbol" "jpeg_destroy is a versioned symbol"
done_testing done_testing
......
...@@ -99,7 +99,7 @@ isnt () { ...@@ -99,7 +99,7 @@ isnt () {
fi fi
} }
exec_is () { shell_is () {
local command="$1" local command="$1"
local expected_status="$2" local expected_status="$2"
local expected="$3" local expected="$3"
......
...@@ -49,38 +49,38 @@ echo ...@@ -49,38 +49,38 @@ echo
echo "# Without special measures:" echo "# Without special measures:"
run_verbose env LD_LIBRARY_PATH="$G_TEST_BUILDDIR/tests/lib$libs" "$notgl_user" > "$test_tempdir/output" run_verbose env LD_LIBRARY_PATH="$G_TEST_BUILDDIR/tests/lib$libs" "$notgl_user" > "$test_tempdir/output"
sed -e 's/^/# /' "$test_tempdir/output" sed -e 's/^/# /' "$test_tempdir/output"
exec_is \ shell_is \
'sed -ne "s/^NotGL implementation: //p" $test_tempdir/output' \ 'sed -ne "s/^NotGL implementation: //p" $test_tempdir/output' \
0 reference 0 reference
exec_is \ shell_is \
'sed -ne "s/^NotGL helper implementation: //p" $test_tempdir/output' \ 'sed -ne "s/^NotGL helper implementation: //p" $test_tempdir/output' \
0 "container (reference)" 0 "container (reference)"
exec_is \ shell_is \
'sed -ne "s/^notgl_extension_both: //p" $test_tempdir/output' \ 'sed -ne "s/^notgl_extension_both: //p" $test_tempdir/output' \
0 "reference implementation of common extension" 0 "reference implementation of common extension"
exec_is \ shell_is \
'sed -ne "s/^notgl_extension_red: //p" $test_tempdir/output' \ 'sed -ne "s/^notgl_extension_red: //p" $test_tempdir/output' \
0 "(not found)" 0 "(not found)"
exec_is \ shell_is \
'sed -ne "s/^notgl_extension_green: //p" $test_tempdir/output' \ 'sed -ne "s/^notgl_extension_green: //p" $test_tempdir/output' \
0 "(not found)" 0 "(not found)"
echo echo
run_verbose env LD_LIBRARY_PATH="$G_TEST_BUILDDIR/tests/lib$libs" "$notgl_helper_user" > "$test_tempdir/output" run_verbose env LD_LIBRARY_PATH="$G_TEST_BUILDDIR/tests/lib$libs" "$notgl_helper_user" > "$test_tempdir/output"
sed -e 's/^/# /' "$test_tempdir/output" sed -e 's/^/# /' "$test_tempdir/output"
exec_is \ shell_is \
'sed -ne "s/^NotGL implementation: //p" $test_tempdir/output' \ 'sed -ne "s/^NotGL implementation: //p" $test_tempdir/output' \
0 reference 0 reference
exec_is \ shell_is \
'sed -ne "s/^NotGL helper implementation: //p" $test_tempdir/output' \ 'sed -ne "s/^NotGL helper implementation: //p" $test_tempdir/output' \
0 "container (reference)" 0 "container (reference)"
exec_is \ shell_is \
'sed -ne "s/^notgl_extension_both: //p" $test_tempdir/output' \ 'sed -ne "s/^notgl_extension_both: //p" $test_tempdir/output' \
0 "reference implementation of common extension" 0 "reference implementation of common extension"
exec_is \ shell_is \
'sed -ne "s/^notgl_extension_red: //p" $test_tempdir/output' \ 'sed -ne "s/^notgl_extension_red: //p" $test_tempdir/output' \
0 "(not found)" 0 "(not found)"
exec_is \ shell_is \
'sed -ne "s/^NotGL helper implementation as seen by executable: //p" $test_tempdir/output' \ 'sed -ne "s/^NotGL helper implementation as seen by executable: //p" $test_tempdir/output' \
0 "container (reference)" 0 "container (reference)"
...@@ -107,26 +107,26 @@ sed -e 's/^/# /' "$test_tempdir/output" ...@@ -107,26 +107,26 @@ sed -e 's/^/# /' "$test_tempdir/output"
# Functions from libnotgl get dispatched through the shim to the "red" # Functions from libnotgl get dispatched through the shim to the "red"
# implementation from the "host system". This mirrors functions from libGL # implementation from the "host system". This mirrors functions from libGL
# being dispatched through the shim to the AMD implementation of libGL. # being dispatched through the shim to the AMD implementation of libGL.
exec_is \ shell_is \
'sed -ne "s/^NotGL implementation: //p" $test_tempdir/output' \ 'sed -ne "s/^NotGL implementation: //p" $test_tempdir/output' \
0 red 0 red
# When the "red" implementation of libnotgl calls functions from libhelper, # When the "red" implementation of libnotgl calls functions from libhelper,
# implementation from the "host system". This mirrors functions from # implementation from the "host system". This mirrors functions from
# libstdc++ that are called by the host libGL ending up in the host libstdc++. # libstdc++ that are called by the host libGL ending up in the host libstdc++.
exec_is \ shell_is \
'sed -ne "s/^NotGL helper implementation: //p" $test_tempdir/output' \ 'sed -ne "s/^NotGL helper implementation: //p" $test_tempdir/output' \
0 "host (red)" 0 "host (red)"
# We can dlsym() for an implemementation of an extension that is part of # We can dlsym() for an implemementation of an extension that is part of
# the ABI of the shim and the reference implementation. # the ABI of the shim and the reference implementation.
exec_is \ shell_is \
'sed -ne "s/^notgl_extension_both: //p" $test_tempdir/output' \ 'sed -ne "s/^notgl_extension_both: //p" $test_tempdir/output' \
0 "red implementation of common extension" 0 "red implementation of common extension"
# We can also dlsym() for an implemementation of an extension that is only # We can also dlsym() for an implemementation of an extension that is only
# available in the "red" implementation. # available in the "red" implementation.
exec_is \ shell_is \
'sed -ne "s/^notgl_extension_red: //p" $test_tempdir/output' \ 'sed -ne "s/^notgl_extension_red: //p" $test_tempdir/output' \
0 "red-only extension" 0 "red-only extension"
exec_is \ shell_is \
'sed -ne "s/^notgl_extension_green: //p" $test_tempdir/output' \ 'sed -ne "s/^notgl_extension_green: //p" $test_tempdir/output' \
0 "(not found)" 0 "(not found)"
...@@ -142,19 +142,19 @@ run_verbose bwrap \ ...@@ -142,19 +142,19 @@ run_verbose bwrap \
--setenv LD_LIBRARY_PATH "$G_TEST_BUILDDIR/tests/shim$libs:$G_TEST_BUILDDIR/tests/lib$libs" \ --setenv LD_LIBRARY_PATH "$G_TEST_BUILDDIR/tests/shim$libs:$G_TEST_BUILDDIR/tests/lib$libs" \
"$notgl_helper_user" > "$test_tempdir/output" "$notgl_helper_user" > "$test_tempdir/output"
sed -e 's/^/# /' "$test_tempdir/output" sed -e 's/^/# /' "$test_tempdir/output"
exec_is \ shell_is \
'sed -ne "s/^NotGL implementation: //p" $test_tempdir/output' \ 'sed -ne "s/^NotGL implementation: //p" $test_tempdir/output' \
0 green 0 green
exec_is \ shell_is \
'sed -ne "s/^NotGL helper implementation: //p" $test_tempdir/output' \ 'sed -ne "s/^NotGL helper implementation: //p" $test_tempdir/output' \
0 "host (green)" 0 "host (green)"
exec_is \ shell_is \
'sed -ne "s/^notgl_extension_both: //p" $test_tempdir/output' \ 'sed -ne "s/^notgl_extension_both: //p" $test_tempdir/output' \
0 "green implementation of common extension" 0 "green implementation of common extension"
exec_is \ shell_is \
'sed -ne "s/^notgl_extension_red: //p" $test_tempdir/output' \ 'sed -ne "s/^notgl_extension_red: //p" $test_tempdir/output' \
0 "(not found)" 0 "(not found)"
exec_is \ shell_is \
'sed -ne "s/^notgl_extension_green: //p" $test_tempdir/output' \ 'sed -ne "s/^notgl_extension_green: //p" $test_tempdir/output' \
0 "green-only extension" 0 "green-only extension"
# Also, this program is linked directly to libhelper, mirroring a program # Also, this program is linked directly to libhelper, mirroring a program
...@@ -162,7 +162,7 @@ exec_is \ ...@@ -162,7 +162,7 @@ exec_is \
# container's libhelper, not the host's - even though libnotgl sees the # container's libhelper, not the host's - even though libnotgl sees the
# host's libhelper when it looks up the same symbol. (This is the point # host's libhelper when it looks up the same symbol. (This is the point
# of libcapsule.) # of libcapsule.)
exec_is \ shell_is \
'sed -ne "s/^NotGL helper implementation as seen by executable: //p" $test_tempdir/output' \ 'sed -ne "s/^NotGL helper implementation as seen by executable: //p" $test_tempdir/output' \
0 "container (reference)" 0 "container (reference)"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment