mirror of
https://github.com/Mbed-TLS/mbedtls-framework.git
synced 2026-10-08 09:47:23 +00:00
tests: adapt dlopen_demo.sh to run also from tf-psa-crypto repo
Signed-off-by: Valerio Setti <[email protected]>
This commit is contained in:
@@ -6,17 +6,31 @@
|
|||||||
# Copyright The Mbed TLS Contributors
|
# Copyright The Mbed TLS Contributors
|
||||||
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
||||||
|
|
||||||
. "${0%/*}/../../scripts/demo_common.sh"
|
DEMO_COMMON_NEED_QUERY_COMPILE_TIME_CONFIG=0
|
||||||
|
|
||||||
|
SCRIPT_DIR=$(dirname "$0")
|
||||||
|
. "${SCRIPT_DIR}/../../scripts/project_detection.sh"
|
||||||
|
. "${SCRIPT_DIR}/../../scripts/demo_common.sh"
|
||||||
|
|
||||||
msg "Test the dynamic loading of libmbed*"
|
msg "Test the dynamic loading of libmbed*"
|
||||||
|
|
||||||
program="$programs_dir/test/dlopen"
|
# Once demo_common.sh is sourced we'll have the following variables set:
|
||||||
library_dir="$root_dir/library"
|
# - $root_dir points to the root path of Mbed TLS or TF-PSA-Crypto;
|
||||||
|
# - $programs_dir points to "$root_dir/programs" folder.
|
||||||
|
if is_mbedtls_root $root_dir; then
|
||||||
|
msg "Running in Mbed TLS repo"
|
||||||
|
program="$programs_dir/test/dlopen"
|
||||||
|
library_dir="$root_dir/library"
|
||||||
|
else
|
||||||
|
msg "Running in TF-PSA-Crypto repo"
|
||||||
|
program="$root_dir/programs/test/tfpsacrypto_dlopen"
|
||||||
|
library_dir="$root_dir/core"
|
||||||
|
fi
|
||||||
|
|
||||||
# Skip this test if we don't have a shared library build. Detect this
|
# Skip this test if we don't have a shared library build. Detect this
|
||||||
# through the absence of the demo program.
|
# through the absence of the demo program.
|
||||||
if [ ! -e "$program" ]; then
|
if [ ! -e "$program" ]; then
|
||||||
msg "$0: this demo requires a shared library build."
|
msg "Error: demo program $program not found."
|
||||||
# Exit with a success status so that this counts as a pass for run_demos.py.
|
# Exit with a success status so that this counts as a pass for run_demos.py.
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user