From 1c221a8f5f28f1aebd9ea1f15e1123cf543dad21 Mon Sep 17 00:00:00 2001 From: MyungJoo Ham Date: Fri, 13 Jul 2018 15:20:52 +0900 Subject: [PATCH] [Test] Allow to execute tests of a single category. We now can execute a single "runTest.sh" instead of "testAll.sh" Fixes #188 Signed-off-by: MyungJoo Ham --- tests/testAPI.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/tests/testAPI.sh b/tests/testAPI.sh index 3b1e2b0..52e256a 100644 --- a/tests/testAPI.sh +++ b/tests/testAPI.sh @@ -2,11 +2,20 @@ if [[ $# -eq 0 ]]; then dirpath="$( cd "$( dirname "$0")" && pwd )" - find "$dirpath/../build/gst/tensor_converter" "$dirpath/../build/gst/tensor_filter" "$dirpath/../build/gst/tensor_decoder" "$dirpath/../build/gst/tensor_transform" 1>/dev/null || { - echo "[ERROR] Before unit testing, you should build with cmake first." - exit 1 - } - PATH_TO_PLUGIN="$dirpath/../build/gst/tensor_converter:$dirpath/../build/gst/tensor_filter:$dirpath/../build/gst/tensor_decoder:$dirpath/../build/gst/tensor_transform" + find "$dirpath/../build/gst/tensor_converter" "$dirpath/../build/gst/tensor_filter" "$dirpath/../build/gst/tensor_decoder" -name *.so 1>/dev/null 2>/dev/null + if [ "$?" -ne "0" ]; then + dirpath="$dirpath/../" + find "$dirpath/../build/gst/tensor_converter" "$dirpath/../build/gst/tensor_filter" "$dirpath/../build/gst/tensor_decoder" -name *.so 1>/dev/null 2>/dev/null + if [ "$?" -ne "0" ]; then + dirpath="$dirpath/../" + find "$dirpath/../build/gst/tensor_converter" "$dirpath/../build/gst/tensor_filter" "$dirpath/../build/gst/tensor_decoder" -name *.so 1>/dev/null 2>/dev/null + if [ "$?" -ne "0" ]; then + echo "[ERROR] Cannot find nnstreamer plugin binaries. Before unit testing, you should build with cmake first." + exit 1 + fi + fi + fi + PATH_TO_PLUGIN="$dirpath/../build/gst/tensor_converter:$dirpath/../build/gst/tensor_filter:$dirpath/../build/gst/tensor_decoder:$dirpath/../build/gst/tensor_transform:$dirpath/../build/gst/tensor_sink:$dirpath/../build/gst/tensor_mux" else PATH_TO_PLUGIN="$1" fi -- 2.7.4