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