From ab453641af58865b5102a84abecd6851b9188f15 Mon Sep 17 00:00:00 2001 From: Aymen Sghaier Date: Tue, 1 Mar 2022 15:12:37 +0100 Subject: [PATCH] [SSAT] Enable filter_python3 test to run on target - remove exit if build folder not exists - bypass pushd failure if build folder not exists Signed-off-by: Aymen Sghaier --- tests/nnstreamer_filter_python3/runTest.sh | 34 ++++++++++++++++++------------ 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/tests/nnstreamer_filter_python3/runTest.sh b/tests/nnstreamer_filter_python3/runTest.sh index 087ec80..15431c6 100755 --- a/tests/nnstreamer_filter_python3/runTest.sh +++ b/tests/nnstreamer_filter_python3/runTest.sh @@ -37,23 +37,31 @@ if [[ -d $PATH_TO_PLUGIN ]]; then fi else echo "No build directory" - report - exit + # Check if module is installed. + if python3 -c "import nnstreamer_python" &> /dev/null; then + echo 'nnstreamer_python module exists' + else + echo 'nnstreamer_python module does not exist' + report + exit + fi fi FRAMEWORK="python3" -# This symlink is necessary only for testcases; when installed, symlinks will be made -pushd ../../build/ext/nnstreamer/tensor_filter -TEST_PYTHONPATH=${FRAMEWORK}_pymodule -mkdir -p ${TEST_PYTHONPATH} -pushd ${TEST_PYTHONPATH} -# Covert to an absolute path from the relative path -export PYTHONPATH=$(pwd) -if [[ ! -f ./nnstreamer_python.so ]]; then - ln -s ../../extra/nnstreamer_${FRAMEWORK}.so nnstreamer_python.so +if [[ -d ../../build ]]; then + # This symlink is necessary only for testcases; when installed, symlinks will be made + pushd ../../build/ext/nnstreamer/tensor_filter + TEST_PYTHONPATH=${FRAMEWORK}_pymodule + mkdir -p ${TEST_PYTHONPATH} + pushd ${TEST_PYTHONPATH} + # Covert to an absolute path from the relative path + export PYTHONPATH=$(pwd) + if [[ ! -f ./nnstreamer_python.so ]]; then + ln -s ../../extra/nnstreamer_${FRAMEWORK}.so nnstreamer_python.so + fi + popd + popd fi -popd -popd # Passthrough test PATH_TO_SCRIPT="../test_models/models/passthrough.py" -- 2.7.4