• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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/test.gni")
15
16module_output_path = "hiviewdfx/hicollie"
17hicollie_part_path = "//base/hiviewdfx/hicollie"
18
19###############################################################################
20config("module_private_config") {
21  visibility = [ ":*" ]
22  include_dirs = [
23    ".",
24    "${hicollie_part_path}/frameworks/native",
25    "${hicollie_part_path}/frameworks/native/test",
26    "${hicollie_part_path}/interfaces/native/innerkits/include/xcollie",
27    "//commonlibrary/c_utils/base/include",
28  ]
29  if (is_ohos) {
30    cflags_cc = [ "-D__XCOLLIE_OHOS__" ]
31  }
32}
33
34##############################unittest##########################################
35ohos_moduletest("XCollieModuleTest") {
36  module_out_path = module_output_path
37  sources = [
38    "${hicollie_part_path}/frameworks/native/test/xcollie_checker_test.cpp",
39    "${hicollie_part_path}/frameworks/native/timer_ring.cpp",
40    "${hicollie_part_path}/frameworks/native/xcollie.cpp",
41    "${hicollie_part_path}/frameworks/native/xcollie_inner.cpp",
42    "xcollie_watchdog_test.cpp",
43  ]
44
45  configs = [ ":module_private_config" ]
46
47  deps = [ "//third_party/googletest:gtest_main" ]
48
49  external_deps = [
50    "c_utils:utils",
51    "hilog_native:libhilog",
52    "hisysevent_native:libhisysevent",
53  ]
54}
55
56ohos_moduletest("XCollieTimeoutModuleTest") {
57  module_out_path = module_output_path
58  sources = [
59    "${hicollie_part_path}/frameworks/native/timer_ring.cpp",
60    "${hicollie_part_path}/frameworks/native/xcollie.cpp",
61    "${hicollie_part_path}/frameworks/native/xcollie_inner.cpp",
62    "xcollie_timeout_test.cpp",
63  ]
64
65  configs = [ ":module_private_config" ]
66
67  deps = [ "//third_party/googletest:gtest_main" ]
68
69  external_deps = [
70    "c_utils:utils",
71    "hilog_native:libhilog",
72    "hisysevent_native:libhisysevent",
73  ]
74}
75
76###############################################################################
77group("moduletest") {
78  testonly = true
79  deps = [
80    # deps file
81    ":XCollieModuleTest",
82    ":XCollieTimeoutModuleTest",
83  ]
84}
85###############################################################################
86