199552fe9Sopenharmony_ci# Copyright (c) 2024 Huawei Device Co., Ltd. 299552fe9Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 399552fe9Sopenharmony_ci# you may not use this file except in compliance with the License. 499552fe9Sopenharmony_ci# You may obtain a copy of the License at 599552fe9Sopenharmony_ci# 699552fe9Sopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 799552fe9Sopenharmony_ci# 899552fe9Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software 999552fe9Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 1099552fe9Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1199552fe9Sopenharmony_ci# See the License for the specific language governing permissions and 1299552fe9Sopenharmony_ci# limitations under the License. 1399552fe9Sopenharmony_ci 1499552fe9Sopenharmony_ci#####################hydra-fuzz################### 1599552fe9Sopenharmony_ciimport("//build/config/features.gni") 1699552fe9Sopenharmony_ciimport("//build/test.gni") 1799552fe9Sopenharmony_ciimport("//foundation/resourceschedule/device_standby/standby_service.gni") 1899552fe9Sopenharmony_cimodule_output_path = "device_standby/device_standby" 1999552fe9Sopenharmony_ci 2099552fe9Sopenharmony_ci##############################fuzztest########################################## 2199552fe9Sopenharmony_ciohos_fuzztest("StateManagerAdapterFuzzTest") { 2299552fe9Sopenharmony_ci module_out_path = module_output_path 2399552fe9Sopenharmony_ci fuzz_config_file = 2499552fe9Sopenharmony_ci "${standby_plugins_path}/test/fuzztest/statemanageradapter_fuzzer" 2599552fe9Sopenharmony_ci 2699552fe9Sopenharmony_ci include_dirs = [ 2799552fe9Sopenharmony_ci "${standby_plugins_path}/ext/include", 2899552fe9Sopenharmony_ci "${standby_service_constraints_path}/include", 2999552fe9Sopenharmony_ci "${standby_service_message_listener_path}/include", 3099552fe9Sopenharmony_ci "${standby_service_standby_state_path}/include", 3199552fe9Sopenharmony_ci "${standby_service_strategy_path}/include", 3299552fe9Sopenharmony_ci "${standby_utils_common_path}/include", 3399552fe9Sopenharmony_ci "${standby_utils_policy_path}/include", 3499552fe9Sopenharmony_ci ] 3599552fe9Sopenharmony_ci 3699552fe9Sopenharmony_ci cflags = [ 3799552fe9Sopenharmony_ci "-g", 3899552fe9Sopenharmony_ci "-O0", 3999552fe9Sopenharmony_ci "-Wno-unused-variable", 4099552fe9Sopenharmony_ci "-fno-omit-frame-pointer", 4199552fe9Sopenharmony_ci ] 4299552fe9Sopenharmony_ci 4399552fe9Sopenharmony_ci cflags_cc = [ 4499552fe9Sopenharmony_ci "-Dprivate=public", 4599552fe9Sopenharmony_ci "-Dprotected=public", 4699552fe9Sopenharmony_ci ] 4799552fe9Sopenharmony_ci 4899552fe9Sopenharmony_ci deps = [ 4999552fe9Sopenharmony_ci "${standby_plugins_path}:standby_plugin_static", 5099552fe9Sopenharmony_ci "${standby_service_frameworks_path}:standby_fwk", 5199552fe9Sopenharmony_ci "${standby_service_path}:standby_service", 5299552fe9Sopenharmony_ci "${standby_service_path}:standby_service_static", 5399552fe9Sopenharmony_ci "${standby_utils_common_path}:standby_utils_common", 5499552fe9Sopenharmony_ci "${standby_utils_policy_path}:standby_utils_policy", 5599552fe9Sopenharmony_ci ] 5699552fe9Sopenharmony_ci 5799552fe9Sopenharmony_ci sources = [ "statemanageradapter_fuzzer.cpp" ] 5899552fe9Sopenharmony_ci 5999552fe9Sopenharmony_ci external_deps = [ 6099552fe9Sopenharmony_ci "ability_base:want", 6199552fe9Sopenharmony_ci "ability_runtime:app_manager", 6299552fe9Sopenharmony_ci "ability_runtime:wantagent_innerkits", 6399552fe9Sopenharmony_ci "access_token:libaccesstoken_sdk", 6499552fe9Sopenharmony_ci "c_utils:utils", 6599552fe9Sopenharmony_ci "common_event_service:cesfwk_innerkits", 6699552fe9Sopenharmony_ci "eventhandler:libeventhandler", 6799552fe9Sopenharmony_ci "hilog:libhilog", 6899552fe9Sopenharmony_ci "init:libbegetutil", 6999552fe9Sopenharmony_ci "ipc:ipc_single", 7099552fe9Sopenharmony_ci "samgr:samgr_proxy", 7199552fe9Sopenharmony_ci "time_service:time_client", 7299552fe9Sopenharmony_ci ] 7399552fe9Sopenharmony_ci 7499552fe9Sopenharmony_ci if (standby_power_manager_enable) { 7599552fe9Sopenharmony_ci external_deps += [ "power_manager:powermgr_client" ] 7699552fe9Sopenharmony_ci defines = [ "STANDBY_POWER_MANAGER_ENABLE" ] 7799552fe9Sopenharmony_ci } 7899552fe9Sopenharmony_ci} 7999552fe9Sopenharmony_ci 8099552fe9Sopenharmony_ci############################################################################### 8199552fe9Sopenharmony_cigroup("fuzztest") { 8299552fe9Sopenharmony_ci testonly = true 8399552fe9Sopenharmony_ci deps = [] 8499552fe9Sopenharmony_ci deps += [ 8599552fe9Sopenharmony_ci # deps file 8699552fe9Sopenharmony_ci ":StateManagerAdapterFuzzTest", 8799552fe9Sopenharmony_ci ] 8899552fe9Sopenharmony_ci} 8999552fe9Sopenharmony_ci############################################################################### 90