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("//base/hiviewdfx/hiview/hiview.gni")
15import("//build/test.gni")
16module_output_path = "hiview/hiview/interface"
17
18group("unittest") {
19  testonly = true
20  deps = [
21    ":InterfaceJsNapiTest",
22    ":LoglibraryAgentTest",
23  ]
24}
25
26config("unittest_config") {
27  include_dirs = [
28    "$hiview_adapter/service/test/unittest/common",
29    "$hiview_base/include",
30    "$hiview_interfaces/inner_api/unified_collection",
31    "$hiview_interfaces/js/napi/include",
32    "unittest/common",
33  ]
34
35  cflags_cc = [
36    "-D__UNITTEST__",
37    "-D__HIVIEW_OHOS__",
38  ]
39}
40
41ohos_unittest("InterfaceJsNapiTest") {
42  module_out_path = module_output_path
43  configs = [ ":unittest_config" ]
44
45  sources = [ "unittest/common/interface_js_napi_test.cpp" ]
46
47  deps = [ "$hiview_base/utility:hiview_utility" ]
48
49  external_deps = [
50    "access_token:libtokenid_sdk",
51    "googletest:gtest_main",
52    "hilog:libhilog",
53    "napi:ace_napi",
54  ]
55}
56
57ohos_unittest("LoglibraryAgentTest") {
58  module_out_path = module_output_path
59  configs = [ ":unittest_config" ]
60
61  sources = [
62    "$hiview_adapter/service/test/unittest/common/adapter_loglibrary_test_tools.cpp",
63    "$hiview_interfaces/js/napi/src/hiview_service_agent.cpp",
64    "unittest/common/loglibrary_agent_test.cpp",
65  ]
66
67  cflags_cc = [ "-DTEST_LOCAL_SRC" ]
68
69  deps = [
70    "$hiview_adapter/service/client:hiview_service_impl_for_js",
71    "$hiview_base:hiview_base",
72  ]
73
74  external_deps = [
75    "ability_runtime:app_context",
76    "access_token:libaccesstoken_sdk",
77    "access_token:libnativetoken",
78    "access_token:libtoken_setproc",
79    "bundle_framework:appexecfwk_core",
80    "googletest:gtest_main",
81    "hilog:libhilog",
82    "ipc:ipc_single",
83    "safwk:system_ability_fwk",
84    "samgr:samgr_proxy",
85    "storage_service:storage_manager_acl",
86  ]
87}
88