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 14import("//build/test.gni") 15import("../../../batterystats.gni") 16 17module_output_path = "battery_statistics/battery_statistics" 18 19##############################fuzztest########################################## 20ohos_fuzztest("GetAppStatsPercentFuzzTest") { 21 module_out_path = module_output_path 22 fuzz_config_file = 23 "${batterystats_root_path}/test/fuzztest/getappstatspercent_fuzzer" 24 25 include_dirs = [ 26 "./", 27 "${batterystats_utils_path}:batterystats_utils_config", 28 "${batterystats_utils_path}/native/include", 29 "../stats_utils", 30 ] 31 32 configs = [ "${batterystats_utils_path}:coverage_flags" ] 33 34 cflags = [ 35 "-g", 36 "-O0", 37 "-Wno-unused-variable", 38 "-fno-omit-frame-pointer", 39 ] 40 sources = [ 41 "../stats_utils/batterystats_fuzzer.cpp", 42 "./getappstatspercent_fuzzer_test.cpp", 43 ] 44 deps = [ 45 "${batterystats_service_path}:batterystats_service", 46 "${batterystats_service_path}:batterystats_stub", 47 "${batterystats_utils_path}:batterystats_utils", 48 ] 49 50 external_deps = [ 51 "c_utils:utils", 52 "hilog:libhilog", 53 "hisysevent:libhisyseventmanager", 54 "ipc:ipc_core", 55 "safwk:system_ability_fwk", 56 ] 57} 58