1# Copyright (c) 2024-2025 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("//build/ohos.gni") 15import("//build/test.gni") 16import("../../../../ability_runtime.gni") 17 18config("coverage_flags") { 19 if (ability_runtime_feature_coverage) { 20 cflags = [ "--coverage" ] 21 ldflags = [ "--coverage" ] 22 } 23} 24 25ohos_unittest("ohos_application_first_test") { 26 module_out_path = "ability_runtime/ability_runtime/appkit" 27 sanitize = { 28 cfi = true 29 cfi_cross_dso = true 30 debug = false 31 } 32 branch_protector_ret = "pac_ret" 33 34 include_dirs = [ 35 "${ability_runtime_path}/mock/services_appmgr_test/include", 36 "${ability_runtime_path}/interfaces/kits/native/appkit/app", 37 "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context", 38 "${ability_runtime_path}/interfaces/kits/native/ability/native", 39 "${ability_runtime_test_path}/mock/frameworks_kits_runtime_test/", 40 "${ability_runtime_test_path}/mock/frameworks_kits_appkit_native_test/include", 41 ] 42 43 sources = [ 44 "${ability_runtime_path}/frameworks/native/ability/native/application_configuration_manager.cpp", 45 "ohos_application_first_test.cpp", 46 ] 47 48 configs = [ 49 "${ability_runtime_services_path}/common:common_config", 50 ":coverage_flags", 51 ] 52 53 cflags = [] 54 55 if (target_cpu == "arm") { 56 cflags += [ "-DBINDER_IPC_32BIT" ] 57 } 58 59 deps = [ 60 "${ability_runtime_native_path}/ability/native:ability_thread", 61 "${ability_runtime_native_path}/ability/native:abilitykit_utils", 62 "${ability_runtime_native_path}/ability/native:uiabilitykit_native", 63 "${ability_runtime_native_path}/appkit:app_context", 64 "${ability_runtime_native_path}/appkit:appkit_native", 65 "../../../../frameworks/native/ability/native:abilitykit_native", 66 ] 67 68 external_deps = [ 69 "ability_base:configuration", 70 "ability_base:want", 71 "ability_base:zuri", 72 "ability_runtime:ability_deps_wrapper", 73 "ability_runtime:ability_manager", 74 "ability_runtime:abilitykit_native", 75 "ability_runtime:app_manager", 76 "ability_runtime:runtime", 77 "bundle_framework:appexecfwk_base", 78 "bundle_framework:appexecfwk_core", 79 "c_utils:utils", 80 "common_event_service:cesfwk_innerkits", 81 "eventhandler:libeventhandler", 82 "faultloggerd:libdfx_dumpcatcher", 83 "faultloggerd:libfaultloggerd", 84 "form_fwk:fmskit_native", 85 "googletest:gmock_main", 86 "googletest:gtest_main", 87 "hilog:libhilog", 88 "hisysevent:libhisysevent", 89 "hitrace:hitrace_meter", 90 "init:libbegetutil", 91 "ipc:ipc_core", 92 "ipc:ipc_napi", 93 "napi:ace_napi", 94 "resource_management:global_resmgr", 95 "samgr:samgr_proxy", 96 ] 97} 98 99group("unittest") { 100 testonly = true 101 deps = [ ":ohos_application_first_test" ] 102} 103