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',
22 command: [copy, '@INPUT@', '@CURRENT_SOURCE_DIR@'],
23 build_by_default: true,
24 build_always_stale: true,
28 # Shared library of internal APIs for nnstreamer-test
29 unittest_util_shared = shared_library('nnstreamer_unittest_util',
30 join_paths(meson.current_source_dir(), 'unittest_util.c'),
31 dependencies: nnstreamer_dep,
32 include_directories: nnstreamer_inc,
33 install: get_option('install-test'),
34 install_dir: nnstreamer_libdir
36 unittest_util_dep = declare_dependency(link_with: unittest_util_shared,
37 dependencies: nnstreamer_dep,
38 compile_args: ['-DFAKEDLOG=1'],
39 include_directories: include_directories('.')
43 subdir('nnstreamer_repo_dynamicity')
45 # filter_reload (Currently, the reload test for tensor filter requires tflite)
46 if tflite2_support_is_available
47 subdir('nnstreamer_filter_reload')
51 gtest_dep = dependency('gtest', required: false)
53 lesser_code_quality_accepted_for_unittest_code = declare_dependency(compile_args: ['-Wno-unused-parameter', '-Wno-missing-field-initializers', '-Wno-maybe-uninitialized'])
55 nnstreamer_unittest_deps = [
62 lesser_code_quality_accepted_for_unittest_code
66 unittest_common = executable('unittest_common',
67 join_paths('common', 'unittest_common.cc'),
68 dependencies: [nnstreamer_unittest_deps],
69 install: get_option('install-test'),
70 install_dir: unittest_install_dir
73 test('unittest_common', unittest_common, env: testenv)
76 gst18_dep = dependency('gstreamer-' + gst_api_verision, version : '>=1.8', required : false)
78 unittest_sink = executable('unittest_sink',
79 join_paths('nnstreamer_sink', 'unittest_sink.cc'),
80 dependencies: [nnstreamer_unittest_deps],
81 install: get_option('install-test'),
82 install_dir: unittest_install_dir
85 test('unittest_sink', unittest_sink, timeout: 120, env: testenv)
87 # RUN unittest_tensor_region
88 unittest_tensor_region = executable('unittest_tensor_region',
89 join_paths('nnstreamer_decoder_tensor_region', 'unittest_tensor_region.cc'),
90 dependencies: [nnstreamer_unittest_deps],
91 install: get_option('install-test'),
92 install_dir: unittest_install_dir
94 test('unittest_tensor_region', unittest_tensor_region, env: testenv)
96 # Run unittest_plugins
97 unittest_plugins = executable('unittest_plugins',
98 join_paths('nnstreamer_plugins', 'unittest_plugins.cc'),
99 dependencies: [nnstreamer_unittest_deps, nnstreamer_internal_deps],
100 install: get_option('install-test'),
101 install_dir: unittest_install_dir
104 test('unittest_plugins', unittest_plugins, env: testenv)
107 unittest_if = executable('unittest_if',
108 join_paths('nnstreamer_if', 'unittest_if.cc'),
109 dependencies: [nnstreamer_unittest_deps],
110 install: get_option('install-test'),
111 install_dir: unittest_install_dir
114 test('unittest_if', unittest_if, env: testenv)
117 unittest_rate = executable('unittest_rate',
118 join_paths('nnstreamer_rate', 'unittest_rate.cc'),
119 dependencies: [nnstreamer_unittest_deps],
120 install: get_option('install-test'),
121 install_dir: unittest_install_dir
124 test('unittest_rate', unittest_rate, env: testenv)
126 # Run unittest_latency
127 unittest_latency = executable('unittest_latency',
128 join_paths('nnstreamer_latency', 'unittest_latency.cc'),
129 dependencies: [nnstreamer_unittest_deps],
130 install: get_option('install-test'),
131 install_dir: unittest_install_dir
134 test('unittest_latency', unittest_latency, env: testenv)
136 # Run unittest_filter_single
137 unittest_filter_single = executable('unittest_filter_single',
138 join_paths('nnstreamer_filter_single', 'unittest_filter_single.cc'),
139 dependencies: [nnstreamer_single_dep, gtest_dep, lesser_code_quality_accepted_for_unittest_code],
140 install: get_option('install-test'),
141 install_dir: unittest_install_dir
144 test('unittest_filter_single', unittest_filter_single, env: testenv)
147 unittest_join = executable('unittest_join',
148 join_paths('gstreamer_join', 'unittest_join.cc'),
149 dependencies: [nnstreamer_unittest_deps, join_dep],
150 install: get_option('install-test'),
151 install_dir: unittest_install_dir
154 test('unittest_join', unittest_join, env: testenv)
157 if mqtt_support_is_available
158 unittest_mqtt_w_helper = executable('unittest_mqtt_w_helper',
159 join_paths('gstreamer_mqtt', 'unittest_mqtt_w_helper.cc'),
160 dependencies: [gstmqtt_dep, nnstreamer_unittest_deps],
161 install: get_option('install-test'),
162 install_dir: unittest_install_dir)
164 test('unittest_mqtt_w_helper', unittest_mqtt_w_helper, env: testenv)
166 unittest_mqtt = executable('unittest_mqtt',
167 join_paths('gstreamer_mqtt', 'unittest_mqtt.cc'),
168 dependencies: [nnstreamer_unittest_deps],
169 install: get_option('install-test'),
170 install_dir: unittest_install_dir)
172 test('unittest_mqtt', unittest_mqtt, env: testenv)
175 gmock_dep = dependency('gmock', required: false)
176 if get_option('enable-tizen') and gmock_dep.found()
177 gstreamer_ntp_util_mock = executable('unittest_ntp_util',
178 join_paths('gstreamer_mqtt', 'unittest_ntp_util_mock.cc'),
179 dependencies: [nnstreamer_unittest_deps, gmock_dep, gstmqtt_dep],
180 install: get_option('install-test'),
181 install_dir: unittest_install_dir)
183 test('gstreamer_ntp_util_mock', gstreamer_ntp_util_mock, env: testenv)
187 # Run unittest_src_iio
188 if tensor_src_iio_build
189 unittest_src_iio = executable('unittest_src_iio',
190 join_paths('nnstreamer_source', 'unittest_src_iio.cc'),
191 dependencies: [nnstreamer_unittest_deps],
192 install: get_option('install-test'),
193 install_dir: unittest_install_dir
196 test('unittest_src_iio', unittest_src_iio, timeout: 120, env: testenv)
199 # Run unittest_converter
200 if flatbuf_support_is_available and have_python3
201 unittest_converter = executable('unittest_converter',
202 join_paths('nnstreamer_converter', 'unittest_converter.cc'),
203 dependencies: [nnstreamer_unittest_deps, flatbuf_dep, nnstreamer_python3_helper_dep],
204 install: get_option('install-test'),
205 install_dir: unittest_install_dir
208 test('unittest_converter', unittest_converter, env: testenv)
211 unittest_filter_custom = executable('unittest_filter_custom',
212 join_paths('nnstreamer_filter_custom', 'unittest_filter_custom.cc'),
213 dependencies: [nnstreamer_unittest_deps],
214 install: get_option('install-test'),
215 install_dir: unittest_install_dir
218 test('unittest_filter_custom', unittest_filter_custom, timeout: 120, env: testenv)
222 if armnn_support_is_available
223 unittest_filter_armnn = executable('unittest_filter_armnn',
224 join_paths('nnstreamer_filter_armnn', 'unittest_filter_armnn.cc'),
225 dependencies: [nnstreamer_unittest_deps, armnn_plugin_dep],
226 install: get_option('install-test'),
227 install_dir: unittest_install_dir
230 test('unittest_filter_armnn', unittest_filter_armnn, env: testenv)
234 if lua_support_is_available
235 unittest_filter_lua = executable('unittest_filter_lua',
236 join_paths('nnstreamer_filter_lua', 'unittest_filter_lua.cc'),
237 dependencies: [nnstreamer_unittest_deps],
238 install: get_option('install-test'),
239 install_dir: unittest_install_dir
242 test('unittest_filter_lua', unittest_filter_lua, env: testenv)
246 if snpe_support_is_available
247 unittest_filter_snpe = executable('unittest_filter_snpe',
248 join_paths('nnstreamer_filter_snpe', 'unittest_filter_snpe.cc'),
249 dependencies: [nnstreamer_unittest_deps],
250 install: get_option('install-test'),
251 install_dir: unittest_install_dir
254 test('unittest_filter_snpe', unittest_filter_snpe, env: testenv)
257 # tensorflow2-lite unittest
258 if tflite2_support_is_available
259 unittest_filter_tensorflow2_lite = executable('unittest_filter_tensorflow2_lite',
260 join_paths('nnstreamer_filter_tensorflow2_lite', 'unittest_filter_tensorflow2_lite.cc'),
261 dependencies: [nnstreamer_unittest_deps],
262 install: get_option('install-test'),
263 install_dir: unittest_install_dir
266 test('unittest_filter_tensorflow2_lite', unittest_filter_tensorflow2_lite, env: testenv)
269 # Run unittest_decoder
270 if flatbuf_support_is_available
271 unittest_decoder = executable('unittest_decoder',
272 join_paths('nnstreamer_decoder', 'unittest_decoder.cc'),
273 dependencies: [nnstreamer_unittest_deps, flatbuf_dep],
274 install: get_option('install-test'),
275 install_dir: unittest_install_dir
278 test('unittest_decoder', unittest_decoder, env: testenv)
282 if grpc_support_is_available
283 unittest_grpc = executable('unittest_grpc',
284 join_paths('nnstreamer_grpc', 'unittest_grpc.cc'),
285 dependencies: nnstreamer_unittest_deps,
286 install: get_option('install-test'),
287 install_dir: unittest_install_dir
290 test('unittest_grpc', unittest_grpc, env: testenv)
294 if get_option('enable-tizen-sensor')
295 subdir('tizen_sensor')
298 # Tensor filter extensions basic test cases
299 subdir('nnstreamer_filter_extensions_common')
302 if nnfw_runtime_support_is_available
303 subdir('tizen_nnfw_runtime')
306 if (tflite_support_is_available or tflite2_support_is_available) and get_option('enable-edgetpu')
307 subdir('nnstreamer_filter_edgetpu')
310 if mvncsdk2_support_is_available
311 subdir('nnstreamer_filter_mvncsdk2')
314 if tvm_support_is_available
315 subdir('nnstreamer_filter_tvm')
318 if get_option('enable-cppfilter')
319 subdir('cpp_methods')
322 if get_option('enable-openvino')
323 subdir('nnstreamer_filter_openvino')
326 if mxnet_support_is_available
327 subdir('nnstreamer_filter_mxnet')
330 if nnstreamer_edge_support_is_available
331 subdir('nnstreamer_edge')
334 if tflite_support_is_available or tflite2_support_is_available
335 unittest_filter_shared_model = executable('unittest_filter_shared_model',
336 join_paths('nnstreamer_filter_shared_model', 'unittest_filter_shared_model.cc'),
337 dependencies: [nnstreamer_unittest_deps, unittest_util_dep],
338 install: get_option('install-test'),
339 install_dir: unittest_install_dir
342 test('unittest_filter_shared_model', unittest_filter_shared_model, timeout: 30, env: testenv)
345 if datarepo_support_is_available
346 subdir('nnstreamer_datarepo')
349 # Run unittest_trainer
350 unittest_trainer = executable('unittest_trainer',
351 join_paths('nnstreamer_trainer', 'unittest_trainer.cc'),
352 dependencies: [nnstreamer_unittest_deps],
353 install: get_option('install-test'),
354 install_dir: unittest_install_dir
357 test('unittest_trainer', unittest_trainer, env: testenv)
359 endif # gtest_dep.found()
361 tensor_filter_ext_enabled = tflite_support_is_available or \
362 tflite2_support_is_available or \
363 tf_support_is_available or \
365 pytorch_support_is_available or caffe2_support_is_available or \
366 nnfw_runtime_support_is_available or get_option('enable-edgetpu') or \
367 mvncsdk2_support_is_available or get_option('enable-openvino') or \
368 mxnet_support_is_available
369 if get_option('install-test') and tensor_filter_ext_enabled
370 install_subdir('test_models', install_dir: unittest_install_dir)
375 if get_option('install-test')
376 install_data('gen24bBMP.py', install_dir: unittest_install_dir)
377 install_data('test_utils.py', install_dir: unittest_install_dir)
378 install_subdir('nnstreamer_converter', install_dir: unittest_install_dir)
379 install_subdir('nnstreamer_merge', install_dir: unittest_install_dir)
380 install_subdir('nnstreamer_decoder', install_dir: unittest_install_dir)
381 install_subdir('nnstreamer_decoder_boundingbox', install_dir: unittest_install_dir)
382 install_subdir('nnstreamer_decoder_pose', install_dir: unittest_install_dir)
383 install_subdir('nnstreamer_demux', install_dir: unittest_install_dir)
384 install_subdir('nnstreamer_filter_custom', install_dir: unittest_install_dir)
385 if tflite_support_is_available
386 install_subdir('nnstreamer_filter_tensorflow_lite', install_dir: unittest_install_dir)
388 if tflite2_support_is_available
389 install_subdir('nnstreamer_decoder_image_labeling', install_dir: unittest_install_dir)
390 install_subdir('nnstreamer_decoder_image_segment', install_dir: unittest_install_dir)
391 install_subdir('nnstreamer_filter_reload', install_dir: unittest_install_dir)
392 install_subdir('nnstreamer_filter_tensorflow2_lite', install_dir: unittest_install_dir)
395 if flatbuf_support_is_available
396 install_subdir('nnstreamer_converter_python3', install_dir: unittest_install_dir)
397 install_subdir('nnstreamer_decoder_python3', install_dir: unittest_install_dir)
399 install_subdir('nnstreamer_filter_python3', install_dir: unittest_install_dir)
401 if tf_support_is_available
402 install_subdir('nnstreamer_filter_tensorflow', install_dir: unittest_install_dir)
404 if pytorch_support_is_available
405 install_subdir('nnstreamer_filter_pytorch', install_dir: unittest_install_dir)
407 if caffe2_support_is_available
408 install_subdir('nnstreamer_filter_caffe2', install_dir: unittest_install_dir)
410 if deepview_rt_support_is_available
411 install_subdir('nnstreamer_filter_deepview_rt', install_dir: unittest_install_dir)
413 if flatbuf_support_is_available
414 install_subdir('nnstreamer_flatbuf', install_dir: unittest_install_dir)
415 install_subdir('nnstreamer_flexbuf', install_dir: unittest_install_dir)
417 if protobuf_support_is_available
418 install_subdir('nnstreamer_protobuf', install_dir: unittest_install_dir)
420 if mxnet_support_is_available
421 install_subdir('unittest_filter_mxnet', install_dir: unittest_install_dir)
423 install_subdir('nnstreamer_mux', install_dir: unittest_install_dir)
424 install_subdir('nnstreamer_rate', install_dir: unittest_install_dir)
425 install_subdir('nnstreamer_repo', install_dir: unittest_install_dir)
426 install_subdir('nnstreamer_repo_dynamicity', install_dir: unittest_install_dir)
427 install_subdir('nnstreamer_repo_lstm', install_dir: unittest_install_dir)
428 install_subdir('nnstreamer_repo_rnn', install_dir: unittest_install_dir)
429 install_subdir('nnstreamer_split', install_dir: unittest_install_dir)
430 install_subdir('transform_arithmetic', install_dir: unittest_install_dir)
431 install_subdir('transform_clamp', install_dir: unittest_install_dir)
432 install_subdir('transform_dimchg', install_dir: unittest_install_dir)
433 install_subdir('transform_stand', install_dir: unittest_install_dir)
434 install_subdir('transform_transpose', install_dir: unittest_install_dir)
435 install_subdir('transform_typecast', install_dir: unittest_install_dir)