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("//arkcompiler/runtime_core/ark_root.gni") 15import("$build_root/test.gni") 16 17module_output_path = "arkcompiler/runtime_core" 18 19template("host_unittest_action") { 20 _target_name_ = "${target_name}" 21 22 # unittest for phone running 23 ohos_unittest(_target_name_) { 24 forward_variables_from(invoker, "*") 25 } 26 27 _module_out_path_ = invoker.module_out_path 28 29 # unittest for host running 30 action("${_target_name_}Action") { 31 testonly = true 32 33 _host_test_target_ = ":${_target_name_}(${host_toolchain})" 34 _root_out_dir_ = get_label_info(_host_test_target_, "root_out_dir") 35 36 deps = [ _host_test_target_ ] 37 38 script = "//arkcompiler/ets_runtime/script/run_ark_executable.py" 39 40 args = [ 41 "--script-file", 42 rebase_path(_root_out_dir_) + 43 "/tests/unittest/${_module_out_path_}/${_target_name_}", 44 "--expect-output", 45 "0", 46 "--env-path", 47 rebase_path(_root_out_dir_) + "/arkcompiler/runtime_core:" + 48 rebase_path(_root_out_dir_) + "/thirdparty/zlib:", 49 "--timeout-limit", 50 "1200", 51 ] 52 53 inputs = [ 54 "$_root_out_dir_/tests/unittest/${_module_out_path_}/${_target_name_}", 55 ] 56 outputs = [ "$target_out_dir/${_target_name_}/" ] 57 } 58} 59