1 # Build nnstreamer subplugins and apps for test cases
2 subdir('nnstreamer_example')
4 # Set unittest install dir
5 unittest_install_dir = join_paths(unittest_base_dir, 'tests')
7 # Build and copy exe for ssat
8 copy = find_program('cp', required: true)
9 libpng_dep = dependency('libpng', required: false)
11 b2p = executable('bmp2png',
13 dependencies: [libpng_dep, glib_dep],
14 install: get_option('install-test'),
15 install_dir: unittest_install_dir
18 custom_target('copy-bmp2png',
21 command: [copy, '@INPUT@', meson.current_source_dir()],
22 build_by_default: true
27 subdir('nnstreamer_repo_dynamicity')
29 # filter_reload (Currently, the reload test for tensor filter requires tflite)
30 if tflite_support_is_available
31 subdir('nnstreamer_filter_reload')
35 gtest_dep = dependency('gtest', required: false)
37 lesser_code_quality_accepted_for_unittest_code = declare_dependency(compile_args: ['-Wno-unused-parameter', '-Wno-missing-field-initializers'])
39 # Shared library of internal APIs for nnstreamer-gtest
40 unittest_util_shared = shared_library('nnstreamer_unittest_util',
41 join_paths(meson.current_source_dir(), 'unittest_util.c'),
42 dependencies: nnstreamer_dep,
43 include_directories: nnstreamer_inc,
44 install: get_option('install-test'),
45 install_dir: nnstreamer_libdir
47 unittest_util_dep = declare_dependency(link_with: unittest_util_shared,
48 dependencies: nnstreamer_dep,
49 compile_args: ['-DFAKEDLOG=1'],
50 include_directories: include_directories('.')
53 nnstreamer_unittest_deps = [
55 nnstreamer_internal_deps,
61 lesser_code_quality_accepted_for_unittest_code
65 unittest_common = executable('unittest_common',
66 join_paths('common', 'unittest_common.cc'),
67 dependencies: [nnstreamer_unittest_deps],
68 install: get_option('install-test'),
69 install_dir: unittest_install_dir
72 test('unittest_common', unittest_common, env: testenv)
75 gst18_dep = dependency('gstreamer-' + gst_api_verision, version : '>=1.8', required : false)
77 unittest_sink = executable('unittest_sink',
78 join_paths('nnstreamer_sink', 'unittest_sink.cc'),
79 dependencies: [nnstreamer_unittest_deps],
80 install: get_option('install-test'),
81 install_dir: unittest_install_dir
84 test('unittest_sink', unittest_sink, timeout: 120, env: testenv)
86 # Run unittest_plugins
87 unittest_plugins = executable('unittest_plugins',
88 join_paths('nnstreamer_plugins', 'unittest_plugins.cc'),
89 dependencies: [nnstreamer_unittest_deps],
90 install: get_option('install-test'),
91 install_dir: unittest_install_dir
94 test('unittest_plugins', unittest_plugins, env: testenv)
97 unittest_if = executable('unittest_if',
98 join_paths('nnstreamer_if', 'unittest_if.cc'),
99 dependencies: [nnstreamer_unittest_deps],
100 install: get_option('install-test'),
101 install_dir: unittest_install_dir
104 test('unittest_if', unittest_if, env: testenv)
107 unittest_rate = executable('unittest_rate',
108 join_paths('nnstreamer_rate', 'unittest_rate.cc'),
109 dependencies: [nnstreamer_unittest_deps],
110 install: get_option('install-test'),
111 install_dir: unittest_install_dir
114 test('unittest_rate', unittest_rate, env: testenv)
116 # Run unittest_filter_single
117 unittest_filter_single = executable('unittest_filter_single',
118 join_paths('nnstreamer_filter_single', 'unittest_filter_single.cc'),
119 dependencies: [nnstreamer_unittest_deps],
120 install: get_option('install-test'),
121 install_dir: unittest_install_dir
124 test('unittest_filter_single', unittest_filter_single, env: testenv)
127 unittest_join = executable('unittest_join',
128 join_paths('gstreamer_join', 'unittest_join.cc'),
129 dependencies: [nnstreamer_unittest_deps, join_dep],
130 install: get_option('install-test'),
131 install_dir: unittest_install_dir
134 test('unittest_join', unittest_join, env: testenv)
137 unittest_query = executable('unittest_query',
138 join_paths('nnstreamer_query', 'unittest_query.cc'),
139 dependencies: [nnstreamer_unittest_deps],
140 install: get_option('install-test'),
141 install_dir: unittest_install_dir
144 test('unittest_query', unittest_query, env: testenv)
147 if mqtt_support_is_available
148 unittest_mqtt_w_helper = executable('unittest_mqtt_w_helper',
149 join_paths('gstreamer_mqtt', 'unittest_mqtt_w_helper.cc'),
150 dependencies: [gstmqtt_mocking_dep, nnstreamer_unittest_deps],
151 install: get_option('install-test'),
152 install_dir: unittest_install_dir)
154 test('unittest_mqtt_w_helper', unittest_mqtt_w_helper, env: testenv)
156 unittest_mqtt = executable('unittest_mqtt',
157 join_paths('gstreamer_mqtt', 'unittest_mqtt.cc'),
158 dependencies: [nnstreamer_unittest_deps],
159 install: get_option('install-test'),
160 install_dir: unittest_install_dir)
162 test('unittest_mqtt', unittest_mqtt, env: testenv)
165 # Run unittest_src_iio
166 if build_platform != 'macos'
167 unittest_src_iio = executable('unittest_src_iio',
168 join_paths('nnstreamer_source', 'unittest_src_iio.cc'),
169 dependencies: [nnstreamer_unittest_deps],
170 install: get_option('install-test'),
171 install_dir: unittest_install_dir
174 test('unittest_src_iio', unittest_src_iio, timeout: 120, env: testenv)
177 # Run unittest_converter
178 if flatbuf_support_is_available
179 unittest_converter = executable('unittest_converter',
180 join_paths('nnstreamer_converter', 'unittest_converter.cc'),
181 dependencies: [nnstreamer_unittest_deps, flatbuf_dep, nnstreamer_python3_helper_dep],
182 install: get_option('install-test'),
183 install_dir: unittest_install_dir
186 test('unittest_converter', unittest_converter, env: testenv)
191 if armnn_support_is_available
192 unittest_filter_armnn = executable('unittest_filter_armnn',
193 join_paths('nnstreamer_filter_armnn', 'unittest_filter_armnn.cc'),
194 dependencies: [nnstreamer_unittest_deps, armnn_plugin_dep],
195 install: get_option('install-test'),
196 install_dir: unittest_install_dir
199 test('unittest_filter_armnn', unittest_filter_armnn, env: testenv)
203 if lua_support_is_available
204 unittest_filter_lua = executable('unittest_filter_lua',
205 join_paths('nnstreamer_filter_lua', 'unittest_filter_lua.cc'),
206 dependencies: [nnstreamer_unittest_deps],
207 install: get_option('install-test'),
208 install_dir: unittest_install_dir
211 test('unittest_filter_lua', unittest_filter_lua, env: testenv)
215 if snpe_support_is_available
216 unittest_filter_snpe = executable('unittest_filter_snpe',
217 join_paths('nnstreamer_filter_snpe', 'unittest_filter_snpe.cc'),
218 dependencies: [nnstreamer_unittest_deps],
219 install: get_option('install-test'),
220 install_dir: unittest_install_dir
223 test('unittest_filter_snpe', unittest_filter_snpe, env: testenv)
226 # tensorflow2-lite unittest
227 if tflite2_support_is_available
228 unittest_filter_tensorflow2_lite = executable('unittest_filter_tensorflow2_lite',
229 join_paths('nnstreamer_filter_tensorflow2_lite', 'unittest_filter_tensorflow2_lite.cc'),
230 dependencies: [nnstreamer_unittest_deps],
231 install: get_option('install-test'),
232 install_dir: unittest_install_dir
235 test('unittest_filter_tensorflow2_lite', unittest_filter_tensorflow2_lite, env: testenv)
238 # Run unittest_decoder
239 if flatbuf_support_is_available
240 unittest_decoder = executable('unittest_decoder',
241 join_paths('nnstreamer_decoder', 'unittest_decoder.cc'),
242 dependencies: [nnstreamer_unittest_deps, flatbuf_dep],
243 install: get_option('install-test'),
244 install_dir: unittest_install_dir
247 test('unittest_decoder', unittest_decoder, env: testenv)
251 if grpc_support_is_available
252 unittest_grpc = executable('unittest_grpc',
253 join_paths('nnstreamer_grpc', 'unittest_grpc.cc'),
254 dependencies: nnstreamer_unittest_deps,
255 install: get_option('install-test'),
256 install_dir: unittest_install_dir
259 test('unittest_grpc', unittest_grpc, env: testenv)
263 if get_option('enable-tizen-sensor')
264 subdir('tizen_sensor')
267 # Tensor filter extensions basic test cases
268 subdir('nnstreamer_filter_extensions_common')
271 if nnfw_runtime_support_is_available
272 subdir('tizen_nnfw_runtime')
275 if (tflite_support_is_available or tflite2_support_is_available) and get_option('enable-edgetpu')
276 subdir('nnstreamer_filter_edgetpu')
279 if mvncsdk2_support_is_available
280 subdir('nnstreamer_filter_mvncsdk2')
283 if tvm_support_is_available
284 subdir('nnstreamer_filter_tvm')
287 if get_option('enable-cppfilter')
288 subdir('cpp_methods')
291 if get_option('enable-openvino')
292 subdir('nnstreamer_filter_openvino')
294 endif # gtest_dep.found()
296 tensor_filter_ext_enabled = tflite_support_is_available or \
297 tflite2_support_is_available or \
298 tf_support_is_available or \
300 pytorch_support_is_available or caffe2_support_is_available or \
301 nnfw_runtime_support_is_available or get_option('enable-edgetpu') or \
302 mvncsdk2_support_is_available or get_option('enable-openvino')
303 if get_option('install-test') and tensor_filter_ext_enabled
304 install_subdir('test_models', install_dir: unittest_install_dir)
309 if get_option('install-test')
310 install_data('gen24bBMP.py', install_dir: unittest_install_dir)
311 install_data('test_utils.py', install_dir: unittest_install_dir)
312 install_subdir('nnstreamer_converter', install_dir: unittest_install_dir)
313 install_subdir('nnstreamer_merge', install_dir: unittest_install_dir)
314 install_subdir('nnstreamer_decoder', install_dir: unittest_install_dir)
315 install_subdir('nnstreamer_decoder_boundingbox', install_dir: unittest_install_dir)
316 install_subdir('nnstreamer_decoder_pose', install_dir: unittest_install_dir)
317 install_subdir('nnstreamer_demux', install_dir: unittest_install_dir)
318 install_subdir('nnstreamer_filter_custom', install_dir: unittest_install_dir)
319 if tflite_support_is_available
320 install_subdir('nnstreamer_filter_tensorflow_lite', install_dir: unittest_install_dir)
321 install_subdir('nnstreamer_decoder_image_labeling', install_dir: unittest_install_dir)
322 install_subdir('nnstreamer_decoder_image_segment', install_dir: unittest_install_dir)
323 install_subdir('nnstreamer_filter_reload', install_dir: unittest_install_dir)
325 if tflite2_support_is_available
326 install_subdir('nnstreamer_filter_tensorflow2_lite', install_dir: unittest_install_dir)
329 if flatbuf_support_is_available
330 install_subdir('nnstreamer_converter_python3', install_dir: unittest_install_dir)
331 install_subdir('nnstreamer_decoder_python3', install_dir: unittest_install_dir)
333 install_subdir('nnstreamer_filter_python3', install_dir: unittest_install_dir)
335 if tf_support_is_available
336 install_subdir('nnstreamer_filter_tensorflow', install_dir: unittest_install_dir)
338 if pytorch_support_is_available
339 install_subdir('nnstreamer_filter_pytorch', install_dir: unittest_install_dir)
341 if caffe2_support_is_available
342 install_subdir('nnstreamer_filter_caffe2', install_dir: unittest_install_dir)
344 if flatbuf_support_is_available
345 install_subdir('nnstreamer_flatbuf', install_dir: unittest_install_dir)
346 install_subdir('nnstreamer_flexbuf', install_dir: unittest_install_dir)
348 if protobuf_support_is_available
349 install_subdir('nnstreamer_protobuf', install_dir: unittest_install_dir)
351 install_subdir('nnstreamer_mux', install_dir: unittest_install_dir)
352 install_subdir('nnstreamer_rate', install_dir: unittest_install_dir)
353 install_subdir('nnstreamer_repo', install_dir: unittest_install_dir)
354 install_subdir('nnstreamer_repo_dynamicity', install_dir: unittest_install_dir)
355 install_subdir('nnstreamer_repo_lstm', install_dir: unittest_install_dir)
356 install_subdir('nnstreamer_repo_rnn', install_dir: unittest_install_dir)
357 install_subdir('nnstreamer_split', install_dir: unittest_install_dir)
358 install_subdir('transform_arithmetic', install_dir: unittest_install_dir)
359 install_subdir('transform_clamp', install_dir: unittest_install_dir)
360 install_subdir('transform_dimchg', install_dir: unittest_install_dir)
361 install_subdir('transform_stand', install_dir: unittest_install_dir)
362 install_subdir('transform_transpose', install_dir: unittest_install_dir)
363 install_subdir('transform_typecast', install_dir: unittest_install_dir)