summaryrefslogtreecommitdiffstats
path: root/tests/shrink-rpath.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/shrink-rpath.sh')
-rwxr-xr-xtests/shrink-rpath.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/shrink-rpath.sh b/tests/shrink-rpath.sh
new file mode 100755
index 0000000..e0c82c1
--- /dev/null
+++ b/tests/shrink-rpath.sh
@@ -0,0 +1,30 @@
+#! /bin/sh -e
+
+rpath=$(../src/patchelf --print-rpath ./libbar.so)
+echo "RPATH before: $rpath"
+if ! echo "$rpath" | grep -q /no-such-path; then
+ echo "incomplete RPATH"
+ exit 1
+fi
+
+rm -rf scratch
+mkdir -p scratch
+cp libbar.so scratch/
+../src/patchelf --shrink-rpath scratch/libbar.so
+
+rpath=$(../src/patchelf --print-rpath scratch/libbar.so)
+echo "RPATH after: $rpath"
+if echo "$rpath" | grep -q /no-such-path; then
+ echo "RPATH not shrunk"
+ exit 1
+fi
+
+cp libfoo.so scratch/
+
+exitCode=0
+cd scratch && LD_LIBRARY_PATH=. ../main || exitCode=$?
+
+if test "$exitCode" != 46; then
+ echo "bad exit code!"
+ exit 1
+fi