1209bc2fbSopenharmony_ci# Copyright (c) 2021 Huawei Device Co., Ltd. 2209bc2fbSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 3209bc2fbSopenharmony_ci# you may not use this file except in compliance with the License. 4209bc2fbSopenharmony_ci# You may obtain a copy of the License at 5209bc2fbSopenharmony_ci# 6209bc2fbSopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 7209bc2fbSopenharmony_ci# 8209bc2fbSopenharmony_ci# Unless required by applicable law or agreed to in writing, software 9209bc2fbSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 10209bc2fbSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11209bc2fbSopenharmony_ci# See the License for the specific language governing permissions and 12209bc2fbSopenharmony_ci# limitations under the License. 13209bc2fbSopenharmony_ci 14209bc2fbSopenharmony_ciimport("//build/test.gni") 15209bc2fbSopenharmony_ci 16209bc2fbSopenharmony_cimodule_output_path = "hiviewdfx/hicollie" 17209bc2fbSopenharmony_cihicollie_part_path = "//base/hiviewdfx/hicollie" 18209bc2fbSopenharmony_ci 19209bc2fbSopenharmony_ci############################################################################### 20209bc2fbSopenharmony_ciconfig("module_private_config") { 21209bc2fbSopenharmony_ci visibility = [ ":*" ] 22209bc2fbSopenharmony_ci include_dirs = [ 23209bc2fbSopenharmony_ci ".", 24209bc2fbSopenharmony_ci "${hicollie_part_path}/frameworks/native", 25209bc2fbSopenharmony_ci "${hicollie_part_path}/frameworks/native/test", 26209bc2fbSopenharmony_ci "${hicollie_part_path}/interfaces/native/innerkits/include/xcollie", 27209bc2fbSopenharmony_ci ] 28209bc2fbSopenharmony_ci if (is_ohos) { 29209bc2fbSopenharmony_ci cflags_cc = [ "-D__XCOLLIE_OHOS__" ] 30209bc2fbSopenharmony_ci } 31209bc2fbSopenharmony_ci} 32209bc2fbSopenharmony_ci 33209bc2fbSopenharmony_ci##############################unittest########################################## 34209bc2fbSopenharmony_ciohos_moduletest("XCollieTimeoutModuleTest") { 35209bc2fbSopenharmony_ci module_out_path = module_output_path 36209bc2fbSopenharmony_ci sources = [ 37209bc2fbSopenharmony_ci "${hicollie_part_path}/frameworks/native/watchdog_inner.cpp", 38209bc2fbSopenharmony_ci "${hicollie_part_path}/frameworks/native/watchdog_task.cpp", 39209bc2fbSopenharmony_ci "${hicollie_part_path}/frameworks/native/xcollie_utils.cpp", 40209bc2fbSopenharmony_ci "xcollie_timeout_test.cpp", 41209bc2fbSopenharmony_ci ] 42209bc2fbSopenharmony_ci 43209bc2fbSopenharmony_ci configs = [ ":module_private_config" ] 44209bc2fbSopenharmony_ci 45209bc2fbSopenharmony_ci deps = [ "//third_party/googletest:gtest_main" ] 46209bc2fbSopenharmony_ci 47209bc2fbSopenharmony_ci external_deps = [ 48209bc2fbSopenharmony_ci "c_utils:utils", 49209bc2fbSopenharmony_ci "hilog:libhilog", 50209bc2fbSopenharmony_ci ] 51209bc2fbSopenharmony_ci defines = [] 52209bc2fbSopenharmony_ci if (defined(global_parts_info.hiviewdfx_hisysevent)) { 53209bc2fbSopenharmony_ci external_deps += [ "hisysevent:libhisysevent" ] 54209bc2fbSopenharmony_ci defines += [ "HISYSEVENT_ENABLE" ] 55209bc2fbSopenharmony_ci } 56209bc2fbSopenharmony_ci} 57209bc2fbSopenharmony_ci 58209bc2fbSopenharmony_ci############################################################################### 59209bc2fbSopenharmony_cigroup("moduletest") { 60209bc2fbSopenharmony_ci testonly = true 61209bc2fbSopenharmony_ci deps = [ 62209bc2fbSopenharmony_ci # deps file 63209bc2fbSopenharmony_ci ":XCollieTimeoutModuleTest", 64209bc2fbSopenharmony_ci ] 65209bc2fbSopenharmony_ci} 66209bc2fbSopenharmony_ci############################################################################### 67