1# Copyright (c) 2022-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("//base/security/device_auth/deps_adapter/deviceauth_hals.gni")
15import("//base/security/device_auth/services/deviceauth.gni")
16
17#####################hydra-fuzz###################
18import("//build/config/features.gni")
19import("//build/ohos.gni")
20import("//build/test.gni")
21module_output_path = "device_auth/device_auth"
22
23##############################fuzztest##########################################
24ohos_fuzztest("DevAuthServProcessAuthDataFuzzTest") {
25  module_out_path = module_output_path
26  fuzz_config_file = "//base/security/device_auth/test/fuzztest/device_auth_service/devauthservprocessauthdata_fuzzer"
27  include_dirs = inc_path + hals_inc_path
28  include_dirs += [
29    "${frameworks_path}/inc/standard",
30    "${dev_frameworks_path}/inc/hiview_adapter",
31  ]
32  sources = [ "devauthservprocessauthdata_fuzzer.cpp" ]
33  sources += deviceauth_files
34  sources += hiview_adapter_files
35  if (device_auth_enable_soft_bus_channel == true) {
36    sources -= soft_bus_channel_files
37    sources += soft_bus_channel_mock_files
38  }
39  defines = deviceauth_defines
40  if (support_os_account) {
41    sources -= os_account_adapter_files
42    sources += os_account_adapter_mock_files
43  }
44  cflags = [
45    "-g",
46    "-O0",
47    "-Wno-unused-variable",
48    "-fno-omit-frame-pointer",
49    "-DHILOG_ENABLE",
50  ]
51  cflags += build_flags
52  if (target_cpu == "arm") {
53    cflags += [ "-DBINDER_IPC_32BIT" ]
54  }
55  deps = [ "${deps_adapter_path}:${hal_module_test_name}" ]
56  external_deps = [
57    "cJSON:cjson",
58    "c_utils:utils",
59    "dsoftbus:softbus_client",
60    "hilog:libhilog",
61    "hisysevent:libhisysevent",
62    "hitrace:hitrace_meter",
63  ]
64}
65
66###############################################################################
67group("fuzztest") {
68  testonly = true
69  deps = []
70  deps += [
71    # deps file
72    ":DevAuthServProcessAuthDataFuzzTest",
73  ]
74}
75###############################################################################
76