• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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")
17
18ohos_unittest("cj_test_runner_test") {
19  module_out_path = "ability_runtime/ability_runtime/cj_test_runner_test"
20  include_dirs = [
21    "native",
22    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/app",
23    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context",
24    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/ability_delegator/include",
25    "${ability_runtime_services_path}/common/include",
26    "${ability_runtime_path}/interfaces/kits/native/ability/native",
27    "${ability_runtime_path}/interfaces/kits/native/appkit/app",
28    "${ability_runtime_path}/interfaces/kits/native/appkit/dfr",
29    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_delegator",
30    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper",
31    "${ability_runtime_path}/frameworks/native/appkit/ability_delegator",
32    "${ability_runtime_path}/cj_environment/interfaces/inner_api",
33  ]
34
35  sources = [
36    "${ability_runtime_native_path}/appkit/ability_delegator/ability_delegator.cpp",
37    "${ability_runtime_native_path}/appkit/ability_delegator/ability_delegator_args.cpp",
38    "${ability_runtime_native_path}/appkit/ability_delegator/ability_delegator_registry.cpp",
39    "${ability_runtime_native_path}/appkit/ability_delegator/delegator_thread.cpp",
40    "${ability_runtime_native_path}/appkit/ability_delegator/iability_monitor.cpp",
41    "${ability_runtime_native_path}/appkit/ability_delegator/iability_stage_monitor.cpp",
42    "${ability_runtime_native_path}/appkit/ability_delegator/runner_runtime/cj_test_runner_object.cpp",
43    "${ability_runtime_native_path}/appkit/ability_delegator/runner_runtime/js_test_runner.cpp",
44    "${ability_runtime_native_path}/appkit/ability_delegator/shell_cmd_result.cpp",
45    "${ability_runtime_native_path}/appkit/ability_delegator/test_runner.cpp",
46    "${ability_runtime_path}/frameworks/native/appkit/ability_delegator/runner_runtime/cj_test_runner.cpp",
47    "${ability_runtime_path}/tools/aa/src/shell_command_result.cpp",
48    "${ability_runtime_path}/tools/aa/src/test_observer_proxy.cpp",
49    "cj_test_runner_test.cpp",
50  ]
51
52  if (cj_frontend) {
53    defines = [ "CJ_FRONTEND" ]
54  }
55  cflags = []
56  if (target_cpu == "arm") {
57    cflags += [ "-DBINDER_IPC_32BIT" ]
58  }
59  deps = [
60    "${ability_runtime_innerkits_path}/ability_manager:ability_manager",
61    "${ability_runtime_innerkits_path}/app_manager:app_manager",
62    "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper",
63    "${ability_runtime_innerkits_path}/runtime:runtime",
64    "${ability_runtime_native_path}/ability/native:ability_thread",
65    "${ability_runtime_native_path}/ability/native:abilitykit_native",
66    "${ability_runtime_native_path}/ability/native:uiabilitykit_native",
67    "${ability_runtime_native_path}/appkit:app_context",
68    "${ability_runtime_native_path}/appkit:appkit_manager_helper",
69    "${ability_runtime_native_path}/appkit:appkit_native",
70    "${ability_runtime_native_path}/appkit:delegator_mgmt",
71    "${ability_runtime_path}/frameworks/cj/ffi:cj_ability_ffi",
72  ]
73
74  external_deps = [
75    "ability_base:base",
76    "ability_base:configuration",
77    "ability_base:extractortool",
78    "ability_base:want",
79    "ability_runtime:runtime",
80    "bundle_framework:appexecfwk_base",
81    "bundle_framework:appexecfwk_base",
82    "bundle_framework:appexecfwk_core",
83    "bundle_framework:appexecfwk_core",
84    "c_utils:utils",
85    "common_event_service:cesfwk_innerkits",
86    "ets_runtime:libark_jsruntime",
87    "eventhandler:libeventhandler",
88    "ffrt:libffrt",
89    "googletest:gmock_main",
90    "googletest:gtest_main",
91    "hilog:libhilog",
92    "hitrace:hitrace_meter",
93    "init:libbegetutil",
94    "ipc:ipc_core",
95    "json:nlohmann_json_static",
96    "napi:ace_napi",
97    "napi:cj_bind_native",
98    "resource_management:global_resmgr",
99    "samgr:samgr_proxy",
100  ]
101
102  if (ability_runtime_graphics) {
103    external_deps += [ "window_manager:libwm" ]
104  }
105}
106
107group("unittest") {
108  testonly = true
109  deps = [ ":cj_test_runner_test" ]
110}
111