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,
29 subdir('nnstreamer_repo_dynamicity')
31 # filter_reload (Currently, the reload test for tensor filter requires tflite)
32 if tflite_support_is_available
33 subdir('nnstreamer_filter_reload')
37 gtest_dep = dependency('gtest', required: false)
39 lesser_code_quality_accepted_for_unittest_code = declare_dependency(compile_args: ['-Wno-unused-parameter', '-Wno-missing-field-initializers', '-Wno-maybe-uninitialized'])
41 # Shared library of internal APIs for nnstreamer-gtest
42 unittest_util_shared = shared_library('nnstreamer_unittest_util',
43 join_paths(meson.current_source_dir(), 'unittest_util.c'),
44 dependencies: nnstreamer_dep,
45 include_directories: nnstreamer_inc,
46 install: get_option('install-test'),
47 install_dir: nnstreamer_libdir
49 unittest_util_dep = declare_dependency(link_with: unittest_util_shared,
50 dependencies: nnstreamer_dep,
51 compile_args: ['-DFAKEDLOG=1'],
52 include_directories: include_directories('.')
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_plugins
88 unittest_plugins = executable('unittest_plugins',
89 join_paths('nnstreamer_plugins', 'unittest_plugins.cc'),
90 dependencies: [nnstreamer_unittest_deps, nnstreamer_internal_deps],
91 install: get_option('install-test'),
92 install_dir: unittest_install_dir
95 test('unittest_plugins', unittest_plugins, env: testenv)
98 unittest_if = executable('unittest_if',
99 join_paths('nnstreamer_if', 'unittest_if.cc'),
100 dependencies: [nnstreamer_unittest_deps],
101 install: get_option('install-test'),
102 install_dir: unittest_install_dir
105 test('unittest_if', unittest_if, env: testenv)
108 unittest_rate = executable('unittest_rate',
109 join_paths('nnstreamer_rate', 'unittest_rate.cc'),
110 dependencies: [nnstreamer_unittest_deps],
111 install: get_option('install-test'),
112 install_dir: unittest_install_dir
115 test('unittest_rate', unittest_rate, env: testenv)
117 # Run unittest_latency
118 unittest_latency = executable('unittest_latency',
119 join_paths('nnstreamer_latency', 'unittest_latency.cc'),
120 dependencies: [nnstreamer_unittest_deps],
121 install: get_option('install-test'),
122 install_dir: unittest_install_dir
125 test('unittest_latency', unittest_latency, env: testenv)
127 # Run unittest_filter_single
128 unittest_filter_single = executable('unittest_filter_single',
129 join_paths('nnstreamer_filter_single', 'unittest_filter_single.cc'),
130 dependencies: [nnstreamer_single_dep, gtest_dep, lesser_code_quality_accepted_for_unittest_code],
131 install: get_option('install-test'),
132 install_dir: unittest_install_dir
135 test('unittest_filter_single', unittest_filter_single, env: testenv)
138 unittest_join = executable('unittest_join',
139 join_paths('gstreamer_join', 'unittest_join.cc'),
140 dependencies: [nnstreamer_unittest_deps, join_dep],
141 install: get_option('install-test'),
142 install_dir: unittest_install_dir
145 test('unittest_join', unittest_join, env: testenv)
148 if mqtt_support_is_available
149 unittest_mqtt_w_helper = executable('unittest_mqtt_w_helper',
150 join_paths('gstreamer_mqtt', 'unittest_mqtt_w_helper.cc'),
151 dependencies: [gstmqtt_dep, nnstreamer_unittest_deps],
152 install: get_option('install-test'),
153 install_dir: unittest_install_dir)
155 test('unittest_mqtt_w_helper', unittest_mqtt_w_helper, env: testenv)
157 unittest_mqtt = executable('unittest_mqtt',
158 join_paths('gstreamer_mqtt', 'unittest_mqtt.cc'),
159 dependencies: [nnstreamer_unittest_deps],
160 install: get_option('install-test'),
161 install_dir: unittest_install_dir)
163 test('unittest_mqtt', unittest_mqtt, env: testenv)
166 gmock_dep = dependency('gmock', required: false)
167 if get_option('enable-tizen') and gmock_dep.found()
168 gstreamer_ntp_util_mock = executable('unittest_ntp_util',
169 join_paths('gstreamer_mqtt', 'unittest_ntp_util_mock.cc'),
170 dependencies: [nnstreamer_unittest_deps, gmock_dep, gstmqtt_dep],
171 install: get_option('install-test'),
172 install_dir: unittest_install_dir)
174 test('gstreamer_ntp_util_mock', gstreamer_ntp_util_mock, env: testenv)
178 # Run unittest_src_iio
179 if tensor_src_iio_build
180 unittest_src_iio = executable('unittest_src_iio',
181 join_paths('nnstreamer_source', 'unittest_src_iio.cc'),
182 dependencies: [nnstreamer_unittest_deps],
183 install: get_option('install-test'),
184 install_dir: unittest_install_dir
187 test('unittest_src_iio', unittest_src_iio, timeout: 120, env: testenv)
190 # Run unittest_converter
191 if flatbuf_support_is_available and have_python3
192 unittest_converter = executable('unittest_converter',
193 join_paths('nnstreamer_converter', 'unittest_converter.cc'),
194 dependencies: [nnstreamer_unittest_deps, flatbuf_dep, nnstreamer_python3_helper_dep],
195 install: get_option('install-test'),
196 install_dir: unittest_install_dir
199 test('unittest_converter', unittest_converter, env: testenv)
204 if armnn_support_is_available
205 unittest_filter_armnn = executable('unittest_filter_armnn',
206 join_paths('nnstreamer_filter_armnn', 'unittest_filter_armnn.cc'),
207 dependencies: [nnstreamer_unittest_deps, armnn_plugin_dep],
208 install: get_option('install-test'),
209 install_dir: unittest_install_dir
212 test('unittest_filter_armnn', unittest_filter_armnn, env: testenv)
216 if lua_support_is_available
217 unittest_filter_lua = executable('unittest_filter_lua',
218 join_paths('nnstreamer_filter_lua', 'unittest_filter_lua.cc'),
219 dependencies: [nnstreamer_unittest_deps],
220 install: get_option('install-test'),
221 install_dir: unittest_install_dir
224 test('unittest_filter_lua', unittest_filter_lua, env: testenv)
228 if snpe_support_is_available
229 unittest_filter_snpe = executable('unittest_filter_snpe',
230 join_paths('nnstreamer_filter_snpe', 'unittest_filter_snpe.cc'),
231 dependencies: [nnstreamer_unittest_deps],
232 install: get_option('install-test'),
233 install_dir: unittest_install_dir
236 test('unittest_filter_snpe', unittest_filter_snpe, env: testenv)
239 # tensorflow2-lite unittest
240 if tflite2_support_is_available
241 unittest_filter_tensorflow2_lite = executable('unittest_filter_tensorflow2_lite',
242 join_paths('nnstreamer_filter_tensorflow2_lite', 'unittest_filter_tensorflow2_lite.cc'),
243 dependencies: [nnstreamer_unittest_deps],
244 install: get_option('install-test'),
245 install_dir: unittest_install_dir
248 test('unittest_filter_tensorflow2_lite', unittest_filter_tensorflow2_lite, env: testenv)
251 # Run unittest_decoder
252 if flatbuf_support_is_available
253 unittest_decoder = executable('unittest_decoder',
254 join_paths('nnstreamer_decoder', 'unittest_decoder.cc'),
255 dependencies: [nnstreamer_unittest_deps, flatbuf_dep],
256 install: get_option('install-test'),
257 install_dir: unittest_install_dir
260 test('unittest_decoder', unittest_decoder, env: testenv)
264 if grpc_support_is_available
265 unittest_grpc = executable('unittest_grpc',
266 join_paths('nnstreamer_grpc', 'unittest_grpc.cc'),
267 dependencies: nnstreamer_unittest_deps,
268 install: get_option('install-test'),
269 install_dir: unittest_install_dir
272 test('unittest_grpc', unittest_grpc, env: testenv)
276 if get_option('enable-tizen-sensor')
277 subdir('tizen_sensor')
280 # Tensor filter extensions basic test cases
281 subdir('nnstreamer_filter_extensions_common')
284 if nnfw_runtime_support_is_available
285 subdir('tizen_nnfw_runtime')
288 if (tflite_support_is_available or tflite2_support_is_available) and get_option('enable-edgetpu')
289 subdir('nnstreamer_filter_edgetpu')
292 if mvncsdk2_support_is_available
293 subdir('nnstreamer_filter_mvncsdk2')
296 if tvm_support_is_available
297 subdir('nnstreamer_filter_tvm')
300 if get_option('enable-cppfilter')
301 subdir('cpp_methods')
304 if get_option('enable-openvino')
305 subdir('nnstreamer_filter_openvino')
308 if mxnet_support_is_available
309 subdir('nnstreamer_filter_mxnet')
312 if nnstreamer_edge_support_is_available
313 subdir('nnstreamer_edge')
316 if tflite_support_is_available or tflite2_support_is_available
317 unittest_filter_shared_model = executable('unittest_filter_shared_model',
318 join_paths('nnstreamer_filter_shared_model', 'unittest_filter_shared_model.cc'),
319 dependencies: [nnstreamer_unittest_deps, unittest_util_dep],
320 install: get_option('install-test'),
321 install_dir: unittest_install_dir
324 test('unittest_filter_shared_model', unittest_filter_shared_model, timeout: 30, env: testenv)
327 if get_option('enable-datarepo')
328 subdir('nnstreamer_datarepo')
331 # Run unittest_trainer
332 unittest_trainer = executable('unittest_trainer',
333 join_paths('nnstreamer_trainer', 'unittest_trainer.cc'),
334 dependencies: [nnstreamer_unittest_deps],
335 install: get_option('install-test'),
336 install_dir: unittest_install_dir
339 test('unittest_trainer', unittest_trainer, env: testenv)
341 endif # gtest_dep.found()
343 tensor_filter_ext_enabled = tflite_support_is_available or \
344 tflite2_support_is_available or \
345 tf_support_is_available or \
347 pytorch_support_is_available or caffe2_support_is_available or \
348 nnfw_runtime_support_is_available or get_option('enable-edgetpu') or \
349 mvncsdk2_support_is_available or get_option('enable-openvino') or \
350 mxnet_support_is_available
351 if get_option('install-test') and tensor_filter_ext_enabled
352 install_subdir('test_models', install_dir: unittest_install_dir)
357 if get_option('install-test')
358 install_data('gen24bBMP.py', install_dir: unittest_install_dir)
359 install_data('test_utils.py', install_dir: unittest_install_dir)
360 install_subdir('nnstreamer_converter', install_dir: unittest_install_dir)
361 install_subdir('nnstreamer_merge', install_dir: unittest_install_dir)
362 install_subdir('nnstreamer_decoder', install_dir: unittest_install_dir)
363 install_subdir('nnstreamer_decoder_boundingbox', install_dir: unittest_install_dir)
364 install_subdir('nnstreamer_decoder_pose', install_dir: unittest_install_dir)
365 install_subdir('nnstreamer_demux', install_dir: unittest_install_dir)
366 install_subdir('nnstreamer_filter_custom', install_dir: unittest_install_dir)
367 if tflite_support_is_available
368 install_subdir('nnstreamer_filter_tensorflow_lite', install_dir: unittest_install_dir)
369 install_subdir('nnstreamer_decoder_image_labeling', install_dir: unittest_install_dir)
370 install_subdir('nnstreamer_decoder_image_segment', install_dir: unittest_install_dir)
371 install_subdir('nnstreamer_filter_reload', install_dir: unittest_install_dir)
373 if tflite2_support_is_available
374 install_subdir('nnstreamer_filter_tensorflow2_lite', install_dir: unittest_install_dir)
377 if flatbuf_support_is_available
378 install_subdir('nnstreamer_converter_python3', install_dir: unittest_install_dir)
379 install_subdir('nnstreamer_decoder_python3', install_dir: unittest_install_dir)
381 install_subdir('nnstreamer_filter_python3', install_dir: unittest_install_dir)
383 if tf_support_is_available
384 install_subdir('nnstreamer_filter_tensorflow', install_dir: unittest_install_dir)
386 if pytorch_support_is_available
387 install_subdir('nnstreamer_filter_pytorch', install_dir: unittest_install_dir)
389 if caffe2_support_is_available
390 install_subdir('nnstreamer_filter_caffe2', install_dir: unittest_install_dir)
392 if deepview_rt_support_is_available
393 install_subdir('nnstreamer_filter_deepview_rt', install_dir: unittest_install_dir)
395 if flatbuf_support_is_available
396 install_subdir('nnstreamer_flatbuf', install_dir: unittest_install_dir)
397 install_subdir('nnstreamer_flexbuf', install_dir: unittest_install_dir)
399 if protobuf_support_is_available
400 install_subdir('nnstreamer_protobuf', install_dir: unittest_install_dir)
402 if mxnet_support_is_available
403 install_subdir('unittest_filter_mxnet', install_dir: unittest_install_dir)
405 install_subdir('nnstreamer_mux', install_dir: unittest_install_dir)
406 install_subdir('nnstreamer_rate', install_dir: unittest_install_dir)
407 install_subdir('nnstreamer_repo', install_dir: unittest_install_dir)
408 install_subdir('nnstreamer_repo_dynamicity', install_dir: unittest_install_dir)
409 install_subdir('nnstreamer_repo_lstm', install_dir: unittest_install_dir)
410 install_subdir('nnstreamer_repo_rnn', install_dir: unittest_install_dir)
411 install_subdir('nnstreamer_split', install_dir: unittest_install_dir)
412 install_subdir('transform_arithmetic', install_dir: unittest_install_dir)
413 install_subdir('transform_clamp', install_dir: unittest_install_dir)
414 install_subdir('transform_dimchg', install_dir: unittest_install_dir)
415 install_subdir('transform_stand', install_dir: unittest_install_dir)
416 install_subdir('transform_transpose', install_dir: unittest_install_dir)
417 install_subdir('transform_typecast', install_dir: unittest_install_dir)