1# Copyright (c) 2023-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("//foundation/ability/ability_runtime/ability_runtime.gni") 17 18module_output_path = "ability_runtime/freeze_checker" 19 20############################################################################### 21config("module_context_config") { 22 visibility = [ ":*" ] 23 include_dirs = [ 24 "${ability_runtime_innerkits_path}/app_manager/include/appmgr", 25 "${ability_runtime_test_path}/mock/frameworks_kits_appkit_native_test/include", 26 "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include", 27 "${ability_runtime_path}/interfaces/kits/native/appkit/app/task", 28 "${ability_runtime_path}/interfaces/kits/native/ability/native", 29 ] 30 cflags = [] 31 if (target_cpu == "arm") { 32 cflags += [ "-DBINDER_IPC_32BIT" ] 33 } 34 defines = [ "AMS_LOG_TAG = \"ApplicationUnitTest\"" ] 35} 36 37config("ability_start_setting_config") { 38 visibility = [ ":*" ] 39 include_dirs = [ 40 "${ability_runtime_path}/interfaces/kits/native/appkit/app", 41 "${ability_runtime_path}/interfaces/kits/native/appkit/dfr", 42 "${ability_runtime_innerkits_path}/ability_manager/include", 43 ] 44} 45 46ohos_unittest("watchdog_test") { 47 module_out_path = module_output_path 48 49 include_dirs = [ 50 "${ability_runtime_path}/interfaces/kits/native/appkit/app", 51 "${ability_runtime_path}/interfaces/kits/native/appkit/dfr", 52 "${ability_runtime_test_path}/mock/frameworks_kits_appkit_test/include", 53 "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/app", 54 ] 55 56 configs = [ 57 ":module_context_config", 58 ":ability_start_setting_config", 59 ] 60 61 sources = [ 62 "${ability_runtime_test_path}/mock/frameworks_kits_appkit_test/include/mock_app_thread.cpp", 63 "watchdog_test.cpp", 64 ] 65 66 deps = [ 67 "${ability_runtime_innerkits_path}/runtime:runtime", 68 "${ability_runtime_native_path}/appkit:appkit_native", 69 ] 70 71 external_deps = [ 72 "ability_base:base", 73 "ability_base:session_info", 74 "ability_base:want", 75 "bundle_framework:appexecfwk_base", 76 "bundle_framework:appexecfwk_core", 77 "c_utils:utils", 78 "eventhandler:libeventhandler", 79 "googletest:gmock_main", 80 "googletest:gtest_main", 81 "hilog:libhilog", 82 "image_framework:image_native", 83 "ipc:ipc_core", 84 "json:nlohmann_json_static", 85 "jsoncpp:jsoncpp", 86 "napi:ace_napi", 87 ] 88} 89 90############################################################################### 91 92group("unittest") { 93 testonly = true 94 deps = [ ":watchdog_test" ] 95} 96