[Plugin/Test] Plugin test refactoring
authorDongju Chae <dongju.chae@samsung.com>
Tue, 13 Jul 2021 02:31:58 +0000 (11:31 +0900)
committer채동주/On-Device Lab(SR)/Staff Engineer/삼성전자 <dongju.chae@samsung.com>
Tue, 13 Jul 2021 06:14:46 +0000 (15:14 +0900)
This patch changes plugin test program paths.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
packaging/npu-engine.spec
plugins/npumgr/meson.build
tests/plugins/meson.build
tests/plugins/nnstreamer/meson.build [new file with mode: 0644]
tests/plugins/nnstreamer/nnstreamer_test.cc [moved from tests/plugins/nnstreamer_test.cc with 100% similarity]
tests/plugins/npumgr/meson.build [moved from plugins/npumgr/tests/meson.build with 55% similarity]
tests/plugins/npumgr/npumgr_test.cc [moved from plugins/npumgr/tests/npumgr_test.cc with 100% similarity]

index 12062cf..fc9eb42 100644 (file)
@@ -108,12 +108,29 @@ Example application package for NPU Engine, including UnitTests and AppTest with
 Requires:      npu-engine = %{version}-%{release}
 Summary:       NPU Engine Example Package
 %description utils
-This probides utility packages for NPU Engine, including metadata extraction of model files.
+This provides utility packages for NPU Engine, including metadata extraction of model files.
 %files utils
 %manifest npu-engine.manifest
 %defattr(-,root,root,-)
 %{neexampledir}/utils/*
 
+%if ( 0%{?npumgr_plugin} || 0%{?nns_plugin} )
+%package example-plugins
+Requires:      npu-engine = %{version}-%{release}
+Summary:       NPU Engine Example Package for Plugins
+%description example-plugins
+Example application package for NPU Engine plugins
+%files example-plugins
+%manifest npu-engine.manifest
+%defattr(-,root,root,-)
+%if 0%{?npumgr_plugin}
+%{neexampledir}/plugins/npumgr/*
+%endif
+%if 0%{?nns_plugin}
+%{neexampledir}/plugins/nnstreamer/*
+%endif
+%endif
+
 %if 0%{?npumgr_plugin}
 %package -n npumgr-srnpu
 Summary:       Tizen NPU Manager plugin for SR-NPU device family
@@ -122,7 +139,6 @@ Requires:   npu-engine
 Reference implementation of Tizen NPU Manager TRIV2 plugin, including a dummy NPU Manager module.
 %files -n npumgr-srnpu
 %manifest npu-engine.manifest
-%{neexampledir}/plugins/npumgr/*
 %{_libdir}/libnpumgr*.so
 %{_datadir}/dbus-1/system.d/*
 %endif
@@ -136,8 +152,6 @@ Requires:   nnstreamer
 Reference implementation of NNStreamer filter subplugin for SR-NPU (for now, TRIV2 only).
 %files -n nnstreamer-srnpu
 %manifest npu-engine.manifest
-# Uncomment below when test-cases are ready
-# %{neexampledir}/plugins/nnstreamer/*
 %{_prefix}/lib/nnstreamer/filters/libnnstreamer_filter_srnpu.so
 %endif
 
index c67c380..9b00aa4 100644 (file)
@@ -3,4 +3,3 @@ npumgr_common_inc = include_directories('common')
 
 # dummy npu manager
 subdir('dummy')
-subdir('tests')
index d02580f..ce5dc4c 100644 (file)
@@ -1,15 +1,6 @@
-if ne_test_utils_gtest_dep.found()
-  testenv = environment()
-  testenv.set('LD_LIBRARY_PATH', ne_libdir)
-
-  if get_option('enable_plugin_nns')
-    plugintest_nnstreamer = executable('plugintest_nnstreamer',
-      ['nnstreamer_test.cc'],
-      dependencies: [ne_test_utils_gtest_dep, glib_dep, gst_dep],
-      install : true,
-      install_rpath : ne_libdir,
-      install_dir : join_paths(ne_bindir, 'plugins')
-    )
-    test('plugintest_nnstreamer', plugintest_nnstreamer, env: testenv)
-  endif
+if get_option('enable_plugin_nns')
+  subdir('nnstreamer')
+endif
+if get_option('enable_plugin_npumgr')
+  subdir('npumgr')
 endif
diff --git a/tests/plugins/nnstreamer/meson.build b/tests/plugins/nnstreamer/meson.build
new file mode 100644 (file)
index 0000000..2d88763
--- /dev/null
@@ -0,0 +1,15 @@
+if ne_test_utils_gtest_dep.found()
+  testenv = environment()
+  testenv.set('LD_LIBRARY_PATH', ne_libdir)
+
+  if get_option('enable_plugin_nns')
+    plugintest_nnstreamer = executable('plugintest_nnstreamer',
+      ['nnstreamer_test.cc'],
+      dependencies: [ne_test_utils_gtest_dep, glib_dep, gst_dep],
+      install : true,
+      install_rpath : ne_libdir,
+      install_dir : join_paths(ne_bindir, 'plugins', 'nnstreamer')
+    )
+    test('plugintest_nnstreamer', plugintest_nnstreamer, env: testenv)
+  endif
+endif
similarity index 55%
rename from plugins/npumgr/tests/meson.build
rename to tests/plugins/npumgr/meson.build
index 918a998..6b44d34 100644 (file)
@@ -1,9 +1,13 @@
+testenv = environment()
+testenv.set('LD_LIBRARY_PATH', ne_libdir)
+
 # npu manager test program
-executable ('apptest_npumgr',
-  'npumgr_test.cc',
+plugintest_npumgr = executable ('plugintest_npumgr',
+  ['npumgr_test.cc'],
   include_directories : [npumgr_common_inc],
   dependencies : [glib_dep, ne_test_utils_common_dep, npumgr_dep],
   install : true,
   install_rpath : ne_libdir,
   install_dir : join_paths(ne_bindir, 'plugins', 'npumgr')
 )
+test('plugintest_npumgr', plugintest_npumgr, env: testenv)