• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025 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/ohos.gni")
15import("//build/test.gni")
16import("../../../sensor.gni")
17
18module_output_path = "drivers_peripheral_sensor/drivers_peripheral_sensor"
19
20group("SensorTestThreeClients") {
21    deps = []
22    testonly = true
23    deps += [
24        ":SensorSetBatchTestSamplingInterval_2",
25        ":SensorSetBatchTestSamplingInterval_20",
26        ":SensorSetSdcSensorTestSamplingInterval_10",
27    ]
28}
29
30ohos_unittest("SensorSetBatchTestSamplingInterval_2") {
31    module_out_path = module_output_path
32
33    include_dirs = [
34        "../../../interfaces/include",
35        "../../../interfaces/v1_0",
36        "../../../utils/include",
37    ]
38
39    sources = [ "sensor_setbatch_test.cpp" ]
40
41    cflags = [
42        "-Wall",
43        "-Wextra",
44        "-Werror",
45        "-fsigned-char",
46        "-fno-common",
47        "-fno-strict-aliasing",
48    ]
49
50    defines = ["SAMPLINGINTERVAL=2000000"]
51
52    if (is_standard_system) {
53        external_deps = [
54            "drivers_interface_sensor:libsensor_proxy_3.0",
55            "hdf_core:libhdf_host",
56            "hdf_core:libhdf_utils",
57            "hilog:libhilog",
58            "hitrace:hitrace_meter",
59            "ipc:ipc_single",
60        ]
61        if (c_utils_enable) {
62            external_deps += [ "c_utils:utils" ]
63        }
64    } else {
65        external_deps = [ "hilog:libhilog" ]
66    }
67    external_deps += [ "ipc:ipc_single" ]
68}
69
70ohos_unittest("SensorSetBatchTestSamplingInterval_20") {
71    module_out_path = module_output_path
72
73    include_dirs = [
74        "../../../interfaces/include",
75        "../../../interfaces/v1_0",
76        "../../../utils/include",
77    ]
78
79    sources = [ "sensor_setbatch_test.cpp" ]
80
81    cflags = [
82        "-Wall",
83        "-Wextra",
84        "-Werror",
85        "-fsigned-char",
86        "-fno-common",
87        "-fno-strict-aliasing",
88    ]
89
90    defines = ["SAMPLINGINTERVAL=20000000"]
91
92    if (is_standard_system) {
93        external_deps = [
94            "drivers_interface_sensor:libsensor_proxy_3.0",
95            "hdf_core:libhdf_host",
96            "hdf_core:libhdf_utils",
97            "hilog:libhilog",
98            "hitrace:hitrace_meter",
99            "ipc:ipc_single",
100        ]
101        if (c_utils_enable) {
102            external_deps += [ "c_utils:utils" ]
103        }
104    } else {
105        external_deps = [ "hilog:libhilog" ]
106    }
107    external_deps += [ "ipc:ipc_single" ]
108}
109
110ohos_unittest("SensorSetSdcSensorTestSamplingInterval_10") {
111    module_out_path = module_output_path
112
113    include_dirs = [
114        "../../../interfaces/include",
115        "../../../interfaces/v1_0",
116        "../../../utils/include",
117    ]
118
119    sources = [ "sensor_setsdcsensor_test.cpp" ]
120
121    cflags = [
122        "-Wall",
123        "-Wextra",
124        "-Werror",
125        "-fsigned-char",
126        "-fno-common",
127        "-fno-strict-aliasing",
128    ]
129
130    if (is_standard_system) {
131        external_deps = [
132            "drivers_interface_sensor:libsensor_proxy_3.0",
133            "hdf_core:libhdf_host",
134            "hdf_core:libhdf_utils",
135            "hilog:libhilog",
136            "hitrace:hitrace_meter",
137            "ipc:ipc_single",
138        ]
139        if (c_utils_enable) {
140            external_deps += [ "c_utils:utils" ]
141        }
142    } else {
143        external_deps = [ "hilog:libhilog" ]
144    }
145    external_deps += [ "ipc:ipc_single" ]
146}