[TensorMux] Add 3 Test Cases
authorjijoong.moon <jijoong.moon@samsung.com>
Wed, 11 Jul 2018 09:13:31 +0000 (18:13 +0900)
committer함명주/동작제어Lab(SR)/Principal Engineer/삼성전자 <myungjoo.ham@samsung.com>
Mon, 16 Jul 2018 04:47:32 +0000 (13:47 +0900)
Add three test cases.
- one tensor sink pad --> mux --> tensors
- two tensor sink pads --> mux --> tensors ( two gstmem )
- three tensor sink pads --> mux --> tensors ( three gstmem )

Signed-off-by: jijoong.moon <jijoong.moon@samsung.com>
packaging/nnstreamer.spec
packaging/testcase_mux.tar.gz [new file with mode: 0644]
tests/nnstreamer_converter/generateGoldenTestResult.py
tests/nnstreamer_mux/runTest.sh [new file with mode: 0755]

index fae5d3a..c0f5853 100644 (file)
@@ -13,6 +13,7 @@ Source2001:   testcase_tensor_converter.tar.gz
 Source20010:   testcase_tensor_converter_stream.tar.gz
 Source2002:    testcase_tensor_decoder.tar.gz
 Source2003:    testcase_tensors.tar.gz
+Source2004:    testcase_mux.tar.gz
 
 Requires:      gstreamer >= 1.8.0
 Requires:      libdlog
@@ -99,6 +100,9 @@ popd
 pushd nnstreamer_tensors
 tar -xf %{SOURCE2003}
 popd
+pushd nnstreamer_mux
+tar -xf %{SOURCE2004}
+popd
 
 popd
 
diff --git a/packaging/testcase_mux.tar.gz b/packaging/testcase_mux.tar.gz
new file mode 100644 (file)
index 0000000..e13c751
Binary files /dev/null and b/packaging/testcase_mux.tar.gz differ
index 5fb0c05..b68aad1 100755 (executable)
@@ -329,3 +329,8 @@ if target == -1 or target == 2:
     write('testcase02_BGRx_642x480.golden', genCase02_PNG_random('BGRx', 642, 480)[0])
 if target == -1 or target == 8:
     genCase08_PNG_stream('testsequence_', 'testcase08.golden')
+if target == -1 or target == 9:
+    str = genCase02_PNG_random('RGB', 100, 100)[0]
+    write('testcase01_RGB_100x100.golden', str)
+    write('testcase02_RGB_100x100.golden', str+str)
+    write('testcase03_RGB_100x100.golden', str+str+str)
diff --git a/tests/nnstreamer_mux/runTest.sh b/tests/nnstreamer_mux/runTest.sh
new file mode 100755 (executable)
index 0000000..e6f2cf7
--- /dev/null
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+source ../testAPI.sh
+
+if [ "$SKIPGEN" == "YES" ]
+then
+  echo "Test Case Generation Skipped"
+  sopath=$2
+else
+  echo "Test Case Generation Started"
+  python ../nnstreamer_converter/generateGoldenTestResult.py 9
+  sopath=$1
+fi
+
+gstTest "--gst-plugin-path=../../build/gst --gst-debug=tensormux:5 tensormux name=mux ! filesink location=testcase01_RGB_100x100.log filesrc location=testcase02_RGB_100x100.png ! pngdec ! videoscale ! imagefreeze ! videoconvert ! video/x-raw,format=RGB,width=100,height=100,framerate=0/1  ! tensor_converter ! mux.sink_0" 1
+
+compareAllSizeLimit testcase01_RGB_100x100.golden testcase01_RGB_100x100.log 1
+
+gstTest "--gst-plugin-path=../../build/gst --gst-debug=tensormux:5 tensormux name=mux ! filesink location=testcase02_RGB_100x100.log filesrc location=testcase02_RGB_100x100.png ! pngdec ! videoscale ! imagefreeze ! videoconvert ! video/x-raw,format=RGB,width=100,height=100,framerate=0/1  ! tensor_converter ! mux.sink_0 filesrc location=testcase02_RGB_100x100.png ! pngdec ! videoscale ! imagefreeze ! videoconvert ! video/x-raw,format=RGB,width=100,height=100,framerate=0/1  ! tensor_converter ! mux.sink_1" 2
+
+compareAllSizeLimit testcase02_RGB_100x100.golden testcase02_RGB_100x100.log 2
+
+gstTest "--gst-plugin-path=../../build/gst --gst-debug=tensormux:5 tensormux name=mux ! filesink location=testcase03_RGB_100x100.log filesrc location=testcase02_RGB_100x100.png ! pngdec ! videoscale ! imagefreeze ! videoconvert ! video/x-raw,format=RGB,width=100,height=100,framerate=0/1  ! tensor_converter ! mux.sink_0 filesrc location=testcase02_RGB_100x100.png ! pngdec ! videoscale ! imagefreeze ! videoconvert ! video/x-raw,format=RGB,width=100,height=100,framerate=0/1  ! tensor_converter ! mux.sink_1 filesrc location=testcase02_RGB_100x100.png ! pngdec ! videoscale ! imagefreeze ! videoconvert ! video/x-raw,format=RGB,width=100,height=100,framerate=0/1  ! tensor_converter ! mux.sink_2" 3
+
+compareAllSizeLimit testcase03_RGB_100x100.golden testcase03_RGB_100x100.log 3
+
+report