158ec469eSopenharmony_ci# Copyright (c) 2024 Huawei Device Co., Ltd.
258ec469eSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
358ec469eSopenharmony_ci# you may not use this file except in compliance with the License.
458ec469eSopenharmony_ci# You may obtain a copy of the License at
558ec469eSopenharmony_ci#
658ec469eSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
758ec469eSopenharmony_ci#
858ec469eSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
958ec469eSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
1058ec469eSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1158ec469eSopenharmony_ci# See the License for the specific language governing permissions and
1258ec469eSopenharmony_ci# limitations under the License.
1358ec469eSopenharmony_ci
1458ec469eSopenharmony_ciimport("//build/config/features.gni")
1558ec469eSopenharmony_ciimport("//build/ohos.gni")
1658ec469eSopenharmony_ciimport("//build/test.gni")
1758ec469eSopenharmony_ciimport("./../../../../miscdevice.gni")
1858ec469eSopenharmony_ci
1958ec469eSopenharmony_ciohos_fuzztest("PlayPatternStubFuzzTest") {
2058ec469eSopenharmony_ci  module_out_path = FUZZ_MODULE_OUT_PATH
2158ec469eSopenharmony_ci
2258ec469eSopenharmony_ci  fuzz_config_file =
2358ec469eSopenharmony_ci      "$SUBSYSTEM_DIR/test/fuzztest/service/playpatternstub_fuzzer"
2458ec469eSopenharmony_ci
2558ec469eSopenharmony_ci  include_dirs = [
2658ec469eSopenharmony_ci    "$SUBSYSTEM_DIR/interfaces/inner_api/vibrator",
2758ec469eSopenharmony_ci    "$SUBSYSTEM_DIR/frameworks/native/common/include",
2858ec469eSopenharmony_ci    "$SUBSYSTEM_DIR/interfaces/inner_api/light",
2958ec469eSopenharmony_ci    "$SUBSYSTEM_DIR/services/miscdevice_service/include",
3058ec469eSopenharmony_ci    "$SUBSYSTEM_DIR/services/miscdevice_service/hdi_connection/adapter/include",
3158ec469eSopenharmony_ci    "$SUBSYSTEM_DIR/services/miscdevice_service/hdi_connection/interface/include",
3258ec469eSopenharmony_ci    "$SUBSYSTEM_DIR/utils/common/include",
3358ec469eSopenharmony_ci    "$SUBSYSTEM_DIR/test/fuzztest/service/playpatternstub_fuzzer",
3458ec469eSopenharmony_ci  ]
3558ec469eSopenharmony_ci
3658ec469eSopenharmony_ci  cflags = [
3758ec469eSopenharmony_ci    "-g",
3858ec469eSopenharmony_ci    "-O0",
3958ec469eSopenharmony_ci    "-Wno-unused-variable",
4058ec469eSopenharmony_ci    "-fno-omit-frame-pointer",
4158ec469eSopenharmony_ci  ]
4258ec469eSopenharmony_ci
4358ec469eSopenharmony_ci  sources = [ "playpatternstub_fuzzer.cpp" ]
4458ec469eSopenharmony_ci
4558ec469eSopenharmony_ci  deps = [
4658ec469eSopenharmony_ci    "$SUBSYSTEM_DIR/frameworks/native/light:light_interface_native",
4758ec469eSopenharmony_ci    "$SUBSYSTEM_DIR/frameworks/native/vibrator:vibrator_interface_native",
4858ec469eSopenharmony_ci    "$SUBSYSTEM_DIR/services/miscdevice_service:libmiscdevice_service_static",
4958ec469eSopenharmony_ci    "$SUBSYSTEM_DIR/utils/common:libmiscdevice_utils",
5058ec469eSopenharmony_ci  ]
5158ec469eSopenharmony_ci
5258ec469eSopenharmony_ci  external_deps = [
5358ec469eSopenharmony_ci    "access_token:libaccesstoken_sdk",
5458ec469eSopenharmony_ci    "access_token:libnativetoken_shared",
5558ec469eSopenharmony_ci    "access_token:libtokensetproc_shared",
5658ec469eSopenharmony_ci    "cJSON:cjson",
5758ec469eSopenharmony_ci    "c_utils:utils",
5858ec469eSopenharmony_ci    "drivers_interface_vibrator:libvibrator_proxy_1.1",
5958ec469eSopenharmony_ci    "hilog:libhilog",
6058ec469eSopenharmony_ci    "ipc:ipc_single",
6158ec469eSopenharmony_ci    "samgr:samgr_proxy",
6258ec469eSopenharmony_ci  ]
6358ec469eSopenharmony_ci
6458ec469eSopenharmony_ci  defines = miscdevice_default_defines
6558ec469eSopenharmony_ci
6658ec469eSopenharmony_ci  if (hdf_drivers_interface_light) {
6758ec469eSopenharmony_ci    external_deps += [ "drivers_interface_light:liblight_proxy_1.0" ]
6858ec469eSopenharmony_ci  }
6958ec469eSopenharmony_ci}
7058ec469eSopenharmony_ci
7158ec469eSopenharmony_cigroup("fuzztest") {
7258ec469eSopenharmony_ci  testonly = true
7358ec469eSopenharmony_ci  deps = []
7458ec469eSopenharmony_ci  deps += [
7558ec469eSopenharmony_ci    # deps file
7658ec469eSopenharmony_ci    ":PlayPatternStubFuzzTest",
7758ec469eSopenharmony_ci  ]
7858ec469eSopenharmony_ci}
79