• 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("SensorTestFiveClients") {
21    deps = []
22    testonly = true
23    deps += [
24        ":SensorSetBatchTest1",
25        ":SensorSetBatchTest2",
26        ":SensorSetBatchTest3",
27        ":SensorSetBatchTest4",
28        ":SensorSetBatchTest5",
29    ]
30}
31
32ohos_unittest("SensorSetBatchTest1") {
33    module_out_path = module_output_path
34
35    include_dirs = [
36        "../../../interfaces/include",
37        "../../../interfaces/v1_0",
38        "../../../utils/include",
39    ]
40
41    sources = [ "sensor_setbatch_test.cpp" ]
42
43    cflags = [
44        "-Wall",
45        "-Wextra",
46        "-Werror",
47        "-fsigned-char",
48        "-fno-common",
49        "-fno-strict-aliasing",
50    ]
51
52    defines = ["SAMPLINGINTERVAL=200000000"]
53
54    if (is_standard_system) {
55        external_deps = [
56            "drivers_interface_sensor:libsensor_proxy_3.0",
57            "hdf_core:libhdf_host",
58            "hdf_core:libhdf_utils",
59            "hilog:libhilog",
60            "hitrace:hitrace_meter",
61            "ipc:ipc_single",
62        ]
63        if (c_utils_enable) {
64            external_deps += [ "c_utils:utils" ]
65        }
66    } else {
67        external_deps = [ "hilog:libhilog" ]
68    }
69    external_deps += [ "ipc:ipc_single" ]
70}
71
72ohos_unittest("SensorSetBatchTest2") {
73    module_out_path = module_output_path
74
75    include_dirs = [
76        "../../../interfaces/include",
77        "../../../interfaces/v1_0",
78        "../../../utils/include",
79    ]
80
81    sources = [ "sensor_setbatch_test.cpp" ]
82
83    cflags = [
84        "-Wall",
85        "-Wextra",
86        "-Werror",
87        "-fsigned-char",
88        "-fno-common",
89        "-fno-strict-aliasing",
90    ]
91
92    defines = ["SAMPLINGINTERVAL=100000000"]
93
94    if (is_standard_system) {
95        external_deps = [
96            "drivers_interface_sensor:libsensor_proxy_3.0",
97            "hdf_core:libhdf_host",
98            "hdf_core:libhdf_utils",
99            "hilog:libhilog",
100            "hitrace:hitrace_meter",
101            "ipc:ipc_single",
102        ]
103        if (c_utils_enable) {
104            external_deps += [ "c_utils:utils" ]
105        }
106    } else {
107        external_deps = [ "hilog:libhilog" ]
108    }
109    external_deps += [ "ipc:ipc_single" ]
110}
111
112ohos_unittest("SensorSetBatchTest3") {
113    module_out_path = module_output_path
114
115    include_dirs = [
116        "../../../interfaces/include",
117        "../../../interfaces/v1_0",
118        "../../../utils/include",
119    ]
120
121    sources = [ "sensor_setbatch_test.cpp" ]
122
123    cflags = [
124        "-Wall",
125        "-Wextra",
126        "-Werror",
127        "-fsigned-char",
128        "-fno-common",
129        "-fno-strict-aliasing",
130    ]
131
132    defines = ["SAMPLINGINTERVAL=50000000"]
133
134    if (is_standard_system) {
135        external_deps = [
136            "drivers_interface_sensor:libsensor_proxy_3.0",
137            "hdf_core:libhdf_host",
138            "hdf_core:libhdf_utils",
139            "hilog:libhilog",
140            "hitrace:hitrace_meter",
141            "ipc:ipc_single",
142        ]
143        if (c_utils_enable) {
144            external_deps += [ "c_utils:utils" ]
145        }
146    } else {
147        external_deps = [ "hilog:libhilog" ]
148    }
149    external_deps += [ "ipc:ipc_single" ]
150}
151
152ohos_unittest("SensorSetBatchTest4") {
153    module_out_path = module_output_path
154
155    include_dirs = [
156        "../../../interfaces/include",
157        "../../../interfaces/v1_0",
158        "../../../utils/include",
159    ]
160
161    sources = [ "sensor_setbatch_test.cpp" ]
162
163    cflags = [
164        "-Wall",
165        "-Wextra",
166        "-Werror",
167        "-fsigned-char",
168        "-fno-common",
169        "-fno-strict-aliasing",
170    ]
171
172    defines = ["SAMPLINGINTERVAL=20000000"]
173
174    if (is_standard_system) {
175        external_deps = [
176            "drivers_interface_sensor:libsensor_proxy_3.0",
177            "hdf_core:libhdf_host",
178            "hdf_core:libhdf_utils",
179            "hilog:libhilog",
180            "hitrace:hitrace_meter",
181            "ipc:ipc_single",
182        ]
183        if (c_utils_enable) {
184            external_deps += [ "c_utils:utils" ]
185        }
186    } else {
187        external_deps = [ "hilog:libhilog" ]
188    }
189    external_deps += [ "ipc:ipc_single" ]
190}
191
192ohos_unittest("SensorSetBatchTest5") {
193    module_out_path = module_output_path
194
195    include_dirs = [
196        "../../../interfaces/include",
197        "../../../interfaces/v1_0",
198        "../../../utils/include",
199    ]
200
201    sources = [ "sensor_setbatch_test.cpp" ]
202
203    cflags = [
204        "-Wall",
205        "-Wextra",
206        "-Werror",
207        "-fsigned-char",
208        "-fno-common",
209        "-fno-strict-aliasing",
210    ]
211
212    defines = ["SAMPLINGINTERVAL=10000000"]
213
214    if (is_standard_system) {
215        external_deps = [
216            "drivers_interface_sensor:libsensor_proxy_3.0",
217            "hdf_core:libhdf_host",
218            "hdf_core:libhdf_utils",
219            "hilog:libhilog",
220            "hitrace:hitrace_meter",
221            "ipc:ipc_single",
222        ]
223        if (c_utils_enable) {
224            external_deps += [ "c_utils:utils" ]
225        }
226    } else {
227        external_deps = [ "hilog:libhilog" ]
228    }
229    external_deps += [ "ipc:ipc_single" ]
230}