# Copyright (c) 2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/config/features.gni") import("//build/ohos.gni") import("//build/test.gni") #####################hydra-fuzz################### import("../../../screenlock.gni") ##############################fuzztest########################################## screenlockisdisabled_test = { targetName = "ScreenlockIsdisabledFuzzTest" configFuzzer = "screenlockisdisabled_fuzzer" source = "screenlockisdisabled_fuzzer/screenlockisdisabled_fuzzer.cpp" } screenlocksetdisabled_test = { targetName = "ScreenlockSetdisabledFuzzTest" configFuzzer = "screenlocksetdisabled_fuzzer" source = "screenlocksetdisabled_fuzzer/screenlocksetdisabled_fuzzer.cpp" } screenlocksetauthstate_test = { targetName = "ScreenlockSetAuthstateFuzzTest" configFuzzer = "screenlocksetauthstate_fuzzer" source = "screenlocksetauthstate_fuzzer/screenlocksetauthstate_fuzzer.cpp" } screenlockgetauthstate_test = { targetName = "ScreenlockGetAuthstateFuzzTest" configFuzzer = "screenlockgetauthstate_fuzzer" source = "screenlockgetauthstate_fuzzer/screenlockgetauthstate_fuzzer.cpp" } screenlockrequeststrong_test = { targetName = "ScreenlockRequestStrongFuzzTest" configFuzzer = "screenlockrequeststrong_fuzzer" source = "screenlockrequeststrong_fuzzer/screenlockrequeststrong_fuzzer.cpp" } screenlockgetstrongstate_test = { targetName = "ScreenlockGetStrongStateFuzzTest" configFuzzer = "screenlockgetstrongstate_fuzzer" source = "screenlockgetstrongstate_fuzzer/screenlockgetstrongstate_fuzzer.cpp" } screenlockutils_test = { targetName = "ScreenlockUtilsFuzzTest" configFuzzer = "screenlockutils_fuzzer" source = "screenlockutils_fuzzer/screenlockutils_fuzzer.cpp" } screenlockauthmanager_test = { targetName = "ScreenlockAuthManagerFuzzTest" configFuzzer = "screenlockauthmanager_fuzzer" source = "screenlockauthmanager_fuzzer/screenlockauthmanager_fuzzer.cpp" } screenlockislocked_test = { targetName = "ScreenlockIslockedFuzzTest" configFuzzer = "screenlockislocked_fuzzer" source = "screenlockislocked_fuzzer/screenlockislocked_fuzzer.cpp" } screenlockboundarycode_test = { targetName = "ScreenlockBoundaryCodeFuzzTest" configFuzzer = "screenlockboundarycode_fuzzer" source = "screenlockboundarycode_fuzzer/screenlockboundarycode_fuzzer.cpp" } screenlockdump_test = { targetName = "ScreenlockDumpFuzzTest" configFuzzer = "screenlockdump_fuzzer" source = "screenlockdump_fuzzer/screenlockdump_fuzzer.cpp" } screenlockisscreenlocked_test = { targetName = "ScreenlockIsScreenlockedFuzzTest" configFuzzer = "screenlockisscreenlocked_fuzzer" source = "screenlockisscreenlocked_fuzzer/screenlockisscreenlocked_fuzzer.cpp" } screenlockissecuremode_test = { targetName = "ScreenlockIsSecureModeFuzzTest" configFuzzer = "screenlockissecuremode_fuzzer" source = "screenlockissecuremode_fuzzer/screenlockissecuremode_fuzzer.cpp" } screenlocklock_test = { targetName = "ScreenlockLockFuzzTest" configFuzzer = "screenlocklock_fuzzer" source = "screenlocklock_fuzzer/screenlocklock_fuzzer.cpp" } screenlockonsystemevent_test = { targetName = "ScreenlockOnSystemEventFuzzTest" configFuzzer = "screenlockonsystemevent_fuzzer" source = "screenlockonsystemevent_fuzzer/screenlockonsystemevent_fuzzer.cpp" } screenlocksendscreenlockevent_test = { targetName = "ScreenlockSendScreenlockEventFuzzTest" configFuzzer = "screenlocksendscreenlockevent_fuzzer" source = "screenlocksendscreenlockevent_fuzzer/screenlocksendscreenlockevent_fuzzer.cpp" } screenlockunlockscreen_test = { targetName = "ScreenlockUnlockScreenFuzzTest" configFuzzer = "screenlockunlockscreen_fuzzer" source = "screenlockunlockscreen_fuzzer/screenlockunlockscreen_fuzzer.cpp" } screenlockunlock_test = { targetName = "ScreenlockUnlockFuzzTest" configFuzzer = "screenlockunlock_fuzzer" source = "screenlockunlock_fuzzer/screenlockunlock_fuzzer.cpp" } screenlocklockscreen_test = { targetName = "ScreenlockLockScreenFuzzTest" configFuzzer = "screenlocklockscreen_fuzzer" source = "screenlocklockscreen_fuzzer/screenlocklockscreen_fuzzer.cpp" } screenlock_fuzztests = [ screenlockauthmanager_test, screenlockisdisabled_test, screenlocksetdisabled_test, screenlocksetauthstate_test, screenlockgetauthstate_test, screenlockrequeststrong_test, screenlockgetstrongstate_test, screenlockutils_test, screenlockislocked_test, screenlockboundarycode_test, screenlockdump_test, screenlockisscreenlocked_test, screenlockissecuremode_test, screenlocklock_test, screenlockonsystemevent_test, screenlocksendscreenlockevent_test, screenlockunlockscreen_test, screenlockunlock_test, screenlocklockscreen_test, ] foreach(item, screenlock_fuzztests) { ohos_fuzztest(item.targetName) { module_out_path = "screenlock_mgr/screenlock_mgr" fuzz_config_file = "${screenlock_mgr_path}/test/fuzztest/screenlockservice_fuzzer/${item.configFuzzer}" include_dirs = [ "${screenlock_mgr_path}/frameworks/js/napi/include", "${screenlock_mgr_path}/services/include", "${screenlock_mgr_path}/utils/include", "${screenlock_mgr_path}/test/fuzztest/screenlockservice_fuzzer/common", ] cflags = [ "-g", "-O0", "-Wno-unused-variable", "-fno-omit-frame-pointer", ] deps = [ "${screenlock_mgr_path}/frameworks/js/napi:screenlock_static", "${screenlock_mgr_path}/interfaces/inner_api:screenlock_client_static", "${screenlock_mgr_path}/services:screenlock_server_static", "${screenlock_mgr_path}/utils:screenlock_utils", ] external_deps = [ "ability_base:want", "ability_runtime:ability_manager", "access_token:libaccesstoken_sdk", "access_token:libtokenid_sdk", "c_utils:utils", "ffrt:libffrt", "hilog:libhilog", "ipc:ipc_single", "napi:ace_napi", "os_account:os_account_innerkits", "preferences:native_preferences", "time_service:time_client", "user_auth_framework:userauth_client", "window_manager:libdm", ] sources = [ "common/screenlock_service_fuzz_utils.cpp", item.source, ] } } ############################################################################### group("fuzztest") { testonly = true deps = [] deps += [ # deps file ":ScreenlockAuthManagerFuzzTest", ":ScreenlockBoundaryCodeFuzzTest", ":ScreenlockDumpFuzzTest", ":ScreenlockGetAuthstateFuzzTest", ":ScreenlockGetStrongStateFuzzTest", ":ScreenlockIsScreenlockedFuzzTest", ":ScreenlockIsSecureModeFuzzTest", ":ScreenlockIsdisabledFuzzTest", ":ScreenlockIslockedFuzzTest", ":ScreenlockLockFuzzTest", ":ScreenlockLockScreenFuzzTest", ":ScreenlockOnSystemEventFuzzTest", ":ScreenlockRequestStrongFuzzTest", ":ScreenlockSendScreenlockEventFuzzTest", ":ScreenlockSetAuthstateFuzzTest", ":ScreenlockSetdisabledFuzzTest", ":ScreenlockUnlockFuzzTest", ":ScreenlockUnlockScreenFuzzTest", ":ScreenlockUtilsFuzzTest", ] } ###############################################################################