• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
14#####################hydra-fuzz###################
15import("//build/config/features.gni")
16import("//build/ohos.gni")
17import("//build/test.gni")
18import("../../../var.gni")
19module_output_path = "safwk/safwk"
20safwk_dir = "../../.."
21safwk_services_dir = "${safwk_dir}/services/safwk/src"
22
23config("safwk_fuzz_test_config") {
24  include_dirs = [
25    "${safwk_dir}/services/safwk/include",
26    "${safwk_dir}/test/services/safwk/unittest/include",
27  ]
28}
29
30##############################fuzztest##########################################
31ohos_fuzztest("SystemAbilityFwkFuzzTest") {
32  module_out_path = module_output_path
33
34  fuzz_config_file = "${safwk_dir}/test/fuzztest/systemabilityfwk_fuzzer"
35
36  configs = [ ":safwk_fuzz_test_config" ]
37
38  sources = [
39    "${safwk_dir}/test/services/safwk/unittest/mock_accesstoken_kit.cpp",
40    "${safwk_dir}/test/services/safwk/unittest/mock_sa_realize.cpp",
41    "${safwk_dir}/test/services/safwk/unittest/sa_mock_permission.cpp",
42    "${safwk_services_dir}/local_ability_manager.cpp",
43    "${safwk_services_dir}/local_ability_manager_dumper.cpp",
44    "${safwk_services_dir}/local_ability_manager_stub.cpp",
45    "${safwk_services_dir}/system_ability.cpp",
46    "${safwk_services_dir}/system_ability_ondemand_reason.cpp",
47    "systemabilityfwk_fuzzer.cpp",
48  ]
49  deps = []
50
51  external_deps = [
52    "access_token:libaccesstoken_sdk",
53    "c_utils:utils",
54    "hilog:libhilog",
55    "hitrace:hitrace_meter",
56    "ipc:ipc_core",
57    "samgr:samgr_common",
58    "samgr:samgr_proxy",
59  ]
60  defines = []
61  if (safwk_support_access_token) {
62    external_deps += [
63      "access_token:libnativetoken_shared",
64      "access_token:libtokensetproc_shared",
65    ]
66    defines += [ "SUPPORT_ACCESS_TOKEN" ]
67  }
68}
69
70group("fuzztest") {
71  testonly = true
72  deps = []
73
74  deps += [
75    # deps file
76    ":SystemAbilityFwkFuzzTest",
77  ]
78}
79