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("//foundation/arkui/napi/napi.gni") 15 16import("//build/test.gni") 17import("//foundation/ability/form_fwk/form_fwk.gni") 18import("//foundation/arkui/ace_engine/ace_config.gni") 19import("//foundation/arkui/napi/test/unittest/ut.gni") 20 21if (is_standard_system) { 22 module_output_path = "ace_engine/napi" 23} else { 24 module_output_path = "ace_engine_full/napi" 25} 26 27ohos_unittest("test_ark_unittest") { 28 module_out_path = module_output_path 29 30 include_dirs = ark_include 31 32 cflags = [ "-g3" ] 33 34 sources = [ 35 "engine/test_ark.cpp", 36 "test_napi.cpp", 37 ] 38 39 defines = [ "NAPI_TEST" ] 40 41 deps = ark_deps 42 43 deps += [ "../..:ace_napi" ] 44 45 external_deps = [ 46 "bounds_checking_function:libsec_shared", 47 "c_utils:utils", 48 ] 49 50 external_deps += [ "hilog:libhilog" ] 51 external_deps += [ "ets_runtime:libark_jsruntime" ] 52} 53 54ohos_unittest("test_ark_unittest_threadsafe") { 55 module_out_path = module_output_path 56 57 include_dirs = ark_include 58 59 cflags = [ "-g3" ] 60 61 sources = [ 62 "engine/test_ark.cpp", 63 "test_napi_threadsafe.cpp", 64 ] 65 66 defines = [ "NAPI_TEST" ] 67 68 deps = ark_deps 69 deps += [ "../..:ace_napi" ] 70 71 external_deps = [ "bounds_checking_function:libsec_shared" ] 72 73 external_deps += [ "hilog:libhilog" ] 74 external_deps += [ "ets_runtime:libark_jsruntime" ] 75} 76 77ohos_unittest("test_ark_api_allowlist") { 78 module_out_path = module_output_path 79 80 include_dirs = ark_include 81 82 cflags = [ "-g3" ] 83 84 sources = [ 85 "engine/test_ark.cpp", 86 "test_ark_api_allowlist.cpp", 87 ] 88 89 defines = [ "NAPI_TEST" ] 90 91 deps = ark_deps 92 deps += [ "../..:ace_napi" ] 93 deps += [ "${form_render_service_path}/..:formrender" ] 94 95 external_deps = [ "bounds_checking_function:libsec_shared" ] 96 97 external_deps += [ "hilog:libhilog" ] 98 external_deps += [ "ets_runtime:libark_jsruntime" ] 99} 100 101group("unittest") { 102 testonly = true 103 deps = [ 104 ":test_ark_api_allowlist", 105 ":test_ark_unittest", 106 ":test_ark_unittest_threadsafe", 107 ] 108} 109 110#jerry tdd test for phone running 111group("jerry_tdd_test_run") { 112 testonly = true 113 deps = [ "//third_party/jerryscript/tests/unit-core:jerry_tdd_test" ] 114} 115 116#jerry es2015 test for phone running 117group("jerry_jstest_es2015") { 118 testonly = true 119 deps = [ "//third_party/jerryscript/tests/jerry:jerry_js_test_es2015" ] 120} 121 122#jerry es2015 test for host running 123group("jerry_host_jstest_es2015") { 124 testonly = true 125 deps = [ 126 "//third_party/jerryscript/tests/jerry:jerry_host_js_test_es2015", 127 "//third_party/jerryscript/tests/unit-core:jerry_tdd_host_test", 128 ] 129} 130 131#jerry es5.1 test for phone running 132group("jerry_jstest_es5.1") { 133 testonly = true 134 deps = [ "//third_party/jerryscript/tests/jerry:jerry_js_test_es5.1" ] 135} 136 137#jerry es5.1 test for host running 138group("jerry_host_jstest_es5.1") { 139 testonly = true 140 deps = [ 141 "//third_party/jerryscript/tests/jerry:jerry_host_js_test_es5.1", 142 "//third_party/jerryscript/tests/unit-core:jerry_tdd_host_test", 143 ] 144} 145 146#jerry tdd test for host running 147group("jerry_tdd_host_test_run") { 148 testonly = true 149 deps = [ "//third_party/jerryscript/tests/unit-core:jerry_tdd_host_test" ] 150} 151