# Copyright (c) 2021 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("//foundation/aafwk/standard/aafwk.gni")
import("//foundation/aafwk/standard/services/abilitymgr/abilitymgr.gni")

module_output_path = "ability_runtime/mstabilitymgrservice"

ohos_moduletest("PandingWantMgrTest") {
  module_out_path = module_output_path

  include_dirs = [
    "//foundation/aafwk/standard/frameworks/kits/appkit/native/ability_runtime",
    "//foundation/aafwk/standard/services/test/mock/include",
    "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core/include/appmg",
    "//foundation/aafwk/standard/frameworks/kits/appkit/native/app/include",
    "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy/include",
    "//foundation/distributedschedule/samgr/adapter/interfaces/innerkits/include/",
    "//third_party/jsoncpp/include",
    "//base/hiviewdfx/hicollie/interfaces/native/innerkits/include/xcollie",
  ]

  sources = abilityms_files
  sources += [
    "//foundation/aafwk/standard/services/abilitymgr/src/ability_manager_client.cpp",
    "//foundation/aafwk/standard/services/abilitymgr/test/mock/libs/sa_mgr/src/sa_mgr_client_mock.cpp",
    "//foundation/aafwk/standard/services/test/mock/src/mock_app_mgr_client.cpp",
    "//foundation/aafwk/standard/services/test/mock/src/mock_bundle_mgr.cpp",
    "//foundation/appexecfwk/standard/common/log/src/app_log_wrapper.cpp",
    "panding_want_manager_test.cpp",
  ]

  configs = [ "${services_path}/abilitymgr:abilityms_config" ]
  cflags = []
  if (target_cpu == "arm") {
    cflags += [ "-DBINDER_IPC_32BIT" ]
  }

  deps = [
    "${innerkits_path}/base:base",
    "${innerkits_path}/want:want",
    "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits",
    "//base/global/i18n_standard/frameworks/intl:intl_util",
    "//base/hiviewdfx/hiview/adapter/utility:hiview_adapter_utility",
    "//base/notification/ans_standard/frameworks/wantagent:wantagent_innerkits",
    "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native",
    "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes",
    "//foundation/aafwk/standard/frameworks/kits/appkit:app_context",
    "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager",
    "//foundation/ace/ace_engine/interfaces/innerkits/ui_service_manager:ui_service_mgr",
    "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base:appexecfwk_base",
    "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core:appexecfwk_core",
    "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler:libeventhandler",
    "//foundation/distributedschedule/dmsfwk/interfaces/innerkits/uri:zuri",
    "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk",
    "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy",
    "//foundation/graphic/standard:libwmservice",
    "//third_party/googletest:gmock_main",
    "//third_party/googletest:gtest_main",
    "//third_party/jsoncpp:jsoncpp",
    "//third_party/libpng:libpng",
    "//utils/native/base:utils",
  ]

  external_deps = [
    "bytrace_standard:bytrace_core",
    "ces_standard:cesfwk_core",
    "ces_standard:cesfwk_innerkits",
    "device_manager_base:devicemanagersdk",
    "dsoftbus_standard:softbus_client",
    "hicollie_native:libhicollie",
    "hiviewdfx_hilog_native:libhilog",
    "ipc:ipc_core",
    "multimedia_image_standard:image_native",
    "native_appdatamgr:native_appdatafwk",
    "native_appdatamgr:native_dataability",
    "native_appdatamgr:native_rdb",
  ]
}

group("moduletest") {
  testonly = true

  deps = [ ":PandingWantMgrTest" ]
}
