• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2024 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("//arkcompiler/ets_runtime/js_runtime_config.gni")
15import("//arkcompiler/ets_runtime/test/test_helper.gni")
16
17module_output_path = "ets_runtime"
18
19test_js_path = "//arkcompiler/ets_runtime/ecmascript/compiler/aot_file/tests/aot_file_test_case/"
20
21test_js_files = [ "file_size_test" ]
22
23foreach(file, test_js_files) {
24  es2abc_gen_abc("gen_${file}_abc") {
25    test_js = "${test_js_path}${file}.js"
26    test_abc = "$target_out_dir/${file}.abc"
27    extra_visibility = [ ":*" ]
28    src_js = rebase_path(test_js)
29    dst_file = rebase_path(test_abc)
30    extra_args = [
31      "--module",
32      "--merge-abc",
33    ]
34    in_puts = [ test_js ]
35    out_puts = [ test_abc ]
36  }
37}
38
39host_unittest_action("AOTFileTest") {
40  module_out_path = module_output_path
41
42  sources = [ "aot_file_test.cpp" ]
43
44  configs = [
45    "../../../../:asm_interp_enable_config",
46    "../../../../:ecma_test_config",
47  ]
48
49  deps = [
50    "../../:libark_jsoptimizer_set",
51    "../../../../:libark_jsruntime_test",
52  ]
53
54  external_deps = [
55    "icu:shared_icui18n",
56    "icu:shared_icuuc",
57    "runtime_core:libarkassembler_static",
58  ]
59
60  foreach(file, test_js_files) {
61    deps += [ ":gen_${file}_abc" ]
62  }
63
64  if (is_ohos && is_standard_system) {
65    test_abc_dir = "/data/test"
66  } else {
67    test_abc_dir = rebase_path(target_out_dir)
68  }
69  defines = [ "TARGET_ABC_PATH=\"${test_abc_dir}/\"" ]
70  external_deps += hiviewdfx_ext_deps
71  deps += hiviewdfx_deps
72}
73
74host_unittest_action("AOTChecksumTest") {
75  module_out_path = module_output_path
76
77  sources = [ "aot_checksum_test.cpp" ]
78
79  configs = [
80    "../../../../:asm_interp_enable_config",
81    "../../../../:ecma_test_config",
82  ]
83
84  deps = [
85    "../../:libark_jsoptimizer_set",
86    "../../../../:libark_jsruntime_test",
87  ]
88
89  external_deps = [
90    "icu:shared_icui18n",
91    "icu:shared_icuuc",
92    "runtime_core:libarkassembler_static",
93  ]
94
95  external_deps += hiviewdfx_ext_deps
96  deps += hiviewdfx_deps
97}
98
99group("unittest") {
100  testonly = true
101  deps = []
102  deps += [
103    ":AOTChecksumTestAction",
104    ":AOTFileTestAction",
105  ]
106}
107
108group("host_unittest") {
109  testonly = true
110  deps = [
111    ":AOTChecksumTestAction",
112    ":AOTFileTestAction",
113  ]
114
115  if (is_mac) {
116    deps -= [
117      ":AOTChecksumTestAction",
118      ":AOTFileTestAction",
119    ]
120  }
121}
122