[Tizen/nnfw] Add open/close callbacks for tensor_filter
[platform/upstream/nnstreamer.git] / tests / meson.build
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
7 )
8
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
14 )
15
16 # Build and copy exe for ssat
17 libpng_dep = dependency('libpng', required: false)
18 if libpng_dep.found()
19   b2p = executable('bmp2png',
20     'bmp2png.c',
21     dependencies: [libpng_dep, glib_dep],
22     install: get_option('install-test'),
23     install_dir: unittest_install_dir
24   )
25
26   copy = find_program('cp')
27   custom_target('copy-bmp2png',
28     input: b2p,
29     output: 'b2p',
30     command: [copy, '@INPUT@', meson.current_source_dir()],
31     build_by_default: true
32   )
33 endif
34
35 # ssat repo_dynamic
36 executable('unittest_repo',
37   join_paths('nnstreamer_repo_dynamicity', 'tensor_repo_dynamic_test.c'),
38   dependencies: [nnstreamer_dep, gst_dep, glib_dep],
39   install: get_option('install-test'),
40   install_dir: unittest_install_dir
41 )
42
43 # gtest
44 gtest_dep = dependency('gtest', required: false)
45 if gtest_dep.found()
46   nnstreamer_unittest_deps = [
47     nnstreamer_dep,
48     nnstreamer_internal_deps,
49     glib_dep,
50     gst_dep,
51     gst_app_dep,
52     gst_check_dep,
53     gtest_dep
54   ]
55
56   # Run unittest_common
57   unittest_common = executable('unittest_common',
58     join_paths('common', 'unittest_common.cpp'),
59     dependencies: [nnstreamer_unittest_deps],
60     install: get_option('install-test'),
61     install_dir: unittest_install_dir
62   )
63
64   test('unittest_common', unittest_common)
65
66   # Run unittest_sink
67   unittest_sink = executable('unittest_sink',
68     join_paths('nnstreamer_sink', 'unittest_sink.cpp'),
69     dependencies: [nnstreamer_unittest_deps],
70     install: get_option('install-test'),
71     install_dir: unittest_install_dir
72   )
73
74   test('unittest_sink', unittest_sink, timeout: 120, args: ['--gst-plugin-path=..'])
75
76   # Run unittest_plugins
77   unittest_plugins = executable('unittest_plugins',
78     join_paths('nnstreamer_plugins', 'unittest_plugins.cpp'),
79     dependencies: [nnstreamer_unittest_deps],
80     install: get_option('install-test'),
81     install_dir: unittest_install_dir
82   )
83
84   test('unittest_plugins', unittest_plugins, args: ['--gst-plugin-path=..'])
85
86   # Run unittest_src_iio
87   if build_platform != 'macos'
88     unittest_src_iio = executable('unittest_src_iio',
89       join_paths('nnstreamer_source', 'unittest_src_iio.cpp'),
90       dependencies: [nnstreamer_unittest_deps],
91       install: get_option('install-test'),
92       install_dir: unittest_install_dir
93     )
94
95     test('unittest_src_iio', unittest_src_iio, timeout: 120, args: ['--gst-plugin-path=..'])
96   endif
97 endif
98
99 # Tizen C-API
100 if get_option('enable-capi')
101   subdir('tizen_capi')
102 endif
103
104 if get_option('enable-nnfw-runtime')
105   subdir('tizen_nnfw_runtime')
106 endif
107
108 # Install Unittest
109 if get_option('install-test')
110   install_data('gen24bBMP.py', install_dir: join_paths(unittest_install_dir,'tests'))
111   install_subdir('nnstreamer_converter', install_dir: join_paths(unittest_install_dir,'tests'))
112   install_subdir('nnstreamer_merge', install_dir: join_paths(unittest_install_dir,'tests'))
113   install_subdir('nnstreamer_decoder', install_dir: join_paths(unittest_install_dir,'tests'))
114   install_subdir('nnstreamer_demux', install_dir: join_paths(unittest_install_dir,'tests'))
115   install_subdir('nnstreamer_filter_custom', install_dir: join_paths(unittest_install_dir,'tests'))
116   if get_option('enable-tensorflow-lite')
117     install_subdir('test_models', install_dir: join_paths(unittest_install_dir,'tests'))
118     install_subdir('nnstreamer_filter_tensorflow_lite', install_dir: join_paths(unittest_install_dir,'tests'))
119     install_subdir('nnstreamer_decoder_image_labeling', install_dir: join_paths(unittest_install_dir,'tests'))
120   endif
121   if get_option('enable-tensorflow')
122     install_subdir('nnstreamer_filter_tensorflow', install_dir: join_paths(unittest_install_dir,'tests'))
123   endif
124   if get_option('enable-pytorch')
125     install_subdir('nnstreamer_filter_pytorch', install_dir: join_paths(unittest_install_dir,'tests'))
126   endif
127   install_subdir('nnstreamer_mux', install_dir: join_paths(unittest_install_dir,'tests'))
128   install_subdir('nnstreamer_repo', install_dir: join_paths(unittest_install_dir,'tests'))
129   install_subdir('nnstreamer_repo_dynamicity', install_dir: join_paths(unittest_install_dir,'tests'))
130   install_subdir('nnstreamer_repo_lstm', install_dir: join_paths(unittest_install_dir,'tests'))
131   install_subdir('nnstreamer_repo_rnn', install_dir: join_paths(unittest_install_dir,'tests'))
132   install_subdir('nnstreamer_split', install_dir: join_paths(unittest_install_dir,'tests'))
133   install_subdir('transform_arithmetic', install_dir: join_paths(unittest_install_dir,'tests'))
134   install_subdir('transform_dimchg', install_dir: join_paths(unittest_install_dir,'tests'))
135   install_subdir('transform_stand', install_dir: join_paths(unittest_install_dir,'tests'))
136   install_subdir('transform_transpose', install_dir: join_paths(unittest_install_dir,'tests'))
137   install_subdir('transform_typecast', install_dir: join_paths(unittest_install_dir,'tests'))
138 endif