# 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")

module_output_path = "form_runtime/formmgrservice"

ohos_unittest("FmsFormMgrReleaseFormTest") {
  module_out_path = module_output_path

  sources = [
    "//foundation/aafwk/standard/frameworks/kits/fmskit/native/src/form_mgr.cpp",
    "//foundation/aafwk/standard/services/formmgr/test/mock/src/mock_bundle_manager.cpp",
    "//foundation/aafwk/standard/services/formmgr/test/mock/src/mock_form_host_client.cpp",
    "//foundation/aafwk/standard/services/formmgr/test/mock/src/mock_form_provider_client.cpp",
  ]
  sources += [ "fms_form_mgr_release_form_test.cpp" ]

  include_dirs = [
    "//third_party/zlib/contrib/minizip",
    "//third_party/zlib",
    "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include",
    "//foundation/aafwk/standard/frameworks/kits/fmskit/native/include",
    "//foundation/appexecfwk/standard/common/log/include/",
    "//foundation/aafwk/standard/services/formmgr/include",
    "//foundation/appexecfwk/standard/services/bundlemgr/include",
    "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy/include",
    "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base/include/",
    "//foundation/aafwk/standard/interfaces/innerkits/form_manager/include",
    "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy/include/",
    "//foundation/distributedschedule/samgr/adapter/interfaces/innerkits/include/",
    "//foundation/distributeddatamgr/distributeddatamgr/interfaces/innerkits/distributeddata/include",
  ]

  configs = [
    "${services_path}/formmgr/test:formmgr_test_config",
    "//foundation/aafwk/standard/services/abilitymgr:abilityms_config",
    "//foundation/appexecfwk/standard/services/bundlemgr/test:bundlemgr_test_config",
  ]
  cflags = []
  if (target_cpu == "arm") {
    cflags += [ "-DBINDER_IPC_32BIT" ]
  }
  deps = [
    "${aafwk_path}/frameworks/kits/fmskit:fmskit_native",
    "${appexecfwk_path}/common:libappexecfwk_common",
    "${appexecfwk_path}/interfaces/innerkits/appexecfwk_base:appexecfwk_base",
    "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core:appexecfwk_core",
    "${appexecfwk_path}/libs/libeventhandler:libeventhandler_target",
    "${services_path}/formmgr:fms_target",
    "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk:libpermissionsdk_standard",
    "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager",
    "//foundation/aafwk/standard/interfaces/innerkits/base:base",
    "//foundation/aafwk/standard/interfaces/innerkits/want:want",
    "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk",
    "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy",
    "//third_party/googletest:gmock_main",
    "//utils/native/base:utils",
  ]

  external_deps = [
    "appspawn:appspawn_socket_client",
    "form_runtime:form_manager",
    "hiviewdfx_hilog_native:libhilog",
    "ipc:ipc_core",
  ]
}

group("unittest") {
  testonly = true

  deps = [ ":FmsFormMgrReleaseFormTest" ]
}
