1# Copyright (c) 2024 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos.gni")
15import("//build/test.gni")
16import("//foundation/ability/ability_runtime/ability_runtime.gni")
17import("//foundation/ability/ability_runtime/cj_environment/cj_environment.gni")
18
19ohos_unittest("cj_environment_other_test") {
20  module_out_path = "ability_runtime/cj_environment_other_test"
21  include_dirs = [
22    "${ability_runtime_test_path}/mock/common/include",
23    "${resource_management_path}/frameworks/resmgr/include",
24    "${ability_base_kits_path}/configuration/include",
25    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/app",
26    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context",
27    "${ability_runtime_path}/interfaces/kits/native/ability/native",
28    "${ability_runtime_path}/interfaces/inner_api/runtime/include",
29    "${ability_runtime_path}/cj_environment/frameworks/cj_environment",
30    "${ability_runtime_path}/cj_environment/frameworks/cj_environment/src",
31    "${ability_runtime_path}/cj_environment/interfaces",
32    "${ability_runtime_path}/cj_environment/interfaces/inner_api",
33    "${ability_runtime_path}/cj_environment/frameworks/cj_environment/include",
34    "${ability_runtime_native_path}/runtime",
35  ]
36
37  sources = [
38    "${ability_runtime_path}/cj_environment/frameworks/cj_environment/src/cj_environment.cpp",
39    "${ability_runtime_path}/cj_environment/frameworks/cj_environment/src/dynamic_loader_ohos.cpp",
40    "cj_environment_test.cpp",
41  ]
42  configs = [ "${c_utils_base_path}:utils_config" ]
43  cflags = []
44  if (target_cpu == "arm") {
45    cflags += [ "-DBINDER_IPC_32BIT" ]
46  }
47  deps = [
48    "${ability_runtime_innerkits_path}/ability_manager:ability_manager",
49    "${ability_runtime_innerkits_path}/app_manager:app_manager",
50    "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper",
51    "${ability_runtime_innerkits_path}/runtime:runtime",
52    "${ability_runtime_native_path}/ability/native:ability_thread",
53    "${ability_runtime_native_path}/ability/native:abilitykit_native",
54    "${ability_runtime_native_path}/ability/native:uiabilitykit_native",
55    "${ability_runtime_native_path}/appkit:app_context",
56    "${ability_runtime_native_path}/appkit:appkit_manager_helper",
57    "${ability_runtime_native_path}/appkit:appkit_native",
58    "${distributedschedule_path}/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy",
59    "//third_party/googletest:gmock_main",
60    "//third_party/googletest:gtest_main",
61  ]
62
63  external_deps = [
64    "ability_base:base",
65    "ability_base:configuration",
66    "ability_base:want",
67    "ability_runtime:runtime",
68    "bounds_checking_function:libsec_shared",
69    "bundle_framework:appexecfwk_base",
70    "bundle_framework:appexecfwk_base",
71    "bundle_framework:appexecfwk_core",
72    "bundle_framework:appexecfwk_core",
73    "c_utils:utils",
74    "common_event_service:cesfwk_innerkits",
75    "eventhandler:libeventhandler",
76    "ffrt:libffrt",
77    "hilog:libhilog",
78    "hitrace:hitrace_meter",
79    "init:libbegetutil",
80    "ipc:ipc_core",
81    "napi:ace_napi",
82    "resource_management:global_resmgr",
83  ]
84
85  if (ability_runtime_graphics) {
86    external_deps += [ "window_manager:libwm" ]
87  }
88
89  defines = [ "CONFIG_HILOG" ]
90}
91
92group("unittest") {
93  testonly = true
94  deps = [ ":cj_environment_other_test" ]
95}
96