From d0e732b1410eef451843e7785a0a23bcba681faf Mon Sep 17 00:00:00 2001 From: Dongju Chae Date: Tue, 13 Jul 2021 11:31:58 +0900 Subject: [PATCH] [Plugin/Test] Plugin test refactoring This patch changes plugin test program paths. Signed-off-by: Dongju Chae --- packaging/npu-engine.spec | 22 ++++++++++++++++++---- plugins/npumgr/meson.build | 1 - tests/plugins/meson.build | 19 +++++-------------- tests/plugins/nnstreamer/meson.build | 15 +++++++++++++++ tests/plugins/{ => nnstreamer}/nnstreamer_test.cc | 0 .../tests => tests/plugins/npumgr}/meson.build | 8 ++++++-- .../tests => tests/plugins/npumgr}/npumgr_test.cc | 0 7 files changed, 44 insertions(+), 21 deletions(-) create mode 100644 tests/plugins/nnstreamer/meson.build rename tests/plugins/{ => nnstreamer}/nnstreamer_test.cc (100%) rename {plugins/npumgr/tests => tests/plugins/npumgr}/meson.build (55%) rename {plugins/npumgr/tests => tests/plugins/npumgr}/npumgr_test.cc (100%) diff --git a/packaging/npu-engine.spec b/packaging/npu-engine.spec index 12062cf..fc9eb42 100644 --- a/packaging/npu-engine.spec +++ b/packaging/npu-engine.spec @@ -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 diff --git a/plugins/npumgr/meson.build b/plugins/npumgr/meson.build index c67c380..9b00aa4 100644 --- a/plugins/npumgr/meson.build +++ b/plugins/npumgr/meson.build @@ -3,4 +3,3 @@ npumgr_common_inc = include_directories('common') # dummy npu manager subdir('dummy') -subdir('tests') diff --git a/tests/plugins/meson.build b/tests/plugins/meson.build index d02580f..ce5dc4c 100644 --- a/tests/plugins/meson.build +++ b/tests/plugins/meson.build @@ -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 index 0000000..2d88763 --- /dev/null +++ b/tests/plugins/nnstreamer/meson.build @@ -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 diff --git a/tests/plugins/nnstreamer_test.cc b/tests/plugins/nnstreamer/nnstreamer_test.cc similarity index 100% rename from tests/plugins/nnstreamer_test.cc rename to tests/plugins/nnstreamer/nnstreamer_test.cc diff --git a/plugins/npumgr/tests/meson.build b/tests/plugins/npumgr/meson.build similarity index 55% rename from plugins/npumgr/tests/meson.build rename to tests/plugins/npumgr/meson.build index 918a998..6b44d34 100644 --- a/plugins/npumgr/tests/meson.build +++ b/tests/plugins/npumgr/meson.build @@ -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) diff --git a/plugins/npumgr/tests/npumgr_test.cc b/tests/plugins/npumgr/npumgr_test.cc similarity index 100% rename from plugins/npumgr/tests/npumgr_test.cc rename to tests/plugins/npumgr/npumgr_test.cc -- 2.7.4