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("AdapterTest") { 21 output_extension = "bin" 22 output_dir = "$root_out_dir/test/unittest/dsoftbus" 23 sources = [ 24 "softbus_socket_test.cpp", 25 "softbus_thread_test.cpp", 26 ] 27 include_dirs = [ 28 "$dsoftbus_root_path/adapter/common/include", 29 "$dsoftbus_root_path/core/common/include/", 30 ] 31 deps = [ 32 "//foundation/communication/dsoftbus/adapter:softbus_adapter", 33 "//third_party/bounds_checking_function:libsec_static", 34 ] 35 } 36 } 37} else { 38 import("//build/test.gni") 39 import("//foundation/communication/dsoftbus/dsoftbus.gni") 40 module_output_path = "dsoftbus_standard/adapter" 41 ohos_unittest("AdapterTest") { 42 module_out_path = module_output_path 43 sources = [ 44 "softbus_socket_test.cpp", 45 "softbus_thread_test.cpp", 46 ] 47 include_dirs = [ 48 "$dsoftbus_root_path/adapter/common/include", 49 "$dsoftbus_root_path/core/common/include/", 50 ] 51 deps = [ 52 "//foundation/communication/dsoftbus/adapter:softbus_adapter", 53 "//third_party/bounds_checking_function:libsec_static", 54 "//third_party/googletest:gtest_main", 55 "//utils/native/base:utils", 56 ] 57 if (is_standard_system) { 58 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 59 } else { 60 external_deps = [ "hilog:libhilog" ] 61 } 62 } 63 group("unittest") { 64 testonly = true 65 deps = [ ":AdapterTest" ] 66 } 67} 68