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. 13import("//build/ohos.gni") 14import("//build/test.gni") 15 16if (is_standard_system || ark_standalone_build) { 17 _icu_path_ = "thirdparty/icu" 18} else { 19 _icu_path_ = "global/i18n" 20} 21module_output_path = "third_party/jerryscript" 22 23template("host_unittest_action") { 24 _target_name_ = "${target_name}" 25 26 # unittest for phone running 27 ohos_unittest(_target_name_) { 28 forward_variables_from(invoker, "*") 29 } 30 31 # _module_out_path_ = invoker.module_out_path 32 33 # unittest for host running 34 action("${_target_name_}Action") { 35 testonly = true 36 _host_test_target_ = ":${_target_name_}(${host_toolchain})" 37 _root_out_dir_ = get_label_info(_host_test_target_, "root_out_dir") 38 39 deps = [ _host_test_target_ ] 40 jerry_dir = "./" 41 script = "//third_party/jerryscript/tools/runners/run-test-suite.py" 42 inputs = [] 43 outputs = [ "$target_out_dir/${_target_name_}/" ] 44 45 if ("${_target_name_}" == "JsEs2015Test") { 46 args = [ 47 "--engine", 48 rebase_path(_root_out_dir_) + "/common/common/jerry", 49 "--test-dir", 50 rebase_path(jerry_dir), 51 "--skip-list=es5.1", 52 "--skip-file=eval.js", 53 ] 54 } 55 if ("${_target_name_}" == "JsEsTest") { 56 args = [ 57 "--engine", 58 rebase_path(_root_out_dir_) + "/common/common/jerry", 59 "--test-dir", 60 rebase_path(jerry_dir), 61 "--skip-list=es2015", 62 "--skip-file=eval.js", 63 ] 64 } 65 } 66} 67