• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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("//build/test.gni")
15
16SUBSYSTEM_DIR = "//base/sensors"
17module_output_path = "sensors/sensor/interfaces"
18
19###########################SensorAgentTest###########################
20ohos_unittest("SensorAgentTest") {
21  module_out_path = module_output_path
22
23  sources = [
24    "$SUBSYSTEM_DIR/sensor/test/unittest/common/src/system_info.cpp",
25    "unittest/sensor_agent_test.cpp",
26  ]
27
28  include_dirs = [
29    "//commonlibrary/c_utils/base/include",
30    "$SUBSYSTEM_DIR/sensor/utils/include",
31    "$SUBSYSTEM_DIR/sensor/interfaces/native/include",
32    "$SUBSYSTEM_DIR/sensor/test/unittest/common/include",
33  ]
34
35  deps = [
36    "$SUBSYSTEM_DIR/sensor/interfaces/native:sensor_ndk_target",
37    "$SUBSYSTEM_DIR/sensor/utils:libsensor_utils",
38    "//third_party/googletest:gmock_main",
39    "//third_party/googletest:gtest_main",
40  ]
41  external_deps = [
42    "access_token:libaccesstoken_sdk",
43    "access_token:libnativetoken",
44    "access_token:libtoken_setproc",
45    "c_utils:utils",
46    "hiviewdfx_hilog_native:libhilog",
47    "ipc:ipc_core",
48  ]
49}
50
51ohos_unittest("SensorAlgorithmTest") {
52  module_out_path = module_output_path
53
54  sources = [ "unittest/sensor_algorithm_test.cpp" ]
55
56  include_dirs = [
57    "//commonlibrary/c_utils/base/include",
58    "$SUBSYSTEM_DIR/sensor/utils/include",
59    "$SUBSYSTEM_DIR/sensor/interfaces/native/include",
60    "$SUBSYSTEM_DIR/sensor/test/unittest/common/include",
61  ]
62
63  deps = [
64    "$SUBSYSTEM_DIR/sensor/interfaces/native:sensor_ndk_target",
65    "$SUBSYSTEM_DIR/sensor/utils:libsensor_utils",
66    "//third_party/googletest:gmock_main",
67    "//third_party/googletest:gtest_main",
68  ]
69  external_deps = [
70    "c_utils:utils",
71    "hiviewdfx_hilog_native:libhilog",
72    "ipc:ipc_core",
73  ]
74}
75
76###########################end###########################
77group("unittest") {
78  testonly = true
79  deps = [
80    ":SensorAgentTest",
81    ":SensorAlgorithmTest",
82  ]
83}
84