• 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("//ark/js_runtime/js_runtime_config.gni")
15import("//ark/js_runtime/test/test_helper.gni")
16import("//build/test.gni")
17
18module_output_path = "ark/js_runtime"
19
20host_unittest_action("ArrayHelperTest") {
21  module_out_path = module_output_path
22
23  sources = [
24    # test file
25    "array_helper_test.cpp",
26  ]
27
28  configs = [
29    "//ark/js_runtime:ecma_test_config",
30    "//ark/js_runtime:ark_jsruntime_public_config",  # should add before
31                                                     # arkruntime_public_config
32    "//ark/js_runtime:ark_jsruntime_common_config",
33    "$ark_root/runtime:arkruntime_public_config",
34  ]
35
36  deps = [
37    "$ark_root/libpandabase:libarkbase",
38    "//ark/js_runtime:libark_jsruntime_test",
39    sdk_libc_secshared_dep,
40  ]
41
42  if (!is_standard_system) {
43    deps += [ "$ark_root/runtime:libarkruntime" ]
44  }
45}
46
47host_unittest_action("BuiltinsBaseTest") {
48  module_out_path = module_output_path
49
50  sources = [
51    # test file
52    "builtins_base_test.cpp",
53  ]
54
55  configs = [
56    "//ark/js_runtime:ecma_test_config",
57    "//ark/js_runtime:ark_jsruntime_public_config",  # should add before
58                                                     # arkruntime_public_config
59    "//ark/js_runtime:ark_jsruntime_common_config",
60    "$ark_root/runtime:arkruntime_public_config",
61  ]
62
63  deps = [
64    "$ark_root/libpandabase:libarkbase",
65    "//ark/js_runtime:libark_jsruntime_test",
66    sdk_libc_secshared_dep,
67  ]
68
69  if (!is_standard_system) {
70    deps += [ "$ark_root/runtime:libarkruntime" ]
71  }
72}
73
74host_unittest_action("JsonParserTest") {
75  module_out_path = module_output_path
76
77  sources = [
78    # test file
79    "json_parser_test.cpp",
80  ]
81
82  configs = [
83    "//ark/js_runtime:ecma_test_config",
84    "//ark/js_runtime:ark_jsruntime_public_config",  # should add before
85                                                     # arkruntime_public_config
86    "//ark/js_runtime:ark_jsruntime_common_config",
87    "$ark_root/runtime:arkruntime_public_config",
88  ]
89
90  deps = [
91    "$ark_root/libpandabase:libarkbase",
92    "//ark/js_runtime:libark_jsruntime_test",
93    sdk_libc_secshared_dep,
94  ]
95
96  if (!is_standard_system) {
97    deps += [ "$ark_root/runtime:libarkruntime" ]
98  }
99}
100
101host_unittest_action("JsonStringifierTest") {
102  module_out_path = module_output_path
103
104  sources = [
105    # test file
106    "json_stringifier_test.cpp",
107  ]
108
109  configs = [
110    "//ark/js_runtime:ecma_test_config",
111    "//ark/js_runtime:ark_jsruntime_public_config",  # should add before
112                                                     # arkruntime_public_config
113    "//ark/js_runtime:ark_jsruntime_common_config",
114    "$ark_root/runtime:arkruntime_public_config",
115  ]
116
117  deps = [
118    "$ark_root/libpandabase:libarkbase",
119    "//ark/js_runtime:libark_jsruntime_test",
120    sdk_libc_secshared_dep,
121  ]
122
123  if (!is_standard_system) {
124    deps += [ "$ark_root/runtime:libarkruntime" ]
125  }
126}
127
128group("unittest") {
129  testonly = true
130
131  # deps file
132  deps = [
133    ":ArrayHelperTest",
134    ":BuiltinsBaseTest",
135    ":JsonParserTest",
136    ":JsonStringifierTest",
137  ]
138}
139
140group("host_unittest") {
141  testonly = true
142
143  # deps file
144  deps = [
145    ":ArrayHelperTestAction",
146    ":BuiltinsBaseTestAction",
147    ":JsonParserTestAction",
148    ":JsonStringifierTestAction",
149  ]
150}
151