# Copyright (c) 2023-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/test.gni") import("../../../device_status.gni") module_output_path = "${device_status_part_name}/devicestatussrv" config("devicestatus_private_config") { visibility = [ ":*" ] include_dirs = [ "include", "../../../services/native/include", "../../../libs/include", "../../../libs/include/algorithm", "../../../libs/include/datahub", "../../../libs/interface", "${device_status_interfaces_path}/innerkits/include", ] } ohos_unittest("device_status_algorithm_test") { module_out_path = module_output_path sources = [ "src/device_status_algorithm_test.cpp" ] configs = [ "${device_status_utils_path}:devicestatus_utils_config", ":devicestatus_private_config", ] deps = [ "${device_status_interfaces_path}/innerkits:devicestatus_client", "${device_status_root_path}/services:devicestatus_static_service", "../../../libs:devicestatus_algo", ] external_deps = [ "ability_base:base", "access_token:libaccesstoken_sdk", "cJSON:cjson_static", "c_utils:utils", "googletest:gtest_main", "graphic_2d:librender_service_client", "hilog:libhilog", "image_framework:image_native", "input:libmmi-client", "ipc:ipc_single", "safwk:system_ability_fwk", "samgr:samgr_proxy", "window_manager:libdm", ] defines = [] if (device_status_sensor_enable) { external_deps += [ "sensor:sensor_interface_native" ] defines += [ "DEVICE_STATUS_SENSOR_ENABLE" ] } } ohos_unittest("device_status_datahub_test") { module_out_path = module_output_path sources = [ "src/device_status_datahub_test.cpp" ] configs = [ "${device_status_utils_path}:devicestatus_utils_config", ":devicestatus_private_config", ] deps = [ "${device_status_interfaces_path}/innerkits:devicestatus_client", "${device_status_root_path}/services:devicestatus_static_service", "../../../libs:devicestatus_algo", "../../../libs:devicestatus_mock", ] external_deps = [ "ability_base:base", "access_token:libaccesstoken_sdk", "cJSON:cjson_static", "c_utils:utils", "googletest:gtest_main", "hilog:libhilog", "image_framework:image_native", "input:libmmi-client", "ipc:ipc_single", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] defines = [] if (device_status_sensor_enable) { external_deps += [ "sensor:sensor_interface_native" ] defines += [ "DEVICE_STATUS_SENSOR_ENABLE" ] } } ohos_unittest("device_status_mock_test") { module_out_path = module_output_path sources = [ "src/device_status_mock_test.cpp" ] configs = [ "${device_status_utils_path}:devicestatus_utils_config", ":devicestatus_private_config", ] cflags = [ "-Dprivate=public" ] deps = [ "${device_status_interfaces_path}/innerkits:devicestatus_client", "${device_status_root_path}/services:devicestatus_static_service", "../../../libs:devicestatus_algo", "../../../libs:devicestatus_mock", ] external_deps = [ "ability_base:base", "access_token:libaccesstoken_sdk", "cJSON:cjson_static", "c_utils:utils", "googletest:gtest_main", "hilog:libhilog", "image_framework:image_native", "input:libmmi-client", "ipc:ipc_single", "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] defines = [] if (device_status_sensor_enable) { external_deps += [ "sensor:sensor_interface_native" ] defines += [ "DEVICE_STATUS_SENSOR_ENABLE" ] } } group("unittest") { testonly = true deps = [] deps += [ ":device_status_algorithm_test", ":device_status_datahub_test", ":device_status_mock_test", ] }