• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2022 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/location/config.gni")
15import("//build/test.gni")
16
17module_output_path = "location/location"
18if (location_feature_with_geocode) {
19  ohos_unittest("GeocodeServiceAbilityTest") {
20    module_out_path = module_output_path
21    sources = [ "$LOCATION_ROOT_DIR/test/location_geocode/source/geo_convert_service_test.cpp" ]
22
23    include_dirs = [
24      "$LOCATION_ROOT_DIR/interfaces/inner_api/include",
25      "$LOCATION_ROOT_DIR/test/location_geocode/include",
26      "$LOCATION_ROOT_DIR/test/location_geocode/mock/include",
27      "$LOCATION_GEOCONVERT_ROOT/include",
28      "$LOCATION_LOCATOR_ROOT/include",
29      "$LOCATION_ROOT_DIR/test/mock/include",
30    ]
31
32    deps = [
33      "$LOCATION_GEOCONVERT_ROOT:lbsservice_geocode_static",
34      "$LOCATION_LOCATOR_ROOT:lbsservice_locator_static",
35      "$LOCATION_ROOT_DIR/frameworks/js/napi:geolocation_static",
36      "$LOCATION_ROOT_DIR/frameworks/location_common/common:lbsservice_common_static",
37    ]
38
39    sanitize = {
40      cfi = true
41      cfi_cross_dso = true
42      debug = false
43      blocklist = "./../../cfi_blocklist.txt"
44    }
45    branch_protector_ret = "pac_ret"
46
47    external_deps = [
48      "napi:ace_napi",
49      "googletest:gmock_main",
50      "googletest:gtest_main",
51      "access_token:libaccesstoken_sdk",
52      "access_token:libnativetoken",
53      "access_token:libtoken_setproc",
54      "c_utils:utils",
55      "common_event_service:cesfwk_innerkits",
56      "ffrt:libffrt",
57      "hilog:libhilog",
58      "hisysevent:libhisysevent",
59      "init:libbegetutil",
60      "ipc:ipc_core",
61      "safwk:system_ability_fwk",
62      "samgr:samgr_proxy",
63      "selinux_adapter:librestorecon",
64    ]
65
66    defines = []
67    if (location_feature_with_geocode) {
68      defines += [ "FEATURE_GEOCODE_SUPPORT" ]
69    }
70
71    module_out_path = module_output_path
72  }
73} else {
74  ohos_unittest("GeocodeServiceAbilityTest") {
75    module_out_path = module_output_path
76  }
77}
78
79group("unittest") {
80  testonly = true
81  deps = []
82  deps += [ ":GeocodeServiceAbilityTest" ]
83}
84