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("//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:uiabilitykit_native", 62 "${ability_runtime_native_path}/appkit:app_context", 63 "${ability_runtime_native_path}/appkit:appkit_native", 64 "../../../../frameworks/native/ability/native:abilitykit_native", 65 ] 66 67 external_deps = [ 68 "ability_base:configuration", 69 "ability_base:want", 70 "ability_base:zuri", 71 "ability_runtime:ability_deps_wrapper", 72 "ability_runtime:ability_manager", 73 "ability_runtime:abilitykit_native", 74 "ability_runtime:app_manager", 75 "ability_runtime:runtime", 76 "bundle_framework:appexecfwk_base", 77 "bundle_framework:appexecfwk_core", 78 "c_utils:utils", 79 "common_event_service:cesfwk_innerkits", 80 "eventhandler:libeventhandler", 81 "faultloggerd:libdfx_dumpcatcher", 82 "faultloggerd:libfaultloggerd", 83 "googletest:gmock_main", 84 "googletest:gtest_main", 85 "hilog:libhilog", 86 "hisysevent:libhisysevent", 87 "hitrace:hitrace_meter", 88 "init:libbegetutil", 89 "ipc:ipc_core", 90 "ipc:ipc_napi", 91 "napi:ace_napi", 92 "resource_management:global_resmgr", 93 "samgr:samgr_proxy", 94 ] 95} 96 97group("unittest") { 98 testonly = true 99 deps = [ ":ohos_application_first_test" ] 100} 101