# 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 = [ "../../interfaces/innerkits/include", "../../services/common/include", "../../services/packageusage/include", "../../services/packagegroup/include", "../../utils/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 = [ "../../:usagestatservice_static", "../../:usagestatsinner", "../../:usagestatsutils", "//third_party/jsoncpp:jsoncpp", ] external_deps = [ "c_utils:utils", "eventhandler:libeventhandler", "hilog:libhilog", "ipc:ipc_single", "power_manager:powermgr_client", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] } ohos_unittest("DeviceUsageStatsMultiTest") { module_out_path = module_output_path sources = [ "device_usage_statistics_multi_test.cpp" ] configs = [ ":module_private_config" ] deps = [ "../../:usagestatservice_static", "../../:usagestatsinner", "../../:usagestatsutils", "//third_party/jsoncpp:jsoncpp", ] external_deps = [ "c_utils:utils", "eventhandler:libeventhandler", "hilog:libhilog", "ipc:ipc_single", "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" ] deps = [ "../../:usagestatservice_static", "../../:usagestatsinner", "../../:usagestatsutils", "//third_party/jsoncpp:jsoncpp", ] external_deps = [ "ability_runtime:app_manager", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "c_utils:utils", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "hilog:libhilog", "ipc:ipc_single", "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_usage_database_mock.cpp", "mock/mock_service_registry.cpp", ] include_dirs = [ "mock/include" ] configs = [ ":module_private_config" ] deps = [ "../../:usagestatservice_static", "../../:usagestatsinner", "../../:usagestatsutils", "//third_party/jsoncpp:jsoncpp", ] external_deps = [ "ability_runtime:app_manager", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "c_utils:utils", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "hilog:libhilog", "ipc:ipc_single", "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" ] deps = [ "../../:usagestatservice_static", "../../:usagestatsinner", "../../:usagestatsutils", "//third_party/jsoncpp:jsoncpp", ] external_deps = [ "ability_runtime:app_manager", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "bundle_framework:appexecfwk_base", "c_utils:utils", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "hilog:libhilog", "ipc:ipc_single", "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", ":DeviceUsageStatsMultiTest", ":DeviceUsageStatsServiceTest", ":DeviceUsageStatsTest", ] }