1# Copyright (c) 2023 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("../test_helper.gni")
15
16action("ark_regress_test") {
17  _host_test_target_ = ":ark_regress_test(${host_toolchain})"
18  _root_out_dir_ = get_label_info(_host_test_target_, "root_out_dir")
19  ark_js_runtime_dir = rebase_path("${_root_out_dir_}/arkcompiler/ets_runtime")
20  icu_dir = rebase_path("${_root_out_dir_}/thirdparty/icu")
21  llvm_lib_dir = rebase_path("//prebuilts/clang/ohos/linux-x86_64/llvm/lib/")
22  zlib_dir = rebase_path("${_root_out_dir_}/thirdparty/zlib")
23  ld_library_path =
24      "${ark_js_runtime_dir}:${icu_dir}:${llvm_lib_dir}:${zlib_dir}"
25  script = "$js_root/test/regresstest/run_regress_test.py"
26  _target_out_dir_ = "$target_out_dir"
27  args = [
28    "--ark-tool",
29    rebase_path(_root_out_dir_) + "/arkcompiler/ets_runtime/ark_js_vm",
30    "--ark-frontend-binary",
31    rebase_path(_root_out_dir_) + "/arkcompiler/ets_frontend/es2abc",
32    "--LD_LIBRARY_PATH",
33    ld_library_path,
34    "--out-dir",
35    rebase_path(_target_out_dir_),
36  ]
37  inputs = []
38  outputs = [ "$target_out_dir/regresstest/" ]
39}
40