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

module_output_path = "bluetooth/server_test"

###############################################################################
#1. intent(c++) get/set test without transport

config("module_private_config") {
  visibility = [ ":*" ]
  cflags = []
  if (target_cpu == "arm") {
    cflags += [ "-DBINDER_IPC_32BIT" ]
  }
  include_dirs = [
    "mock/include",
    "//third_party/json/include",
    "//third_party/bounds_checking_function/include",
    "//utils/system/safwk/native/include",
    "//foundation/communication/bluetooth_service/services/bluetooth/service/src/common",
    "//foundation/communication/bluetooth_service/services/bluetooth/service/src/",
    "//foundation/communication/bluetooth_service/services/bluetooth/service/src/base",
  ]
  defines = [
    "BTFW_LOG_TAG = \"bluetooth_test\"",
    "BTFW_LOG_DOMAIN = 0xD000103",
  ]
}

ohos_moduletest("btsvr_module_test") {
  module_out_path = module_output_path
  sources = [ "moduletest/hosttest/host_srv_module_test.cpp" ]

  configs = [ ":module_private_config" ]

  deps = [
    "//foundation/communication/bluetooth_service/services/bluetooth/server:bluetooth_server",
    "//foundation/communication/bluetooth_service/services/bluetooth/service:btservice",
    "//third_party/bounds_checking_function:libsec_shared",
    "//third_party/googletest:gmock_main",
    "//third_party/googletest:gtest_main",
  ]

  external_deps = [
    "c_utils:utils",
    "hilog:libhilog",
    "ipc:ipc_core",
    "resource_management:global_resmgr",
  ]
}

################################################################################
group("moduletest") {
  testonly = true

  deps = []

  if (is_phone_product) {
    deps += [ ":btsvr_module_test" ]
  }
}