summaryrefslogtreecommitdiffstats
path: root/tests/soname.sh
diff options
context:
space:
mode:
authorChingis Dugarzhapov <chingis.dug@gmail.com>2014-04-19 10:03:41 (GMT)
committerChingis Dugarzhapov <chingis.dug@gmail.com>2014-04-19 10:05:56 (GMT)
commit02c185ff69f6e96c5e3081b8d9407ff8b74dc827 (patch)
tree16de12a7c67eee36680c4d6744f5803d978ca586 /tests/soname.sh
parent211ee2c00aeb4b0bc6ab33ad0ed34525d895069d (diff)
downloadpatchelf-02c185ff69f6e96c5e3081b8d9407ff8b74dc827.zip
patchelf-02c185ff69f6e96c5e3081b8d9407ff8b74dc827.tar.gz
patchelf-02c185ff69f6e96c5e3081b8d9407ff8b74dc827.tar.bz2
Added tests for --print-soname and --set-soname
Diffstat (limited to 'tests/soname.sh')
-rwxr-xr-xtests/soname.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/soname.sh b/tests/soname.sh
new file mode 100755
index 0000000..f81e8ed
--- /dev/null
+++ b/tests/soname.sh
@@ -0,0 +1,21 @@
+#! /bin/sh -e
+SCRATCH=scratch/$(basename $0 .sh)
+
+rm -rf ${SCRATCH}
+mkdir -p ${SCRATCH}
+
+cp libsimple.so ${SCRATCH}/
+
+# print and set DT_SONAME
+soname=$(../src/patchelf --print-soname ${SCRATCH}/libsimple.so)
+if test "$soname" != libsimple.so.1.0; then
+ echo "failed --print-soname test. Expected soname: libsimple.so.1.0, got: $soname"
+ exit 1
+fi
+
+../src/patchelf --set-soname libsimple.so.1.1 ${SCRATCH}/libsimple.so
+newSoname=$(../src/patchelf --print-soname ${SCRATCH}/libsimple.so)
+if test "$newSoname" != libsimple.so.1.1; then
+ echo "failed --set-soname test. Expected newSoname: libsimple.so.1.1, got: $newSoname"
+ exit 1
+fi