1# Copyright (c) 2021~2022 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")
16
17module_output_path = "hiview/hiview/freezedetector"
18
19config("unittest_config") {
20  include_dirs = [
21    "./unittest/common/",
22    "$hiview_plugin/freeze_detector",
23  ]
24
25  cflags_cc = [
26    "-D__UNITTEST__",
27    "-D__HIVIEW_OHOS__",
28  ]
29}
30
31ohos_unittest("FreezeDetectorTest") {
32  module_out_path = module_output_path
33  configs = [ ":unittest_config" ]
34
35  sources = [ "unittest/common/freeze_detector_test.cpp" ]
36
37  deps = [
38    "$hiview_base:hiviewbase_static_lib_for_tdd",
39    "$hiview_core:hiview_core_for_test",
40    "$hiview_eventlogger:eventlogger",
41    "$hiview_plugin/freeze_detector:freeze_detector",
42  ]
43
44  external_deps = [
45    "ffrt:libffrt",
46    "googletest:gtest_main",
47    "hilog:libhilog",
48    "libxml2:libxml2",
49  ]
50
51  resource_config_file =
52      "$hiview_plugin/freeze_detector/test/resource/ohos_test.xml"
53}
54
55ohos_unittest("FreezeDetectorUnittest") {
56  module_out_path = module_output_path
57  configs = [ ":unittest_config" ]
58
59  include_dirs = [
60    "./unittest/common/",
61    "$hiview_plugin/freeze_detector",
62    "//base/hiviewdfx/hiview/base/include",
63    "//base/hiviewdfx/hiview/utility/smart_parser",
64    "//base/hiviewdfx/hiview/plugins/faultlogger/interfaces/cpp/innerkits/include",
65  ]
66
67  sources = [ "unittest/common/freeze_detector_unittest.cpp" ]
68
69  external_deps = [
70    "hilog:libhilog",
71    "hiview:libfaultlogger",
72    "libxml2:libxml2",
73    "power_manager:powermgr_client",
74  ]
75
76  deps = [
77    "$hiview_base:hiviewbase_static_lib_for_tdd",
78    "$hiview_plugin/freeze_detector:freeze_detector",
79    "$hiview_root/utility/smart_parser:smart_parser",
80  ]
81}
82