• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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("//foundation/arkui/napi/napi.gni")
15
16import("//build/test.gni")
17import("//foundation/ability/form_fwk/form_fwk.gni")
18import("//foundation/arkui/ace_engine/ace_config.gni")
19import("//foundation/arkui/napi/test/unittest/ut.gni")
20
21if (is_standard_system) {
22  module_output_path = "ace_engine/napi"
23} else {
24  module_output_path = "ace_engine_full/napi"
25}
26
27ohos_unittest("test_ark_unittest") {
28  module_out_path = module_output_path
29
30  include_dirs = ark_include
31
32  cflags = [ "-g3" ]
33
34  sources = [
35    "engine/test_ark.cpp",
36    "test_napi.cpp",
37    "test_sendable_napi.cpp",
38  ]
39
40  defines = [ "NAPI_TEST" ]
41
42  deps = ark_deps
43
44  deps += [ "../..:ace_napi" ]
45
46  external_deps = [
47    "bounds_checking_function:libsec_shared",
48    "c_utils:utils",
49  ]
50
51  external_deps += [ "hilog:libhilog" ]
52  external_deps += [ "ets_runtime:libark_jsruntime" ]
53}
54
55ohos_unittest("test_ark_unittest_threadsafe") {
56  module_out_path = module_output_path
57
58  include_dirs = ark_include
59
60  cflags = [ "-g3" ]
61
62  sources = [
63    "engine/test_ark.cpp",
64    "test_napi_threadsafe.cpp",
65  ]
66
67  defines = [ "NAPI_TEST" ]
68
69  deps = ark_deps
70  deps += [ "../..:ace_napi" ]
71
72  external_deps = [ "bounds_checking_function:libsec_shared" ]
73
74  external_deps += [
75    "eventhandler:libeventhandler",
76    "hilog:libhilog",
77  ]
78  external_deps += [ "ets_runtime:libark_jsruntime" ]
79}
80
81ohos_unittest("test_ark_api_allowlist") {
82  module_out_path = module_output_path
83
84  include_dirs = ark_include
85
86  cflags = [ "-g3" ]
87
88  sources = [
89    "engine/test_ark.cpp",
90    "test_ark_api_allowlist.cpp",
91  ]
92
93  defines = [ "NAPI_TEST" ]
94
95  deps = ark_deps
96  deps += [ "../..:ace_napi" ]
97  deps += [ "${form_render_service_path}/..:formrender" ]
98
99  external_deps = [ "bounds_checking_function:libsec_shared" ]
100
101  external_deps += [ "hilog:libhilog" ]
102  external_deps += [ "ets_runtime:libark_jsruntime" ]
103}
104
105ohos_unittest("test_worker_manager") {
106  module_out_path = module_output_path
107
108  cflags = [ "-g3" ]
109
110  sources = [ "test_worker_manager.cpp" ]
111
112  defines = [ "NAPI_TEST" ]
113
114  deps = [ "../..:ace_napi" ]
115
116  external_deps = [
117    "googletest:gtest",
118    "googletest:gtest_main",
119    "hilog:libhilog",
120  ]
121}
122
123group("unittest") {
124  testonly = true
125  deps = [
126    ":test_ark_api_allowlist",
127    ":test_ark_unittest",
128    ":test_ark_unittest_threadsafe",
129    ":test_worker_manager",
130  ]
131  if (target_cpu == "arm64") {
132    deps += [ "jsvm:jsvm_unittest" ]
133  }
134  if (target_cpu == "arm64" || target_cpu == "x86_64") {
135    deps += [ "cj_native:cj_native_unittest" ]
136  }
137}
138
139#jerry tdd test for phone running
140group("jerry_tdd_test_run") {
141  testonly = true
142  deps = [ "//third_party/jerryscript/tests/unit-core:jerry_tdd_test" ]
143}
144
145#jerry es2015 test for phone running
146group("jerry_jstest_es2015") {
147  testonly = true
148  deps = [ "//third_party/jerryscript/tests/jerry:jerry_js_test_es2015" ]
149}
150
151#jerry es2015 test for host running
152group("jerry_host_jstest_es2015") {
153  testonly = true
154  deps = [
155    "//third_party/jerryscript/tests/jerry:jerry_host_js_test_es2015",
156    "//third_party/jerryscript/tests/unit-core:jerry_tdd_host_test",
157  ]
158}
159
160#jerry es5.1 test for phone running
161group("jerry_jstest_es5.1") {
162  testonly = true
163  deps = [ "//third_party/jerryscript/tests/jerry:jerry_js_test_es5.1" ]
164}
165
166#jerry es5.1 test for host running
167group("jerry_host_jstest_es5.1") {
168  testonly = true
169  deps = [
170    "//third_party/jerryscript/tests/jerry:jerry_host_js_test_es5.1",
171    "//third_party/jerryscript/tests/unit-core:jerry_tdd_host_test",
172  ]
173}
174
175#jerry tdd test for host running
176group("jerry_tdd_host_test_run") {
177  testonly = true
178  deps = [ "//third_party/jerryscript/tests/unit-core:jerry_tdd_host_test" ]
179}
180