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

module_output_path = "form_runtime/formmanagerst"

ohos_systemtest("FmsPerformanceTest") {
  module_out_path = module_output_path
  include_dirs = [
    "${ability_runtime_path}/interfaces/innerkits/ability_manager/include",
    "../common/fms/common/include",
    "${distributedschedule_path}/safwk/services/safwk/include",
  ]

  sources = [
    "../common/fms/common/src/form_event.cpp",
    "../common/fms/common/src/system_test_form_util.cpp",
    "fms_performance_test.cpp",
  ]

  cflags = []
  if (target_cpu == "arm") {
    cflags += [ "-DBINDER_IPC_32BIT" ]
  }

  configs = [
    "${ability_runtime_path}/services/abilitymgr:abilityms_config",
    "${ability_runtime_path}/services/appmgr:appmgr_config",
  ]

  deps = [
    "${ability_runtime_path}/frameworks/kits/ability/native:abilitykit_native",
    "${ability_runtime_path}/interfaces/innerkits/ability_manager:ability_manager",
    "${ability_runtime_path}/services/abilitymgr:abilityms",
    "${bundlefwk_innerkits_path}/libeventhandler:libeventhandler",
    "//third_party/googletest:gtest_main",
  ]

  defines = [ "AMS_LOG_TAG = \"FmsPerformanceTest\"" ]

  external_deps = [
    "ability_base:base",
    "ability_base:want",
    "ability_runtime:app_manager",
    "bundle_framework:appexecfwk_base",
    "bundle_framework:appexecfwk_core",
    "common_event_service:cesfwk_core",
    "common_event_service:cesfwk_innerkits",
    "form_runtime:form_manager",
    "hiviewdfx_hilog_native:libhilog",
    "input:libmmi-client",
    "ipc:ipc_core",
    "safwk:system_ability_fwk",
    "samgr_standard:samgr_proxy",
  ]
}

group("systemtest") {
  testonly = true

  deps = [ ":FmsPerformanceTest" ]
}
