1# Copyright (c) 2022 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/test.gni")
15
16module_output_path = "neural_network_runtime/"
17
18config("module_private_config") {
19  visibility = [ ":*" ]
20
21  include_dirs = [
22    "//third_party/googletest/googlemock/include",
23    "../../..",
24    "../../../frameworks/native",
25    "../../../frameworks/native/neural_network_runtime",
26    "../../../frameworks/native/neural_network_core",
27    "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include",
28    "//third_party/mindspore/mindspore-src/source/mindspore/lite/mindir/include",
29  ]
30}
31
32ohos_unittest("CompilationV1_0Test") {
33  module_out_path = module_output_path
34
35  sources = [ "../common/v1_0/compilation_mock_idevice.cpp" ]
36  configs = [ ":module_private_config" ]
37
38  deps = [
39    "../../../frameworks/native/neural_network_core:libneural_network_core",
40    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
41    "//third_party/googletest:gmock_main",
42    "//third_party/googletest:gtest_main",
43  ]
44
45  external_deps = [
46    "c_utils:utils",
47    "drivers_interface_nnrt:libnnrt_proxy_1.0",
48    "hdf_core:libhdf_utils",
49    "hilog:libhilog",
50    "hitrace:libhitracechain",
51    "mindspore:mindir",
52  ]
53}
54
55ohos_unittest("ExecutorV1_0Test") {
56  module_out_path = module_output_path
57
58  sources = [ "../common/v1_0/executor_mock_device.cpp" ]
59  configs = [ ":module_private_config" ]
60
61  deps = [
62    "../../../frameworks/native/neural_network_core:libneural_network_core",
63    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
64    "//third_party/googletest:gmock_main",
65    "//third_party/googletest:gtest_main",
66  ]
67
68  external_deps = [
69    "c_utils:utils",
70    "drivers_interface_nnrt:libnnrt_proxy_1.0",
71    "hdf_core:libhdf_utils",
72    "hilog:libhilog",
73    "hitrace:libhitracechain",
74    "mindspore:mindir",
75  ]
76}
77
78ohos_unittest("DeviceManagerV1_0Test") {
79  module_out_path = module_output_path
80
81  sources = [ "./v1_0/device_manager/device_manager_test.cpp" ]
82  sources += [ "../common/v1_0/mock_idevice.cpp" ]
83  configs = [ ":module_private_config" ]
84
85  deps = [
86    "../../../frameworks/native/neural_network_core:libneural_network_core",
87    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
88    "//third_party/googletest:gmock_main",
89    "//third_party/googletest:gtest_main",
90  ]
91
92  external_deps = [
93    "c_utils:utils",
94    "drivers_interface_nnrt:libnnrt_proxy_1.0",
95    "hilog:libhilog",
96    "hitrace:libhitracechain",
97    "mindspore:mindir",
98  ]
99}
100
101ohos_unittest("DeviceRegistrarV1_0Test") {
102  module_out_path = module_output_path
103
104  sources = [ "./v1_0/device_registrar/device_registrar_test.cpp" ]
105  sources += [ "../common/v1_0/mock_idevice.cpp" ]
106  configs = [ ":module_private_config" ]
107
108  deps = [
109    "../../../frameworks/native/neural_network_core:libneural_network_core",
110    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
111    "//third_party/googletest:gmock_main",
112    "//third_party/googletest:gtest_main",
113  ]
114
115  external_deps = [
116    "c_utils:utils",
117    "drivers_interface_nnrt:libnnrt_proxy_1.0",
118    "hilog:libhilog",
119    "hitrace:libhitracechain",
120    "mindspore:mindir",
121  ]
122}
123
124ohos_unittest("HDIDeviceV1_0Test") {
125  module_out_path = module_output_path
126
127  sources = [ "./v1_0/hdi_device/hdi_device_test.cpp" ]
128  sources += [ "../common/v1_0/mock_idevice.cpp" ]
129  sources += [ "../common/file_utils.cpp" ]
130  configs = [ ":module_private_config" ]
131
132  deps = [
133    "../../../frameworks/native/neural_network_core:libneural_network_core",
134    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
135    "//third_party/googletest:gmock_main",
136    "//third_party/googletest:gtest_main",
137  ]
138
139  external_deps = [
140    "c_utils:utils",
141    "drivers_interface_nnrt:libnnrt_proxy_1.0",
142    "hilog:libhilog",
143    "hitrace:libhitracechain",
144    "mindspore:mindir",
145  ]
146}
147
148ohos_unittest("HDIPreparedModelV1_0Test") {
149  module_out_path = module_output_path
150
151  sources = [ "./v1_0/hdi_prepared_model/hdi_prepared_model_test.cpp" ]
152  sources += [ "../common/v1_0/mock_idevice.cpp" ]
153  sources += [ "../common/file_utils.cpp" ]
154  configs = [ ":module_private_config" ]
155
156  deps = [
157    "../../../frameworks/native/neural_network_core:libneural_network_core",
158    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
159    "//third_party/googletest:gmock_main",
160    "//third_party/googletest:gtest_main",
161  ]
162
163  external_deps = [
164    "c_utils:utils",
165    "drivers_interface_nnrt:libnnrt_proxy_1.0",
166    "hilog:libhilog",
167    "hitrace:libhitracechain",
168    "mindspore:mindir",
169  ]
170}
171
172ohos_unittest("MemoryManagerTest") {
173  module_out_path = module_output_path
174
175  sources = [ "./memory_manager/memory_manager_test.cpp" ]
176  sources += [ "../common/file_utils.cpp" ]
177  configs = [ ":module_private_config" ]
178
179  deps = [
180    "../../../frameworks/native/neural_network_core:libneural_network_core",
181    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
182    "//third_party/googletest:gmock_main",
183    "//third_party/googletest:gtest_main",
184  ]
185
186  external_deps = [
187    "drivers_interface_nnrt:libnnrt_proxy_1.0",
188    "hilog:libhilog",
189    "hitrace:libhitracechain",
190    "mindspore:mindir",
191  ]
192}
193
194ohos_unittest("NeuralNetworkCoreV1_0Test") {
195  module_out_path = module_output_path
196
197  sources = [ "./v1_0/neural_network_core_test/neural_network_core_test.cpp" ]
198  configs = [ ":module_private_config" ]
199
200  deps = [
201    "../../../frameworks/native/neural_network_core:libneural_network_core",
202    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
203    "//third_party/googletest:gmock_main",
204    "//third_party/googletest:gtest_main",
205  ]
206
207  external_deps = [
208    "c_utils:utils",
209    "drivers_interface_nnrt:libnnrt_proxy_1.0",
210    "hdf_core:libhdf_utils",
211    "hilog:libhilog",
212    "hitrace:libhitracechain",
213  ]
214}
215
216ohos_unittest("QuantParamsTest") {
217  module_out_path = module_output_path
218
219  sources = [ "./quant_param/quant_param_test.cpp" ]
220  configs = [ ":module_private_config" ]
221
222  deps = [
223    "../../../frameworks/native/neural_network_core:libneural_network_core",
224    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
225    "//third_party/googletest:gmock_main",
226    "//third_party/googletest:gtest_main",
227  ]
228
229  external_deps = [
230    "drivers_interface_nnrt:libnnrt_proxy_1.0",
231    "hilog:libhilog",
232    "hitrace:libhitracechain",
233  ]
234}
235
236ohos_unittest("NNBackendTest") {
237  module_out_path = module_output_path
238
239  sources = [ "./nn_backend/nn_backend_test.cpp" ]
240  configs = [ ":module_private_config" ]
241
242  deps = [
243    "../../../frameworks/native/neural_network_core:libneural_network_core",
244    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
245    "//third_party/googletest:gmock_main",
246    "//third_party/googletest:gtest_main",
247  ]
248
249  external_deps = [
250    "drivers_interface_nnrt:libnnrt_proxy_1.0",
251    "hilog:libhilog",
252    "hitrace:libhitracechain",
253  ]
254}
255
256ohos_unittest("NNCompiledCacheTest") {
257  module_out_path = module_output_path
258
259  sources = [ "./nn_compiled_cache/nn_compiled_cache_test.cpp" ]
260  configs = [ ":module_private_config" ]
261
262  deps = [
263    "../../../frameworks/native/neural_network_core:libneural_network_core",
264    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
265    "//third_party/googletest:gmock_main",
266    "//third_party/googletest:gtest_main",
267  ]
268
269  external_deps = [
270    "drivers_interface_nnrt:libnnrt_proxy_1.0",
271    "hilog:libhilog",
272    "hitrace:libhitracechain",
273  ]
274}
275
276ohos_unittest("NNCompilerTest") {
277  module_out_path = module_output_path
278
279  sources = [ "./nn_compiler/nn_compiler_test.cpp" ]
280  configs = [ ":module_private_config" ]
281
282  deps = [
283    "../../../frameworks/native/neural_network_core:libneural_network_core",
284    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
285    "//third_party/googletest:gmock_main",
286    "//third_party/googletest:gtest_main",
287  ]
288
289  external_deps = [
290    "drivers_interface_nnrt:libnnrt_proxy_1.0",
291    "hilog:libhilog",
292    "hitrace:libhitracechain",
293  ]
294}
295
296ohos_unittest("NNExecutorTest") {
297  module_out_path = module_output_path
298
299  sources = [ "./nn_executor/nn_executor_test.cpp" ]
300  configs = [ ":module_private_config" ]
301
302  deps = [
303    "../../../frameworks/native/neural_network_core:libneural_network_core",
304    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
305    "//third_party/googletest:gmock_main",
306    "//third_party/googletest:gtest_main",
307  ]
308
309  external_deps = [
310    "drivers_interface_nnrt:libnnrt_proxy_1.0",
311    "hilog:libhilog",
312    "hitrace:libhitracechain",
313  ]
314}
315
316ohos_unittest("NNTensor2_0Test") {
317  module_out_path = module_output_path
318
319  sources = [ "./nn_tensor/nn_tensor_test.cpp" ]
320  configs = [ ":module_private_config" ]
321
322  deps = [
323    "../../../frameworks/native/neural_network_core:libneural_network_core",
324    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
325    "//third_party/googletest:gmock_main",
326    "//third_party/googletest:gtest_main",
327  ]
328
329  external_deps = [
330    "drivers_interface_nnrt:libnnrt_proxy_1.0",
331    "hilog:libhilog",
332    "hitrace:libhitracechain",
333  ]
334}
335
336ohos_unittest("TransformV1_0Test") {
337  module_out_path = module_output_path
338
339  sources = [ "./v1_0/transform/transform_test.cpp" ]
340  configs = [ ":module_private_config" ]
341
342  deps = [
343    "../../../frameworks/native/neural_network_core:libneural_network_core",
344    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
345    "//third_party/googletest:gmock_main",
346    "//third_party/googletest:gtest_main",
347  ]
348
349  external_deps = [
350    "drivers_interface_nnrt:libnnrt_proxy_1.0",
351    "hilog:libhilog",
352    "hitrace:libhitracechain",
353    "mindspore:mindir",
354  ]
355}
356
357ohos_unittest("InnerModelV1_0Test") {
358  module_out_path = module_output_path
359
360  sources = [ "./v1_0/inner_model/inner_model_test.cpp" ]
361  sources += [ "../common/v1_0/inner_model_mock_device.cpp" ]
362  configs = [ ":module_private_config" ]
363
364  deps = [
365    "../../../frameworks/native/neural_network_core:libneural_network_core",
366    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
367    "//third_party/googletest:gmock_main",
368    "//third_party/googletest:gtest_main",
369  ]
370
371  external_deps = [
372    "c_utils:utils",
373    "drivers_interface_nnrt:libnnrt_proxy_1.0",
374    "hdf_core:libhdf_utils",
375    "hilog:libhilog",
376    "hitrace:libhitracechain",
377    "mindspore:mindir",
378  ]
379}
380
381ohos_unittest("NnTensorV1_0Test") {
382  module_out_path = module_output_path
383
384  sources = [ "./v1_0/inner_model/nn_tensor_test.cpp" ]
385  configs = [ ":module_private_config" ]
386
387  deps = [
388    "../../../frameworks/native/neural_network_core:libneural_network_core",
389    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
390    "//third_party/googletest:gmock_main",
391    "//third_party/googletest:gtest_main",
392  ]
393
394  external_deps = [
395    "c_utils:utils",
396    "drivers_interface_nnrt:libnnrt_proxy_1.0",
397    "hdf_core:libhdf_utils",
398    "hilog:libhilog",
399    "hitrace:libhitracechain",
400    "mindspore:mindir",
401  ]
402}
403
404ohos_unittest("NnTensorDescV1_0Test") {
405  module_out_path = module_output_path
406
407  sources = [ "./v1_0/inner_model/nn_tensor_desc_test.cpp" ]
408  configs = [ ":module_private_config" ]
409
410  deps = [
411    "../../../frameworks/native/neural_network_core:libneural_network_core",
412    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
413    "//third_party/googletest:gmock_main",
414    "//third_party/googletest:gtest_main",
415  ]
416
417  external_deps = [
418    "c_utils:utils",
419    "drivers_interface_nnrt:libnnrt_proxy_1.0",
420    "hdf_core:libhdf_utils",
421    "hilog:libhilog",
422    "hitrace:libhitracechain",
423  ]
424}
425
426ohos_unittest("NnValidationV1_0Test") {
427  module_out_path = module_output_path
428
429  sources = [ "./v1_0/inner_model/nn_validation_test.cpp" ]
430  configs = [ ":module_private_config" ]
431
432  deps = [
433    "../../../frameworks/native/neural_network_core:libneural_network_core",
434    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
435    "//third_party/googletest:gmock_main",
436    "//third_party/googletest:gtest_main",
437  ]
438
439  external_deps = [
440    "c_utils:utils",
441    "drivers_interface_nnrt:libnnrt_proxy_1.0",
442    "hdf_core:libhdf_utils",
443    "hilog:libhilog",
444    "hitrace:libhitracechain",
445    "mindspore:mindir",
446  ]
447}
448
449ohos_unittest("OpsRegistryV1_0Test") {
450  module_out_path = module_output_path
451
452  sources = [ "./v1_0/inner_model/ops_registry_test.cpp" ]
453  configs = [ ":module_private_config" ]
454
455  deps = [
456    "../../../frameworks/native/neural_network_core:libneural_network_core",
457    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
458    "//third_party/googletest:gmock_main",
459    "//third_party/googletest:gtest_main",
460  ]
461
462  external_deps = [
463    "c_utils:utils",
464    "drivers_interface_nnrt:libnnrt_proxy_1.0",
465    "hdf_core:libhdf_utils",
466    "hilog:libhilog",
467    "hitrace:libhitracechain",
468    "mindspore:mindir",
469  ]
470}
471
472ohos_unittest("NeuralNetworkRuntimeV1_0Test") {
473  module_out_path = module_output_path
474
475  sources =
476      [ "./v1_0/neural_network_runtime_test/neural_network_runtime_test.cpp" ]
477  sources += [ "../common/v1_0/executor_mock_device.cpp" ]
478
479  configs = [ ":module_private_config" ]
480
481  deps = [
482    "../../../frameworks/native/neural_network_core:libneural_network_core",
483    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
484    "//third_party/googletest:gmock_main",
485    "//third_party/googletest:gtest_main",
486  ]
487
488  external_deps = [
489    "c_utils:utils",
490    "drivers_interface_nnrt:libnnrt_proxy_1.0",
491    "hdf_core:libhdf_utils",
492    "hilog:libhilog",
493    "hitrace:libhitracechain",
494    "mindspore:mindir",
495  ]
496}
497
498ohos_unittest("CompilationV2_0Test") {
499  module_out_path = module_output_path
500
501  sources = [ "../common/v2_0/compilation_mock_idevice.cpp" ]
502  configs = [ ":module_private_config" ]
503
504  deps = [
505    "../../../frameworks/native/neural_network_core:libneural_network_core",
506    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
507    "//third_party/googletest:gmock_main",
508    "//third_party/googletest:gtest_main",
509  ]
510
511  external_deps = [
512    "c_utils:utils",
513    "drivers_interface_nnrt:libnnrt_proxy_2.0",
514    "hdf_core:libhdf_utils",
515    "hilog:libhilog",
516    "hitrace:libhitracechain",
517    "mindspore:mindir",
518  ]
519}
520
521ohos_unittest("ExecutorV2_0Test") {
522  module_out_path = module_output_path
523
524  sources = [ "../common/v2_0/executor_mock_device.cpp" ]
525  configs = [ ":module_private_config" ]
526
527  deps = [
528    "../../../frameworks/native/neural_network_core:libneural_network_core",
529    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
530    "//third_party/googletest:gmock_main",
531    "//third_party/googletest:gtest_main",
532  ]
533
534  external_deps = [
535    "c_utils:utils",
536    "drivers_interface_nnrt:libnnrt_proxy_2.0",
537    "hdf_core:libhdf_utils",
538    "hilog:libhilog",
539    "hitrace:libhitracechain",
540    "mindspore:mindir",
541  ]
542}
543
544ohos_unittest("DeviceManagerV2_0Test") {
545  module_out_path = module_output_path
546
547  sources = [ "./v2_0/device_manager/device_manager_test.cpp" ]
548  sources += [ "../common/v2_0/mock_idevice.cpp" ]
549  configs = [ ":module_private_config" ]
550
551  deps = [
552    "../../../frameworks/native/neural_network_core:libneural_network_core",
553    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
554    "//third_party/googletest:gmock_main",
555    "//third_party/googletest:gtest_main",
556  ]
557
558  external_deps = [
559    "c_utils:utils",
560    "drivers_interface_nnrt:libnnrt_proxy_2.0",
561    "hilog:libhilog",
562    "hitrace:libhitracechain",
563    "mindspore:mindir",
564  ]
565}
566
567ohos_unittest("DeviceRegistrarV2_0Test") {
568  module_out_path = module_output_path
569
570  sources = [ "./v2_0/device_registrar/device_registrar_test.cpp" ]
571  sources += [ "../common/v2_0/mock_idevice.cpp" ]
572  configs = [ ":module_private_config" ]
573
574  deps = [
575    "../../../frameworks/native/neural_network_core:libneural_network_core",
576    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
577    "//third_party/googletest:gmock_main",
578    "//third_party/googletest:gtest_main",
579  ]
580
581  external_deps = [
582    "c_utils:utils",
583    "drivers_interface_nnrt:libnnrt_proxy_2.0",
584    "hilog:libhilog",
585    "hitrace:libhitracechain",
586    "mindspore:mindir",
587  ]
588}
589
590ohos_unittest("HDIDeviceV2_0Test") {
591  module_out_path = module_output_path
592
593  sources = [ "./v2_0/hdi_device/hdi_device_test.cpp" ]
594  sources += [ "../common/v2_0/mock_idevice.cpp" ]
595  sources += [ "../common/file_utils.cpp" ]
596  configs = [ ":module_private_config" ]
597
598  deps = [
599    "../../../frameworks/native/neural_network_core:libneural_network_core",
600    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
601    "//third_party/googletest:gmock_main",
602    "//third_party/googletest:gtest_main",
603  ]
604
605  external_deps = [
606    "c_utils:utils",
607    "drivers_interface_nnrt:libnnrt_proxy_2.0",
608    "hilog:libhilog",
609    "hitrace:libhitracechain",
610    "mindspore:mindir",
611  ]
612}
613
614ohos_unittest("HDIPreparedModelV2_0Test") {
615  module_out_path = module_output_path
616
617  sources = [ "./v2_0/hdi_prepared_model/hdi_prepared_model_test.cpp" ]
618  sources += [ "../common/v2_0/mock_idevice.cpp" ]
619  sources += [ "../common/file_utils.cpp" ]
620  configs = [ ":module_private_config" ]
621
622  deps = [
623    "../../../frameworks/native/neural_network_core:libneural_network_core",
624    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
625    "//third_party/googletest:gmock_main",
626    "//third_party/googletest:gtest_main",
627  ]
628
629  external_deps = [
630    "c_utils:utils",
631    "drivers_interface_nnrt:libnnrt_proxy_2.0",
632    "hilog:libhilog",
633    "hitrace:libhitracechain",
634    "mindspore:mindir",
635  ]
636}
637
638ohos_unittest("HDIPreparedModelV2_1Test") {
639  module_out_path = module_output_path
640
641  sources = [ "./v2_1/hdi_prepared_model/hdi_prepared_model_test.cpp" ]
642  sources += [ "../common/v2_1/mock_idevice.cpp" ]
643  sources += [ "../common/file_utils.cpp" ]
644  configs = [ ":module_private_config" ]
645
646  deps = [
647    "../../../frameworks/native/neural_network_core:libneural_network_core",
648    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
649    "//third_party/googletest:gmock_main",
650    "//third_party/googletest:gtest_main",
651  ]
652
653  external_deps = [
654    "c_utils:utils",
655    "drivers_interface_nnrt:libnnrt_proxy_2.0",
656    "hilog:libhilog",
657    "hitrace:libhitracechain",
658  ]
659}
660
661ohos_unittest("TransformV2_0Test") {
662  module_out_path = module_output_path
663
664  sources = [ "./v2_0/transform/transform_test.cpp" ]
665  configs = [ ":module_private_config" ]
666
667  deps = [
668    "../../../frameworks/native/neural_network_core:libneural_network_core",
669    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
670    "//third_party/googletest:gmock_main",
671    "//third_party/googletest:gtest_main",
672  ]
673
674  external_deps = [
675    "drivers_interface_nnrt:libnnrt_proxy_2.0",
676    "hilog:libhilog",
677    "hitrace:libhitracechain",
678    "mindspore:mindir",
679  ]
680}
681
682ohos_unittest("InnerModelV2_0Test") {
683  module_out_path = module_output_path
684
685  sources = [ "./v2_0/inner_model/inner_model_test.cpp" ]
686  sources += [ "../common/v2_0/inner_model_mock_device.cpp" ]
687  configs = [ ":module_private_config" ]
688
689  deps = [
690    "../../../frameworks/native/neural_network_core:libneural_network_core",
691    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
692    "//third_party/googletest:gmock_main",
693    "//third_party/googletest:gtest_main",
694  ]
695
696  external_deps = [
697    "c_utils:utils",
698    "drivers_interface_nnrt:libnnrt_proxy_2.0",
699    "hdf_core:libhdf_utils",
700    "hilog:libhilog",
701    "hitrace:libhitracechain",
702    "mindspore:mindir",
703  ]
704}
705
706ohos_unittest("NnTensorV2_0Test") {
707  module_out_path = module_output_path
708
709  sources = [ "./v2_0/inner_model/nn_tensor_test.cpp" ]
710  configs = [ ":module_private_config" ]
711
712  deps = [
713    "../../../frameworks/native/neural_network_core:libneural_network_core",
714    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
715    "//third_party/googletest:gmock_main",
716    "//third_party/googletest:gtest_main",
717  ]
718
719  external_deps = [
720    "c_utils:utils",
721    "drivers_interface_nnrt:libnnrt_proxy_2.0",
722    "hdf_core:libhdf_utils",
723    "hilog:libhilog",
724    "hitrace:libhitracechain",
725    "mindspore:mindir",
726  ]
727}
728
729ohos_unittest("NnValidationV2_0Test") {
730  module_out_path = module_output_path
731
732  sources = [ "./v2_0/inner_model/nn_validation_test.cpp" ]
733  configs = [ ":module_private_config" ]
734
735  deps = [
736    "../../../frameworks/native/neural_network_core:libneural_network_core",
737    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
738    "//third_party/googletest:gmock_main",
739    "//third_party/googletest:gtest_main",
740  ]
741
742  external_deps = [
743    "c_utils:utils",
744    "drivers_interface_nnrt:libnnrt_proxy_2.0",
745    "hdf_core:libhdf_utils",
746    "hilog:libhilog",
747    "hitrace:libhitracechain",
748    "mindspore:mindir",
749  ]
750}
751
752ohos_unittest("OpsRegistryV2_0Test") {
753  module_out_path = module_output_path
754
755  sources = [ "./v2_0/inner_model/ops_registry_test.cpp" ]
756  configs = [ ":module_private_config" ]
757
758  deps = [
759    "../../../frameworks/native/neural_network_core:libneural_network_core",
760    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
761    "//third_party/googletest:gmock_main",
762    "//third_party/googletest:gtest_main",
763  ]
764
765  external_deps = [
766    "c_utils:utils",
767    "drivers_interface_nnrt:libnnrt_proxy_2.0",
768    "hdf_core:libhdf_utils",
769    "hilog:libhilog",
770    "hitrace:libhitracechain",
771    "mindspore:mindir",
772  ]
773}
774
775ohos_unittest("NeuralNetworkRuntimeV2_0Test") {
776  module_out_path = module_output_path
777
778  sources =
779      [ "./v2_0/neural_network_runtime_test/neural_network_runtime_test.cpp" ]
780  sources += [ "../common/v2_0/executor_mock_device.cpp" ]
781
782  configs = [ ":module_private_config" ]
783
784  deps = [
785    "../../../frameworks/native/neural_network_core:libneural_network_core",
786    "../../../frameworks/native/neural_network_runtime:libneural_network_runtime",
787    "//third_party/googletest:gmock_main",
788    "//third_party/googletest:gtest_main",
789  ]
790
791  external_deps = [
792    "c_utils:utils",
793    "drivers_interface_nnrt:libnnrt_proxy_2.0",
794    "hdf_core:libhdf_utils",
795    "hilog:libhilog",
796    "hitrace:libhitracechain",
797    "mindspore:mindir",
798  ]
799}
800
801group("components_unittest") {
802  testonly = true
803  deps = [
804    ":DeviceManagerV1_0Test",
805    ":HDIDeviceV1_0Test",
806    ":HDIDeviceV2_0Test",
807    ":HDIPreparedModelV1_0Test",
808    ":HDIPreparedModelV2_0Test",
809    ":HDIPreparedModelV2_1Test",
810    ":InnerModelV1_0Test",
811    ":InnerModelV2_0Test",
812    ":MemoryManagerTest",
813    ":NNBackendTest",
814    ":NNCompiledCacheTest",
815    ":NNCompilerTest",
816    ":NNExecutorTest",
817    ":NNTensor2_0Test",
818    ":NeuralNetworkCoreV1_0Test",
819    ":NeuralNetworkRuntimeV1_0Test",
820    ":NeuralNetworkRuntimeV2_0Test",
821    ":NnTensorDescV1_0Test",
822    ":NnTensorV1_0Test",
823    ":NnTensorV2_0Test",
824    ":NnValidationV1_0Test",
825    ":NnValidationV2_0Test",
826    ":OpsRegistryV1_0Test",
827    ":OpsRegistryV2_0Test",
828    ":QuantParamsTest",
829    ":TransformV1_0Test",
830    ":TransformV2_0Test",
831  ]
832}
833