[Test] Allow to execute tests of a single category.
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Fri, 13 Jul 2018 06:20:52 +0000 (15:20 +0900)
committer함명주/동작제어Lab(SR)/Principal Engineer/삼성전자 <myungjoo.ham@samsung.com>
Mon, 16 Jul 2018 02:34:43 +0000 (11:34 +0900)
We now can execute a single "runTest.sh" instead of
"testAll.sh"

Fixes #188

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
tests/testAPI.sh

index 3b1e2b0..52e256a 100644 (file)
@@ -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