[test/SSAT] Check flatbuf and protobuf decoder sub-plugins
authorYongjoo Ahn <yongjoo1.ahn@samsung.com>
Mon, 18 Jan 2021 07:35:18 +0000 (16:35 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 8 Feb 2021 04:43:59 +0000 (13:43 +0900)
- Check existence of flatbuf and protobuf sub-plugins for decoder SSAT test

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
tests/nnstreamer_decoder/runTest.sh

index 10b2f53..7681690 100644 (file)
@@ -59,23 +59,40 @@ callCompareTest testcase3.con.log testcase3.dec.log 3 "Compare for case 3" 0 0
 gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc ! tensor_converter ! tensor_decoder mode=direct_video ! video/mpeg ! fakesink" 4F_n 0 1 $PERFORMANCE
 
 # Dynamic tensor config update test
-## After converting the flatbuf to the tensor, it is tested whether the config is updated in runtime.
-gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc num-buffers=3 ! videoconvert ! video/x-raw, width=640, height=480, framerate=5/1,format=RGB ! \
-    tee name=t ! queue ! multifilesink location=\"test_05_raw_%1d.log\"
-    t. ! queue ! tensor_converter ! tensor_decoder mode=flatbuf ! other/flatbuf-tensor ! tensor_converter ! \
-        tensor_decoder mode=direct_video ! multifilesink location=\"test_05_decoded_%1d.log\" sync=true" 5 "Flatbuf dynamic tensor config update" 0 0 $PERFORMANCE
-callCompareTest test_05_raw_0.log test_05_decoded_0.log 5-1 "Compare for case 5-1" 1 0
-callCompareTest test_05_raw_1.log test_05_decoded_1.log 5-2 "Compare for case 5-2" 1 0
-callCompareTest test_05_raw_2.log test_05_decoded_2.log 5-3 "Compare for case 5-3" 1 0
 
-## After converting the protobuf to the tensor, it is tested whether the config is updated in runtime.
-gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc num-buffers=3 ! videoconvert ! video/x-raw, width=640, height=480, framerate=5/1,format=RGB ! \
-    tee name=t ! queue ! multifilesink location=\"test_06_raw_%1d.log\"
-    t. ! queue ! tensor_converter ! tensor_decoder mode=protobuf ! other/protobuf-tensor ! tensor_converter ! \
-        tensor_decoder mode=direct_video ! multifilesink location=\"test_06_decoded_%1d.log\" sync=true" 6 "Protobuf dynamic tensor config update" 0 0 $PERFORMANCE
-callCompareTest test_06_raw_0.log test_06_decoded_0.log 6-1 "Compare for case 6-1" 1 0
-callCompareTest test_06_raw_1.log test_06_decoded_1.log 6-2 "Compare for case 6-2" 1 0
-callCompareTest test_06_raw_2.log test_06_decoded_2.log 6-3 "Compare for case 6-3" 1 0
+# Check existence of tensor_decoder && tensor_converter flatbuf sub-plugin
+check_decoder=$(gst-inspect-1.0 --gst-plugin-path=${PATH_TO_PLUGIN} tensor_decoder | grep flatbuf)
+check_converter=$(gst-inspect-1.0 --gst-plugin-path=${PATH_TO_PLUGIN} tensor_converter | grep flatbuf)
+if [[ ! $check_decoder || ! $check_converter ]]; then
+    echo "Cannot find flatbuf sub-plugin"
+    echo "Skip flatbuf related tests"
+else
+    ## After converting the flatbuf to the tensor, it is tested whether the config is updated in runtime.
+    gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc num-buffers=3 ! videoconvert ! video/x-raw, width=640, height=480, framerate=5/1,format=RGB ! \
+        tee name=t ! queue ! multifilesink location=\"test_05_raw_%1d.log\"
+        t. ! queue ! tensor_converter ! tensor_decoder mode=flatbuf ! other/flatbuf-tensor ! tensor_converter ! \
+            tensor_decoder mode=direct_video ! multifilesink location=\"test_05_decoded_%1d.log\" sync=true" 5 0 0 $PERFORMANCE
+    callCompareTest test_05_raw_0.log test_05_decoded_0.log 5-1 "Compare for case 5-1" 1 0
+    callCompareTest test_05_raw_1.log test_05_decoded_1.log 5-2 "Compare for case 5-2" 1 0
+    callCompareTest test_05_raw_2.log test_05_decoded_2.log 5-3 "Compare for case 5-3" 1 0
+fi
+
+# Check existence of tensor_decoder && tensor_converter protobuf sub-plugin
+check_decoder=$(gst-inspect-1.0 --gst-plugin-path=${PATH_TO_PLUGIN} tensor_decoder | grep protobuf)
+check_converter=$(gst-inspect-1.0 --gst-plugin-path=${PATH_TO_PLUGIN} tensor_converter | grep protobuf)
+if [[ ! $check_decoder || ! $check_converter ]]; then
+    echo "Cannot find protobuf sub-plugin"
+    echo "Skip protobuf related tests"
+else
+    ## After converting the protobuf to the tensor, it is tested whether the config is updated in runtime.
+    gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc num-buffers=3 ! videoconvert ! video/x-raw, width=640, height=480, framerate=5/1,format=RGB ! \
+        tee name=t ! queue ! multifilesink location=\"test_06_raw_%1d.log\"
+        t. ! queue ! tensor_converter ! tensor_decoder mode=protobuf ! other/protobuf-tensor ! tensor_converter ! \
+            tensor_decoder mode=direct_video ! multifilesink location=\"test_06_decoded_%1d.log\" sync=true" 6 0 0 $PERFORMANCE
+    callCompareTest test_06_raw_0.log test_06_decoded_0.log 6-1 "Compare for case 6-1" 1 0
+    callCompareTest test_06_raw_1.log test_06_decoded_1.log 6-2 "Compare for case 6-2" 1 0
+    callCompareTest test_06_raw_2.log test_06_decoded_2.log 6-3 "Compare for case 6-3" 1 0
+fi
 
 rm *.log