# Copyright (c) 2022 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") module_output_path = "device_usage_statistics/deviceusagestatisticstest" config("module_private_config") { visibility = [ ":*" ] include_dirs = [ "//foundation/resourceschedule/device_usage_statistics/interfaces/innerkits/include", "//foundation/resourceschedule/device_usage_statistics/services/common/include", "//foundation/resourceschedule/device_usage_statistics/services/packageusage/include", "//foundation/resourceschedule/device_usage_statistics/services/packagegroup/include", "//third_party/jsoncpp/include", ] } ohos_unittest("DeviceUsageStatsTest") { module_out_path = module_output_path sources = [ "device_usage_statistics_test.cpp" ] configs = [ ":module_private_config" ] deps = [ "//foundation/resourceschedule/device_usage_statistics:usagestatservice", "//foundation/resourceschedule/device_usage_statistics:usagestatsinner", ] external_deps = [ "c_utils:utils", "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "power_manager:powermgr_client", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] } ohos_unittest("DeviceUsageStatsServiceTest") { module_out_path = module_output_path sources = [ "device_usage_statistics_service_test.cpp" ] configs = [ ":module_private_config", "//foundation/ability/ability_runtime/interfaces/inner_api/wantagent:wantagent_innerkits_public_config", ] deps = [ "//foundation/resourceschedule/device_usage_statistics:usagestatservice", "//foundation/resourceschedule/device_usage_statistics:usagestatsinner", ] external_deps = [ "ability_runtime:app_manager", "access_token:libaccesstoken_sdk", "c_utils:utils", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "power_manager:powermgr_client", "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", ] } ohos_unittest("DeviceUsageStatsMockTest") { module_out_path = module_output_path sources = [ "device_usage_statistics_mock_test.cpp", "mock/bundle_active_account_helper_mock.cpp", "mock/bundle_active_client_mock.cpp", "mock/bundle_active_core_mock.cpp", "mock/bundle_active_service_mock.cpp", "mock/bundle_active_usage_database_mock.cpp", ] configs = [ ":module_private_config", "//foundation/ability/ability_runtime/interfaces/inner_api/wantagent:wantagent_innerkits_public_config", ] deps = [ "//foundation/resourceschedule/device_usage_statistics:usagestatservice", "//foundation/resourceschedule/device_usage_statistics:usagestatsinner", "//third_party/jsoncpp:jsoncpp", ] external_deps = [ "ability_runtime:app_manager", "access_token:libaccesstoken_sdk", "c_utils:utils", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "power_manager:powermgr_client", "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", ] } ohos_unittest("DeviceUsagePackageUsageTest") { module_out_path = module_output_path sources = [ "package_usage_test.cpp" ] configs = [ ":module_private_config", "//foundation/ability/ability_runtime/interfaces/inner_api/wantagent:wantagent_innerkits_public_config", ] deps = [ "//foundation/resourceschedule/device_usage_statistics:usagestatservice", "//foundation/resourceschedule/device_usage_statistics:usagestatsinner", "//third_party/jsoncpp:jsoncpp", ] external_deps = [ "ability_runtime:app_manager", "access_token:libaccesstoken_sdk", "bundle_framework:appexecfwk_base", "c_utils:utils", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "power_manager:powermgr_client", "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", ] } group("unittest") { testonly = true deps = [ ":DeviceUsagePackageUsageTest", ":DeviceUsageStatsMockTest", ":DeviceUsageStatsServiceTest", ":DeviceUsageStatsTest", ] }