Use demo_common.sh in dlopen test script
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
63c3534981
commit
c25ae6f48c
1 changed files with 6 additions and 27 deletions
|
@ -18,33 +18,12 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -e -u
|
||||
. "${0%/*}/../demo_common.sh"
|
||||
|
||||
program_name="dlopen"
|
||||
program_dir="${0%/*}"
|
||||
program="$program_dir/$program_name"
|
||||
msg "Test the dynamic loading of libmbed*"
|
||||
|
||||
if [ ! -e "$program" ]; then
|
||||
# Look for programs in the current directory and the directories above it
|
||||
for dir in "." ".." "../.."; do
|
||||
program_dir="$dir/programs/test"
|
||||
program="$program_dir/$program_name"
|
||||
if [ -e "$program" ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ ! -e "$program" ]; then
|
||||
echo "Could not find $program_name program"
|
||||
|
||||
echo "Make sure that Mbed TLS is built as a shared library." \
|
||||
"If building out-of-tree, this script must be run" \
|
||||
"from the project build directory."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
top_dir="$program_dir/../.."
|
||||
library_dir="$top_dir/library"
|
||||
program="$programs_dir/test/dlopen"
|
||||
library_dir="$root_dir/library"
|
||||
|
||||
# ELF-based Unix-like (Linux, *BSD, Solaris, ...)
|
||||
if [ -n "${LD_LIBRARY_PATH-}" ]; then
|
||||
|
@ -62,6 +41,6 @@ else
|
|||
fi
|
||||
export DYLD_LIBRARY_PATH
|
||||
|
||||
echo "Running dynamic loading test program: $program"
|
||||
echo "Loading libraries from: $library_dir"
|
||||
msg "Running dynamic loading test program: $program"
|
||||
msg "Loading libraries from: $library_dir"
|
||||
"$program"
|
||||
|
|
Loading…
Reference in a new issue