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("SensorTestMultiClients") { 21 deps = [] 22 testonly = true 23 deps += [ 24 ":SensorSetBatchTest", 25 ":SensorSetSdcSensorTest", 26 ] 27} 28 29ohos_unittest("SensorSetBatchTest") { 30 module_out_path = module_output_path 31 32 include_dirs = [ 33 "../../../interfaces/include", 34 "../../../interfaces/v1_0", 35 "../../../utils/include", 36 ] 37 38 sources = [ "sensor_setbatch_test.cpp" ] 39 40 cflags = [ 41 "-Wall", 42 "-Wextra", 43 "-Werror", 44 "-fsigned-char", 45 "-fno-common", 46 "-fno-strict-aliasing", 47 ] 48 49 if (is_standard_system) { 50 external_deps = [ 51 "drivers_interface_sensor:libsensor_proxy_3.0", 52 "hdf_core:libhdf_host", 53 "hdf_core:libhdf_utils", 54 "hilog:libhilog", 55 "hitrace:hitrace_meter", 56 "ipc:ipc_single", 57 ] 58 if (c_utils_enable) { 59 external_deps += [ "c_utils:utils" ] 60 } 61 } else { 62 external_deps = [ "hilog:libhilog" ] 63 } 64 external_deps += [ "ipc:ipc_single" ] 65} 66 67 68ohos_unittest("SensorSetSdcSensorTest") { 69 module_out_path = module_output_path 70 71 include_dirs = [ 72 "../../../interfaces/include", 73 "../../../interfaces/v1_0", 74 "../../../utils/include", 75 ] 76 77 sources = [ "sensor_setsdcsensor_test.cpp" ] 78 79 cflags = [ 80 "-Wall", 81 "-Wextra", 82 "-Werror", 83 "-fsigned-char", 84 "-fno-common", 85 "-fno-strict-aliasing", 86 ] 87 88 if (is_standard_system) { 89 external_deps = [ 90 "drivers_interface_sensor:libsensor_proxy_3.0", 91 "hdf_core:libhdf_host", 92 "hdf_core:libhdf_utils", 93 "hilog:libhilog", 94 "hitrace:hitrace_meter", 95 "ipc:ipc_single", 96 ] 97 if (c_utils_enable) { 98 external_deps += [ "c_utils:utils" ] 99 } 100 } else { 101 external_deps = [ "hilog:libhilog" ] 102 } 103 external_deps += [ "ipc:ipc_single" ] 104}