summaryrefslogtreecommitdiffstats
path: root/tests/set-rpath-library.sh
diff options
context:
space:
mode:
authorVincent Danjean <Vincent.Danjean@ens-lyon.org>2012-06-21 09:43:57 (GMT)
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-07-10 22:16:24 (GMT)
commit3226dea3610c8d3cb81b574e1aa478948ddc6c91 (patch)
tree589be58acd0b07fdee94091f2042f9884bfc8cef /tests/set-rpath-library.sh
parentd0dac944aeb6385da874d07da2c9897f2f9bd7d6 (diff)
downloadpatchelf-3226dea3610c8d3cb81b574e1aa478948ddc6c91.zip
patchelf-3226dea3610c8d3cb81b574e1aa478948ddc6c91.tar.gz
patchelf-3226dea3610c8d3cb81b574e1aa478948ddc6c91.tar.bz2
Allow parallel execution of tests
Each test use its own subdirectory in scratch/
Diffstat (limited to 'tests/set-rpath-library.sh')
-rwxr-xr-xtests/set-rpath-library.sh33
1 files changed, 17 insertions, 16 deletions
diff --git a/tests/set-rpath-library.sh b/tests/set-rpath-library.sh
index 50e58b8..dd1381f 100755
--- a/tests/set-rpath-library.sh
+++ b/tests/set-rpath-library.sh
@@ -1,27 +1,28 @@
#! /bin/sh -e
+SCRATCH=scratch/$(basename $0 .sh)
if test "$(uname)" = FreeBSD; then
echo "skipping on FreeBSD"
exit 0
fi
-rm -rf scratch
-mkdir -p scratch
-mkdir -p scratch/libsA
-mkdir -p scratch/libsB
+rm -rf ${SCRATCH}
+mkdir -p ${SCRATCH}
+mkdir -p ${SCRATCH}/libsA
+mkdir -p ${SCRATCH}/libsB
-cp main-scoped scratch/
-cp libfoo-scoped.so scratch/libsA/
-cp libbar-scoped.so scratch/libsB/
+cp main-scoped ${SCRATCH}/
+cp libfoo-scoped.so ${SCRATCH}/libsA/
+cp libbar-scoped.so ${SCRATCH}/libsB/
-oldRPath=$(../src/patchelf --print-rpath scratch/main-scoped)
+oldRPath=$(../src/patchelf --print-rpath ${SCRATCH}/main-scoped)
if test -z "$oldRPath"; then oldRPath="/oops"; fi
-../src/patchelf --set-rpath $oldRPath:$(pwd)/scratch/libsA:$(pwd)/scratch/libsB scratch/main-scoped
+../src/patchelf --set-rpath $oldRPath:$(pwd)/${SCRATCH}/libsA:$(pwd)/${SCRATCH}/libsB ${SCRATCH}/main-scoped
# "main" contains libbar in its RUNPATH, but that's ignored when
# resolving libfoo. So libfoo won't find libbar and this will fail.
exitCode=0
-(cd scratch && ./main-scoped) || exitCode=$?
+(cd ${SCRATCH} && ./main-scoped) || exitCode=$?
if test "$exitCode" = 46; then
echo "expected failure"
@@ -29,12 +30,12 @@ if test "$exitCode" = 46; then
fi
# So set an RUNPATH on libfoo as well.
-oldRPath=$(../src/patchelf --print-rpath scratch/libsA/libfoo-scoped.so)
+oldRPath=$(../src/patchelf --print-rpath ${SCRATCH}/libsA/libfoo-scoped.so)
if test -z "$oldRPath"; then oldRPath="/oops"; fi
-../src/patchelf --set-rpath $oldRPath:$(pwd)/scratch/libsB scratch/libsA/libfoo-scoped.so
+../src/patchelf --set-rpath $oldRPath:$(pwd)/${SCRATCH}/libsB ${SCRATCH}/libsA/libfoo-scoped.so
exitCode=0
-(cd scratch && ./main-scoped) || exitCode=$?
+(cd ${SCRATCH} && ./main-scoped) || exitCode=$?
if test "$exitCode" != 46; then
echo "bad exit code!"
@@ -42,15 +43,15 @@ if test "$exitCode" != 46; then
fi
# Remove the libbar PATH from main using --shrink-rpath.
-../src/patchelf --shrink-rpath scratch/main-scoped
-if ../src/patchelf --print-rpath scratch/main-scoped | grep /libsB; then
+../src/patchelf --shrink-rpath ${SCRATCH}/main-scoped
+if ../src/patchelf --print-rpath ${SCRATCH}/main-scoped | grep /libsB; then
echo "shrink failed"
exit 1
fi
# And it should still run.
exitCode=0
-(cd scratch && ./main-scoped) || exitCode=$?
+(cd ${SCRATCH} && ./main-scoped) || exitCode=$?
if test "$exitCode" != 46; then
echo "bad exit code!"