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", 40 "$hiview_eventlogger:eventlogger", 41 "$hiview_plugin/freeze_detector:freeze_detector", 42 "//third_party/googletest:gtest_main", 43 "//third_party/libxml2:xml2", 44 ] 45 46 external_deps = [ "hilog:libhilog" ] 47 48 resource_config_file = 49 "$hiview_plugin/freeze_detector/test/resource/ohos_test.xml" 50} 51 52ohos_unittest("FreezeDetectorUnittest") { 53 module_out_path = module_output_path 54 configs = [ ":unittest_config" ] 55 56 include_dirs = [ 57 "./unittest/common/", 58 "$hiview_plugin/freeze_detector", 59 "//third_party/libxml2/include", 60 "//base/hiviewdfx/hiview/base/include", 61 "//base/hiviewdfx/hiview/utility/smart_parser", 62 "//base/hiviewdfx/hiview/plugins/faultlogger/interfaces/cpp/innerkits/include", 63 ] 64 65 sources = [ "unittest/common/freeze_detector_unittest.cpp" ] 66 67 external_deps = [ 68 "display_manager:displaymgr", 69 "hilog:libhilog", 70 "hiview:libfaultlogger", 71 "power_manager:powermgr_client", 72 ] 73 74 deps = [ 75 "$hiview_base:hiviewbase_static_lib_for_tdd", 76 "$hiview_plugin/freeze_detector:freeze_detector", 77 "$hiview_root/utility/smart_parser:smart_parser", 78 "//third_party/googletest:gtest_main", 79 "//third_party/libxml2:xml2", 80 ] 81} 82