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 14if (defined(ohos_lite)) { 15 import("//build/lite/config/component/lite_component.gni") 16 import("//build/lite/config/test.gni") 17 import("//foundation/communication/dsoftbus/dsoftbus.gni") 18 19 if (ohos_build_type == "debug") { 20 unittest("DiscSdkTest") { 21 output_extension = "bin" 22 output_dir = "$root_out_dir/test/unittest/dsoftbus" 23 sources = [ "disc_sdk_test.cpp" ] 24 include_dirs = [ 25 "$dsoftbus_root_path/interfaces/kits/discovery", 26 "$dsoftbus_root_path/interfaces/kits/common", 27 "$dsoftbus_root_path/tests/sdk/common/include", 28 ] 29 deps = [ 30 "$dsoftbus_root_path/sdk:softbus_client", 31 "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test", 32 ] 33 } 34 } 35} else { 36 import("//build/test.gni") 37 import("//foundation/communication/dsoftbus/dsoftbus.gni") 38 module_output_path = "dsoftbus/discovery" 39 ohos_unittest("DiscSdkTest") { 40 module_out_path = module_output_path 41 sources = [ 42 "disc_sdk_only_l2_test.cpp", 43 "disc_sdk_test.cpp", 44 ] 45 include_dirs = [ 46 "$dsoftbus_root_path/core/common/inner_communication", 47 "$dsoftbus_root_path/core/common/include", 48 "$dsoftbus_root_path/interfaces/kits/discovery", 49 "$dsoftbus_root_path/interfaces/kits/common", 50 "$dsoftbus_root_path/sdk/discovery/include", 51 "//commonlibrary/c_utils/base/include", 52 "//third_party/bounds_checking_function/include", 53 "unittest/common/", 54 "$dsoftbus_root_path/sdk/discovery/manager/include", 55 "$dsoftbus_root_path/tests/sdk/common/include", 56 ] 57 deps = [ 58 "$dsoftbus_root_path/sdk:softbus_client", 59 "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test", 60 "//third_party/bounds_checking_function:libsec_static", 61 "//third_party/googletest:gtest_main", 62 ] 63 if (is_standard_system) { 64 external_deps = [ 65 "c_utils:utils", 66 "hiviewdfx_hilog_native:libhilog", 67 ] 68 } else { 69 external_deps = [ 70 "c_utils:utils", 71 "hilog:libhilog", 72 ] 73 } 74 } 75 group("unittest") { 76 testonly = true 77 deps = [ ":DiscSdkTest" ] 78 } 79} 80