# Copyright (c) 2023 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("../../../displaymgr.gni") config("module_private_config") { visibility = [ ":*" ] include_dirs = [ "${brightnessmgr_root_path}/include", "${displaymgr_inner_api}/include/native/include", "${displaymgr_utils_path}/native/include", ] } set_defaults("ohos_unittest") { module_out_path = "${displaymgr_part_name}/brightness_manager/test" configs = [ "${brightnessmgr_root_path}:brightness_manager_config", "${displaymgr_utils_path}:coverage_flags", "${displaymgr_utils_path}:utils_config", ":module_private_config", ] deps = [ "${displaymgr_inner_api}:displaymgr", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:want", "ability_base:zuri", "ability_runtime:ability_manager", "c_utils:utils", "common_event_service:cesfwk_innerkits", "data_share:datashare_consumer", "ffrt:libffrt", "hicollie:libhicollie", "hilog:libhilog", "ipc:ipc_core", "power_manager:power_ffrt", "power_manager:power_setting", "power_manager:power_sysparam", "power_manager:powermgr_client", "safwk:system_ability_fwk", "samgr:samgr_proxy", "window_manager:libdm_lite", ] } ohos_unittest("brightness_manager_ext_test") { sources = [ "${brightnessmgr_root_path}/src/brightness_manager_ext.cpp", "./src/brightness_manager_ext_test.cpp", "./src/mock_brightness_manager_interface.cpp", ] include_dirs = [ "./include/" ] defines = [ "BRIGHTNESS_DT_ENABLE" ] } ohos_unittest("brightness_manager_test") { sources = [ "./src/brightness_manager_test.cpp" ] deps += [ "${brightnessmgr_root_path}:brightness_manager" ] } ohos_unittest("brightness_service_test") { sources = [ "./src/brightness_service_test.cpp" ] deps += [ "${brightnessmgr_root_path}:brightness_manager" ] } group("unittest") { testonly = true deps = [ ":brightness_manager_test" ] if (display_manager_feature_brightnessext != "") { deps += [ ":brightness_manager_ext_test" ] } else { deps += [ ":brightness_service_test" ] } }