1# Copyright (c) 2023 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 14#####################hydra-fuzz################### 15import("//build/config/features.gni") 16import("//build/test.gni") 17import("../../../device_usage_statistics.gni") 18 19##############################fuzztest########################################## 20module_output_path = "device_usage_statistics/deviceusagestatisticstest" 21 22config("module_private_config") { 23 include_dirs = [ 24 "${usage_statistics_path}/interfaces/innerkits/include", 25 "${usage_statistics_path}/services/common/include", 26 "${usage_statistics_path}/services/packageusage/include", 27 "${usage_statistics_path}/services/packagegroup/include", 28 "${usage_statistics_path}/interfaces/kits/bundlestats/napi/include", 29 "${usage_statistics_path}/utils/include", 30 "../common", 31 ] 32} 33 34ohos_fuzztest("BundleActiveObserverFuzzTest") { 35 module_out_path = module_output_path 36 fuzz_config_file = 37 "${usage_statistics_path}/test/fuzztest/bundleactiveobserver_fuzzer" 38 configs = [ ":module_private_config" ] 39 cflags = [ 40 "-g", 41 "-O0", 42 "-Wno-unused-variable", 43 "-fno-omit-frame-pointer", 44 ] 45 sources = [ 46 "../common/fuzztest_helper.cpp", 47 "bundleactiveobserver_fuzzer.cpp", 48 ] 49 50 public_deps = [ 51 "${usage_statistics_path}:usagestatservice_static", 52 "${usage_statistics_path}:usagestatsinner", 53 ] 54 external_deps = [ 55 "ability_base:want", 56 "ability_runtime:app_manager", 57 "ability_runtime:wantagent_innerkits", 58 "access_token:libaccesstoken_sdk", 59 "access_token:libnativetoken", 60 "access_token:libtoken_setproc", 61 "access_token:libtokenid_sdk", 62 "bundle_framework:appexecfwk_base", 63 "bundle_framework:appexecfwk_core", 64 "c_utils:utils", 65 "common_event_service:cesfwk_innerkits", 66 "eventhandler:libeventhandler", 67 "hilog:libhilog", 68 "init:libbegetutil", 69 "ipc:ipc_single", 70 "power_manager:powermgr_client", 71 "relational_store:native_rdb", 72 "safwk:system_ability_fwk", 73 "samgr:samgr_proxy", 74 "time_service:time_client", 75 ] 76 77 if (bgtaskmgr_enable) { 78 external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] 79 defines = [ "BGTASKMGR_ENABLE" ] 80 } 81 if (os_account_part_enabled) { 82 cflags_cc = [ "-DOS_ACCOUNT_PART_ENABLED" ] 83 external_deps += [ "os_account:os_account_innerkits" ] 84 } 85} 86 87############################################################################### 88group("fuzztest") { 89 testonly = true 90 deps = [] 91 deps += [ 92 # deps file 93 ":BundleActiveObserverFuzzTest", 94 ] 95} 96############################################################################### 97