1 # These custom filters are used in unittest_sink.
2 library('nnscustom_framecounter',
3 join_paths('nnstreamer_sink', 'nnscustom_framecounter.c'),
4 dependencies: [glib_dep, gst_dep, nnstreamer_dep],
5 install: get_option('install-test'),
6 install_dir: customfilter_install_dir
9 library('nnscustom_drop_buffer',
10 join_paths('nnstreamer_sink', 'nnscustom_drop_buffer.c'),
11 dependencies: [glib_dep, gst_dep, nnstreamer_dep],
12 install: get_option('install-test'),
13 install_dir: customfilter_install_dir
16 # Build and copy exe for ssat
17 copy = find_program('cp', required: true)
18 libpng_dep = dependency('libpng', required: false)
20 b2p = executable('bmp2png',
22 dependencies: [libpng_dep, glib_dep],
23 install: get_option('install-test'),
24 install_dir: unittest_install_dir
27 custom_target('copy-bmp2png',
30 command: [copy, '@INPUT@', meson.current_source_dir()],
31 build_by_default: true
36 subdir('nnstreamer_repo_dynamicity')
38 # filter_reload (Currently, the reload test for tensor filter requires tflite)
39 if tflite_support_is_available
40 subdir('nnstreamer_filter_reload')
44 gtest_dep = dependency('gtest', required: false)
46 nnstreamer_unittest_deps = [
48 nnstreamer_internal_deps,
56 # Shared library of internal APIs for nnstreamer-gtest
57 unittest_util_shared = shared_library('nnstreamer_unittest_util',
58 join_paths(meson.current_source_dir(), 'unittest_util.c'),
59 dependencies: nnstreamer_base_deps,
60 include_directories: nnstreamer_inc,
61 install: get_option('install-test'),
62 install_dir: nnstreamer_libdir
64 unittest_util_dep = declare_dependency(link_with: unittest_util_shared,
65 dependencies: nnstreamer_base_deps,
66 include_directories: include_directories('.')
70 unittest_common = executable('unittest_common',
71 join_paths('common', 'unittest_common.cc'),
72 dependencies: [nnstreamer_unittest_deps],
73 install: get_option('install-test'),
74 install_dir: unittest_install_dir
77 test('unittest_common', unittest_common, env: testenv)
80 gst18_dep = dependency('gstreamer-' + gst_api_verision, version : '>=1.8', required : false)
82 unittest_sink = executable('unittest_sink',
83 join_paths('nnstreamer_sink', 'unittest_sink.cc'),
84 dependencies: [nnstreamer_unittest_deps, unittest_util_dep],
85 install: get_option('install-test'),
86 install_dir: unittest_install_dir
89 test('unittest_sink', unittest_sink, timeout: 120, env: testenv)
91 # Run unittest_plugins
92 unittest_plugins = executable('unittest_plugins',
93 join_paths('nnstreamer_plugins', 'unittest_plugins.cc'),
94 dependencies: [nnstreamer_unittest_deps],
95 install: get_option('install-test'),
96 install_dir: unittest_install_dir
99 test('unittest_plugins', unittest_plugins, env: testenv)
101 # Run unittest_src_iio
102 if build_platform != 'macos'
103 unittest_src_iio = executable('unittest_src_iio',
104 join_paths('nnstreamer_source', 'unittest_src_iio.cc'),
105 dependencies: [nnstreamer_unittest_deps, unittest_util_dep],
106 install: get_option('install-test'),
107 install_dir: unittest_install_dir
110 test('unittest_src_iio', unittest_src_iio, timeout: 120, env: testenv)
115 if armnn_support_is_available
116 unittest_filter_armnn = executable('unittest_filter_armnn',
117 join_paths('nnstreamer_filter_armnn', 'unittest_filter_armnn.cc'),
118 dependencies: [glib_dep, gst_dep, nnstreamer_dep, gtest_dep, armnn_plugin_dep],
119 install: get_option('install-test'),
120 install_dir: unittest_install_dir
123 test('unittest_filter_armnn', unittest_filter_armnn, env: testenv)
127 if get_option('enable-capi')
131 # Tensor filter extensions basic test cases
132 subdir('nnstreamer_filter_extensions_common')
135 if nnfw_runtime_support_is_available
136 subdir('tizen_nnfw_runtime')
139 if tflite_support_is_available and get_option('enable-edgetpu')
140 subdir('nnstreamer_filter_edgetpu')
143 if mvncsdk2_support_is_available
144 subdir('nnstreamer_filter_mvncsdk2')
147 if get_option('enable-cppfilter')
148 subdir('cpp_methods')
151 if get_option('enable-openvino')
152 subdir('nnstreamer_filter_openvino')
154 endif # gtest_dep.found()
156 # Install data required for unittest
157 unittest_tests_install_dir = join_paths(unittest_install_dir,'tests')
159 tensor_filter_ext_enabled = tflite_support_is_available or \
160 tf_support_is_available or \
161 have_python2 or have_python3 or \
162 pytorch_support_is_available or caffe2_support_is_available or \
163 nnfw_runtime_support_is_available or get_option('enable-edgetpu') or \
164 mvncsdk2_support_is_available or get_option('enable-openvino')
165 if get_option('install-test') and (get_option('enable-capi') or tensor_filter_ext_enabled)
166 install_subdir('test_models', install_dir: unittest_tests_install_dir)
171 if get_option('install-test')
172 install_data('gen24bBMP.py', install_dir: unittest_tests_install_dir)
173 install_subdir('nnstreamer_converter', install_dir: unittest_tests_install_dir)
174 install_subdir('nnstreamer_merge', install_dir: unittest_tests_install_dir)
175 install_subdir('nnstreamer_decoder', install_dir: unittest_tests_install_dir)
176 install_subdir('nnstreamer_demux', install_dir: unittest_tests_install_dir)
177 install_subdir('nnstreamer_filter_custom', install_dir: unittest_tests_install_dir)
178 if tflite_support_is_available
179 install_subdir('nnstreamer_filter_tensorflow_lite', install_dir: unittest_tests_install_dir)
180 install_subdir('nnstreamer_decoder_image_labeling', install_dir: unittest_tests_install_dir)
181 install_subdir('nnstreamer_filter_reload', install_dir: unittest_tests_install_dir)
183 if tflite2_support_is_available
184 install_subdir('nnstreamer_filter_tensorflow2_lite', install_dir: unittest_tests_install_dir)
186 if have_python2 or have_python3
187 install_subdir('nnstreamer_filter_python', install_dir: unittest_tests_install_dir)
189 if tf_support_is_available
190 install_subdir('nnstreamer_filter_tensorflow', install_dir: unittest_tests_install_dir)
192 if pytorch_support_is_available
193 install_subdir('nnstreamer_filter_pytorch', install_dir: unittest_tests_install_dir)
195 if caffe2_support_is_available
196 install_subdir('nnstreamer_filter_caffe2', install_dir: unittest_tests_install_dir)
198 if mvncsdk2_support_is_available
199 install_subdir('unittest_filter_mvncsdk2', install_dir: unittest_tests_install_dir)
201 install_subdir('nnstreamer_mux', install_dir: unittest_tests_install_dir)
202 install_subdir('nnstreamer_repo', install_dir: unittest_tests_install_dir)
203 install_subdir('nnstreamer_repo_dynamicity', install_dir: unittest_tests_install_dir)
204 install_subdir('nnstreamer_repo_lstm', install_dir: unittest_tests_install_dir)
205 install_subdir('nnstreamer_repo_rnn', install_dir: unittest_tests_install_dir)
206 install_subdir('nnstreamer_split', install_dir: unittest_tests_install_dir)
207 install_subdir('transform_arithmetic', install_dir: unittest_tests_install_dir)
208 install_subdir('transform_dimchg', install_dir: unittest_tests_install_dir)
209 install_subdir('transform_stand', install_dir: unittest_tests_install_dir)
210 install_subdir('transform_transpose', install_dir: unittest_tests_install_dir)
211 install_subdir('transform_typecast', install_dir: unittest_tests_install_dir)
212 if get_option('enable-cppfilter')
213 install_subdir('cpp_methods', install_dir: unittest_tests_install_dir)