# 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/config/features.gni") import("//build/test.gni") import("//foundation/resourceschedule/work_scheduler/workscheduler.gni") module_output_path = "work_scheduler/unittest" config("worksched_private_config") { include_dirs = [ "${worksched_service_path}/zidl/include", "${worksched_service_path}/native/include", ] } ohos_unittest("WorkScheduleServiceTest") { cflags_cc = [ "-Dprivate=public", "-Dprotected=public", ] module_out_path = module_output_path configs = [ ":worksched_private_config" ] cflags = [ "-g", "-O0", "-Wno-unused-variable", "-fno-omit-frame-pointer", ] sources = [ "src/event_publisher_test.cpp", "src/watchdog_test.cpp", "src/workschedulerservice_test.cpp", ] deps = [ "${worksched_frameworks_path}:workschedclient", "${worksched_frameworks_path}/extension:workschedextension", "${worksched_service_path}:workschedservice_static", "${worksched_utils_path}:workschedutils", "//third_party/jsoncpp", ] external_deps = [ "ability_base:want", "ability_runtime:ability_manager", "ability_runtime:app_manager", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "hilog:libhilog", "hisysevent:libhisysevent", "ipc:ipc_single", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] defines = [] if (powermgr_battery_manager_enable) { external_deps += [ "battery_manager:batterysrv_client" ] defines += [ "POWERMGR_BATTERY_MANAGER_ENABLE" ] } if (powermgr_thermal_manager_enable) { external_deps += [ "thermal_manager:thermalsrv_client" ] defines += [ "POWERMGR_THERMAL_MANAGER_ENABLE" ] } subsystem_name = "resourceschedule" part_name = "${worksched_native_part_name}" } group("unittest") { testonly = true deps = [] deps += [ # deps file ":WorkScheduleServiceTest", ] }