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_frontend/es2panda/es2abc_config.gni") 15import("//build/ohos.gni") 16import("//build/test.gni") 17import("//foundation/ability/ability_runtime/ability_runtime.gni") 18 19ohos_unittest("cj_test_runner_test") { 20 module_out_path = "ability_runtime/cj_test_runner_test" 21 include_dirs = [ 22 "native", 23 "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/app", 24 "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context", 25 "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/ability_delegator/include", 26 "${ability_runtime_services_path}/common/include", 27 "${ability_runtime_path}/interfaces/kits/native/ability/native", 28 "${ability_runtime_path}/interfaces/kits/native/appkit/app", 29 "${ability_runtime_path}/interfaces/kits/native/appkit/dfr", 30 "//third_party/json/include", 31 "${ability_base_kits_path}/configuration/include", 32 "${ability_runtime_path}/interfaces/kits/native/appkit/ability_delegator", 33 "${global_path}/resource_management/interfaces/inner_api/include", 34 "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper", 35 "${ability_runtime_path}/frameworks/native/appkit/ability_delegator", 36 "${ability_runtime_path}/cj_environment/interfaces/inner_api", 37 ] 38 39 sources = [ 40 "${ability_runtime_native_path}/appkit/ability_delegator/ability_delegator.cpp", 41 "${ability_runtime_native_path}/appkit/ability_delegator/ability_delegator_args.cpp", 42 "${ability_runtime_native_path}/appkit/ability_delegator/ability_delegator_registry.cpp", 43 "${ability_runtime_native_path}/appkit/ability_delegator/delegator_thread.cpp", 44 "${ability_runtime_native_path}/appkit/ability_delegator/iability_monitor.cpp", 45 "${ability_runtime_native_path}/appkit/ability_delegator/iability_stage_monitor.cpp", 46 "${ability_runtime_native_path}/appkit/ability_delegator/runner_runtime/cj_test_runner_object.cpp", 47 "${ability_runtime_native_path}/appkit/ability_delegator/runner_runtime/js_test_runner.cpp", 48 "${ability_runtime_native_path}/appkit/ability_delegator/shell_cmd_result.cpp", 49 "${ability_runtime_native_path}/appkit/ability_delegator/test_runner.cpp", 50 "${ability_runtime_path}/frameworks/native/appkit/ability_delegator/runner_runtime/cj_test_runner.cpp", 51 "${ability_runtime_path}/tools/aa/src/shell_command_result.cpp", 52 "${ability_runtime_path}/tools/aa/src/test_observer_proxy.cpp", 53 "cj_test_runner_test.cpp", 54 ] 55 configs = [ "${c_utils_base_path}:utils_config" ] 56 cflags = [] 57 if (target_cpu == "arm") { 58 cflags += [ "-DBINDER_IPC_32BIT" ] 59 } 60 deps = [ 61 "${ability_runtime_innerkits_path}/ability_manager:ability_manager", 62 "${ability_runtime_innerkits_path}/app_manager:app_manager", 63 "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper", 64 "${ability_runtime_innerkits_path}/runtime:runtime", 65 "${ability_runtime_native_path}/ability/native:ability_thread", 66 "${ability_runtime_native_path}/ability/native:abilitykit_native", 67 "${ability_runtime_native_path}/ability/native:uiabilitykit_native", 68 "${ability_runtime_native_path}/appkit:app_context", 69 "${ability_runtime_native_path}/appkit:appkit_manager_helper", 70 "${ability_runtime_native_path}/appkit:appkit_native", 71 "${ability_runtime_native_path}/appkit:delegator_mgmt", 72 "${ability_runtime_path}/frameworks/cj/ffi:cj_ability_ffi", 73 "${distributedschedule_path}/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", 74 "//third_party/googletest:gmock_main", 75 "//third_party/googletest:gtest_main", 76 ] 77 78 external_deps = [ 79 "ability_base:base", 80 "ability_base:configuration", 81 "ability_base:extractortool", 82 "ability_base:want", 83 "ability_runtime:runtime", 84 "bundle_framework:appexecfwk_base", 85 "bundle_framework:appexecfwk_base", 86 "bundle_framework:appexecfwk_core", 87 "bundle_framework:appexecfwk_core", 88 "c_utils:utils", 89 "common_event_service:cesfwk_innerkits", 90 "ets_runtime:libark_jsruntime", 91 "eventhandler:libeventhandler", 92 "ffrt:libffrt", 93 "hilog:libhilog", 94 "hitrace:hitrace_meter", 95 "init:libbegetutil", 96 "ipc:ipc_core", 97 "napi:ace_napi", 98 "napi:cj_bind_native", 99 "resource_management:global_resmgr", 100 ] 101 102 if (ability_runtime_graphics) { 103 external_deps += [ "window_manager:libwm" ] 104 } 105} 106 107group("unittest") { 108 testonly = true 109 deps = [ ":cj_test_runner_test" ] 110} 111