summaryrefslogtreecommitdiffstats
path: root/tests/set-rpath.sh
blob: 6446395ae344533cdf718e3522fec61b3b6043f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /bin/sh -e

rm -rf scratch
mkdir -p scratch
mkdir -p scratch/libsA
mkdir -p scratch/libsB

cp main scratch/
cp libfoo.so scratch/libsA/
cp libbar.so scratch/libsB/

../src/patchelf --set-rpath $(pwd)/scratch/libsA scratch/main
../src/patchelf --set-rpath $(pwd)/scratch/libsB scratch/libsA/libfoo.so

exitCode=0
scratch/main || exitCode=$?

if test "$exitCode" != 46; then
    echo "bad exit code!"
    exit 1
fi