[TEST] Enable edge releated test only.
authorgichan <gichan2.jang@samsung.com>
Tue, 23 Aug 2022 07:29:40 +0000 (16:29 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Fri, 26 Aug 2022 12:15:23 +0000 (21:15 +0900)
If "unit_test" is disabled and "edge_test" is enabled, run query and
edge test.

Signed-off-by: gichan <gichan2.jang@samsung.com>
debian/rules
packaging/nnstreamer.spec
tests/meson.build
tests/nnstreamer_edge/edge/generate_random_text.py [moved from tests/nnstreamer_edge/generate_random_text.py with 100% similarity]
tests/nnstreamer_edge/edge/runTest.sh [moved from tests/nnstreamer_edge/runTest.sh with 96% similarity]
tests/nnstreamer_edge/edge/unittest_edge.cc [moved from tests/nnstreamer_edge/unittest_edge.cc with 100% similarity]
tests/nnstreamer_edge/meson.build [new file with mode: 0644]
tests/nnstreamer_edge/query/runTest.sh [moved from tests/nnstreamer_query/runTest.sh with 96% similarity]
tests/nnstreamer_edge/query/unittest_query.cc [moved from tests/nnstreamer_query/unittest_query.cc with 100% similarity]

index 0bbab53..a88cfd6 100755 (executable)
@@ -61,6 +61,7 @@ override_dh_auto_build:
 
 override_dh_auto_test:
        ./packaging/run_unittests_binaries.sh ./tests
+       ./packaging/run_unittests_binaries.sh ./tests/nnstreamer_edge
 ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes), yes)
 ifeq ($(DEB_HOST_ARCH), amd64)
        if [ -f './tests/tizen_nnfw_runtime/unittest_nnfw_runtime_raw' ]; then ./packaging/run_unittests_binaries.sh ./tests/tizen_nnfw_runtime/unittest_nnfw_runtime_raw; fi
index 88f78c3..f03506d 100644 (file)
@@ -300,7 +300,7 @@ BuildRequires:      npu-engine-devel
 %endif
 
 # Unit Testing Uses SSAT (https://github.com/myungjoo/SSAT.git)
-%if 0%{?unit_test}
+%if 0%{?unit_test} || 0%{?edge_test}
 BuildRequires: ssat >= 1.1.0
 %endif
 
@@ -873,6 +873,7 @@ export NNSTREAMER_CONVERTERS=${NNSTREAMER_BUILD_ROOT_PATH}/ext/nnstreamer/tensor
     bash %{test_script} ./tests
     bash %{test_script} ./tests/cpp_methods
     bash %{test_script} ./tests/nnstreamer_filter_extensions_common
+    bash %{test_script} ./tests/nnstreamer_edge
 %if 0%{mvncsdk2_support}
     LD_LIBRARY_PATH=${NNSTREAMER_BUILD_ROOT_PATH}/tests/nnstreamer_filter_mvncsdk2:. bash %{test_script} ./tests/nnstreamer_filter_mvncsdk2/unittest_filter_mvncsdk2
 %endif
@@ -899,7 +900,15 @@ export NNSTREAMER_CONVERTERS=${NNSTREAMER_BUILD_ROOT_PATH}/ext/nnstreamer/tensor
     popd
 
 python3 tools/development/count_test_cases.py build tests/summary.txt
-%endif #if unit_test
+%else
+%if 0%{?edge_test}
+    bash %{test_script} tests/nnstreamer_edge
+    pushd tests/nnstreamer_edge
+    ssat -n -p=1 --summary summary.txt -cn _n
+    popd
+    python3 tools/development/count_test_cases.py build tests/nnstreamer_edge/summary.txt
+%endif
+%endif
 
 %install
 DESTDIR=%{buildroot} ninja -C build install
index c2710a5..b93401b 100644 (file)
@@ -134,30 +134,6 @@ if gtest_dep.found()
 
     test('unittest_join', unittest_join, env: testenv)
 
-    # Run unittest_query
-    if nnstreamer_edge_support_is_available
-      unittest_query = executable('unittest_query',
-        join_paths('nnstreamer_query', 'unittest_query.cc'),
-        dependencies: [nnstreamer_unittest_deps],
-        install: get_option('install-test'),
-        install_dir: unittest_install_dir
-      )
-
-      test('unittest_query', unittest_query, env: testenv)
-    endif
-
-    # Run unittest_edge
-    if nnstreamer_edge_support_is_available
-      unittest_edge = executable('unittest_edge',
-        join_paths('nnstreamer_edge', 'unittest_edge.cc'),
-        dependencies: [nnstreamer_unittest_deps],
-        install: get_option('install-test'),
-        install_dir: unittest_install_dir
-      )
-
-      test('unittest_edge', unittest_edge, env: testenv)
-    endif
-
     # Run unittest_mqtt
     if mqtt_support_is_available
       unittest_mqtt_w_helper = executable('unittest_mqtt_w_helper',
@@ -322,6 +298,10 @@ if gtest_dep.found()
   if mxnet_support_is_available
     subdir('nnstreamer_filter_mxnet')
   endif
+
+  if nnstreamer_edge_support_is_available
+    subdir('nnstreamer_edge')
+  endif
 endif # gtest_dep.found()
 
 tensor_filter_ext_enabled = tflite_support_is_available or \
similarity index 96%
rename from tests/nnstreamer_edge/runTest.sh
rename to tests/nnstreamer_edge/edge/runTest.sh
index 70fa432..e43369d 100644 (file)
@@ -45,7 +45,7 @@ function callCompareTestIfExist() {
 }
 
 # Run edge sink server as echo server with default address option. 
-PORT=`python3 ../get_available_port.py`
+PORT=`python3 ../../get_available_port.py`
 gstTestBackground "--gst-plugin-path=${PATH_TO_PLUGIN} \
     videotestsrc is-live=true ! videoconvert ! videoscale ! video/x-raw,width=300,height=300,format=RGB ! tee name=t \
         t. ! queue ! multifilesink location=raw1_%1d.log \
@@ -66,7 +66,7 @@ kill -9 $pid &> /dev/null
 wait $pid
 
 # Run edge sink server as echo server with default address option. (multi clients)
-PORT=`python3 ../get_available_port.py`
+PORT=`python3 ../../get_available_port.py`
 gstTestBackground "--gst-plugin-path=${PATH_TO_PLUGIN} \
     videotestsrc is-live=true ! videoconvert ! videoscale ! video/x-raw,width=300,height=300,format=RGB ! tee name=t \
         t. ! queue ! multifilesink location=raw2_%1d.log \
@@ -85,7 +85,7 @@ kill -9 $pid &> /dev/null
 wait $pid
 
 # Cap: Flexible Tensor
-PORT=`python3 ../get_available_port.py`
+PORT=`python3 ../../get_available_port.py`
 gstTestBackground "--gst-plugin-path=${PATH_TO_PLUGIN} \
     videotestsrc is-live=true ! videoconvert ! videoscale ! video/x-raw,width=300,height=300,format=RGB ! tensor_converter ! other/tensors,format=flexible ! tee name=t \
         t. ! queue ! multifilesink location=raw3_%1d.log \
@@ -99,7 +99,7 @@ kill -9 $pid &> /dev/null
 wait $pid
 
 # Cap: Tensor
-PORT=`python3 ../get_available_port.py`
+PORT=`python3 ../../get_available_port.py`
 gstTestBackground "--gst-plugin-path=${PATH_TO_PLUGIN} \
     videotestsrc is-live=true ! videoconvert ! videoscale ! video/x-raw,width=300,height=300,format=RGB ! tensor_converter ! other/tensors,num_tensors=1,dimensions=3:300:300:1,types=uint8,format=static ! tee name=t \
         t. ! queue ! multifilesink location=raw4_%1d.log \
@@ -113,7 +113,7 @@ kill -9 $pid &> /dev/null
 wait $pid
 
 # Cap: Audio
-PORT=`python3 ../get_available_port.py`
+PORT=`python3 ../../get_available_port.py`
 gstTestBackground "--gst-plugin-path=${PATH_TO_PLUGIN} \
     audiotestsrc ! audioconvert ! tee name=t \
         t. ! queue ! multifilesink location=raw5_%1d.log \
@@ -127,7 +127,7 @@ kill -9 $pid &> /dev/null
 wait $pid
 
 # Cap: Text
-PORT=`python3 ../get_available_port.py`
+PORT=`python3 ../../get_available_port.py`
 RANDOM_TEXT="test.txt"
 python3 generate_random_text.py "--file_name ${RANDOM_TEXT}"
 gstTestBackground "--gst-plugin-path=${PATH_TO_PLUGIN} \
diff --git a/tests/nnstreamer_edge/meson.build b/tests/nnstreamer_edge/meson.build
new file mode 100644 (file)
index 0000000..9efab9c
--- /dev/null
@@ -0,0 +1,18 @@
+unittest_edge = executable('unittest_edge',
+  join_paths('edge', 'unittest_edge.cc'),
+  dependencies: [nnstreamer_unittest_deps],
+  install: get_option('install-test'),
+  install_dir: unittest_install_dir
+)
+
+test('unittest_edge', unittest_edge, env: testenv)
+
+# Run unittest_query
+unittest_query = executable('unittest_query',
+  join_paths('query', 'unittest_query.cc'),
+  dependencies: [nnstreamer_unittest_deps],
+  install: get_option('install-test'),
+  install_dir: unittest_install_dir
+)
+
+test('unittest_query', unittest_query, env: testenv)
similarity index 96%
rename from tests/nnstreamer_query/runTest.sh
rename to tests/nnstreamer_edge/query/runTest.sh
index 031edce..73b2c6c 100644 (file)
@@ -42,7 +42,7 @@ function _callCompareTest() {
 }
 
 # Run tensor query server as echo server with default address option.
-PORT=`python3 ../get_available_port.py`
+PORT=`python3 ../../get_available_port.py`
 gstTestBackground "--gst-plugin-path=${PATH_TO_PLUGIN} tensor_query_serversrc port=${PORT} ! other/tensors,format=static,num_tensors=1,dimensions=(string)3:300:300:1,types=(string)uint8 ! tensor_query_serversink async=false" 1-1 0 0 30
 pid=$!
 gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc is-live=true num-buffers=10 ! videoconvert ! videoscale ! video/x-raw,width=300,height=300,format=RGB ! tensor_converter ! tee name = t t. ! queue ! multifilesink location= raw1_%1d.log t. ! queue ! tensor_query_client dest-port=${PORT} ! multifilesink location=result1_%1d.log sync=true " 1-2 0 0 $PERFORMANCE
@@ -54,7 +54,7 @@ kill -9 $pid &> /dev/null
 wait $pid
 
 # Run tensor query server as echo server with given address option. (multi clients)
-PORT1=`python3 ../get_available_port.py`
+PORT1=`python3 ../../get_available_port.py`
 gstTestBackground "--gst-plugin-path=${PATH_TO_PLUGIN} tensor_query_serversrc host=127.0.0.1 port=${PORT1} ! other/tensors,format=static,num_tensors=1,dimensions=(string)3:300:300:1,types=(string)uint8 ! tensor_query_serversink async=false" 2-1 0 0 30
 pid=$!
 gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc is-live=true num-buffers=10  ! videoconvert ! videoscale ! video/x-raw,width=300,height=300,format=RGB ! tensor_converter ! tee name = t t. ! queue ! multifilesink location= raw2_%1d.log t. ! queue ! tensor_query_client host=127.0.0.1 port=0 dest-host=127.0.0.1 dest-port=${PORT1} ! multifilesink location=result2_%1d.log" 2-2 0 0 $PERFORMANCE
@@ -69,7 +69,7 @@ kill -9 $pid &> /dev/null
 wait $pid
 
 # Test flexible tensors
-PORT=`python3 ../get_available_port.py`
+PORT=`python3 ../../get_available_port.py`
 gstTestBackground "--gst-plugin-path=${PATH_TO_PLUGIN} tensor_query_serversrc port=${PORT} ! other/tensors,format=flexible ! tensor_query_serversink async=false" 3-1 0 0 30
 pid=$!
 gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc is-live=true num-buffers=10  ! videoconvert ! videoscale ! video/x-raw,width=300,height=300,format=RGB ! tensor_converter ! other/tensors,format=flexible ! tee name = t t. ! queue ! multifilesink location= raw3_%1d.log t. ! queue ! tensor_query_client dest-port=${PORT} ! multifilesink location=result3_%1d.log" 3-2 0 0 $PERFORMANCE
@@ -80,10 +80,10 @@ kill -9 $pid &> /dev/null
 wait $pid
 
 # Test multiple query server src and sink.
-PORT1=`python3 ../get_available_port.py`
-PORT2=`python3 ../get_available_port.py`
-PORT3=`python3 ../get_available_port.py`
-PORT4=`python3 ../get_available_port.py`
+PORT1=`python3 ../../get_available_port.py`
+PORT2=`python3 ../../get_available_port.py`
+PORT3=`python3 ../../get_available_port.py`
+PORT4=`python3 ../../get_available_port.py`
 gstTestBackground "--gst-plugin-path=${PATH_TO_PLUGIN} tensor_query_serversrc id=0 port=${PORT1} ! other/tensors,format=flexible ! tensor_query_serversink id=0 async=false \
     tensor_query_serversrc id=1 port=${PORT2} ! other/tensors,format=flexible ! tensor_query_serversink id=1 async=false" 5-1 0 0 30
 pid=$!
@@ -109,7 +109,7 @@ kill -9 $pid &> /dev/null
 wait $pid
 
 # Sever src cap: Video, Server sink cap: Viedo test
-PORT=`python3 ../get_available_port.py`
+PORT=`python3 ../../get_available_port.py`
 gstTestBackground "--gst-plugin-path=${PATH_TO_PLUGIN} tensor_query_serversrc port=${PORT} ! video/x-raw,width=300,height=300,format=RGB,framerate=0/1 ! tensor_query_serversink async=false" 6-1 0 0 30
 pid=$!
 gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc is-live=true num-buffers=10  ! videoconvert ! videoscale ! video/x-raw,width=300,height=300,format=RGB ! tee name = t t. ! queue ! multifilesink location= raw6_%1d.log t. ! queue ! tensor_query_client dest-port=${PORT} ! multifilesink location=result6_%1d.log" 6-2 0 0 $PERFORMANCE
@@ -120,7 +120,7 @@ kill -9 $pid &> /dev/null
 wait $pid
 
 # Sever src cap: Video, Server sink cap: Tensor test
-PORT=`python3 ../get_available_port.py`
+PORT=`python3 ../../get_available_port.py`
 gstTestBackground "--gst-plugin-path=${PATH_TO_PLUGIN} tensor_query_serversrc port=${PORT} ! video/x-raw,width=300,height=300,format=RGB,framerate=0/1 ! tensor_converter ! tensor_query_serversink async=false" 7-1 0 0 30
 pid=$!
 gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc is-live=true num-buffers=10  ! videoconvert ! videoscale ! video/x-raw,width=300,height=300,format=RGB ! tee name = t t. ! queue ! multifilesink location= raw7_%1d.log t. ! queue ! tensor_query_client dest-port=${PORT} ! multifilesink location=result7_%1d.log" 7-2 0 0 $PERFORMANCE
@@ -131,7 +131,7 @@ kill -9 $pid &> /dev/null
 wait $pid
 
 # Sever src cap: Tensor, Server sink cap: Video test
-PORT=`python3 ../get_available_port.py`
+PORT=`python3 ../../get_available_port.py`
 gstTestBackground "--gst-plugin-path=${PATH_TO_PLUGIN} tensor_query_serversrc port=${PORT} ! other/tensors,format=static,num_tensors=1,dimensions=(string)3:300:300:1,types=(string)uint8,framerate=0/1 ! tensor_decoder mode=direct_video ! videoconvert ! tensor_query_serversink async=false" 8-1 0 0 30
 pid=$!
 gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc is-live=true num-buffers=10  ! videoconvert ! videoscale ! video/x-raw,width=300,height=300,format=RGB ! tensor_converter ! tee name = t t. ! queue ! multifilesink location= raw8_%1d.log t. ! queue ! tensor_query_client dest-port=${PORT} ! multifilesink location=result8_%1d.log" 8-2 0 0 $PERFORMANCE