search_path_test_2.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
3 export TMP_DIR=`mktemp -d /tmp/${0##*/}.XXXXXXXXXX`
4 
5 [[ -z "$DEBUG" ]] && trap "[[ -d \"$TMP_DIR\" ]] && rm -rf \"$TMP_DIR\"" EXIT
6 
7 T1="libthis_is_one.so libanother_one.so"
8 T2="libthis_is_two.so libanother_two.so"
9 T3="libthis_is_three.so"
10 T_ALL="$T1 $T2 $T3"
11 
12 for name in ${T_ALL}
13 do
14  touch "${TMP_DIR}/${name}"
15 done
16 
17 echo `pwd`
18 
19 search_path_test_2 "lib.*one.so" TMP_DIR; test $? -eq 2 || exit 1
20 search_path_test_2 "lib.*two.so" TMP_DIR; test $? -eq 2 || exit 2
21 search_path_test_2 "lib.*three.so" TMP_DIR; test $? -eq 1 || exit 3
22 search_path_test_2 "lib.*four.so" TMP_DIR; test $? -eq 0 || exit 4
23 
24 exit 0