# Copyright (c) 2021-2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. if (defined(ohos_lite)) { import("//build/lite/config/component/lite_component.gni") import("//build/lite/config/test.gni") import("../../../../dsoftbus.gni") if (ohos_build_type == "debug") { unittest("SoftbusUtilsTest") { output_extension = "bin" output_dir = "$root_out_dir/tests/unittest/dsoftbus" sources = [ "unittest/softbus_utils_test.cpp" ] include_dirs = [ "$dsoftbus_root_path/core/common/include" ] ldflags = [ "-lstdc++", "-Wl,-rpath-link=$ohos_root_path/$root_out_dir", ] deps = [ "$dsoftbus_root_path/core/common:softbus_utils" ] external_deps = [ "hilog:libhilog" ] } } } else { import("//build/test.gni") import("../../../../dsoftbus.gni") module_output_path = "dsoftbus/common" ohos_unittest("SoftbusUtilsTest") { module_out_path = module_output_path sources = [ "unittest/softbus_utils_test.cpp" ] include_dirs = [ "$dsoftbus_root_path/core/common/include" ] deps = [ "$dsoftbus_root_path/core/common:softbus_utils" ] external_deps = [ "hilog:libhilog" ] } ohos_unittest("Sqlite3UtilsTest") { module_out_path = module_output_path sources = [ "unittest/sqlite3_utils_test.cpp" ] include_dirs = [ "$dsoftbus_root_path/adapter/common/include", "$dsoftbus_root_path/core/common/include", "$dsoftbus_root_path/interfaces/kits/bus_center", "$dsoftbus_root_path/interfaces/kits/common", ] deps = [ "$dsoftbus_root_path/adapter:softbus_adapter", "$dsoftbus_root_path/core/common:softbus_utils", ] external_deps = [ "googletest:gtest_main", "hilog:libhilog", "sqlite:sqlite", ] } group("unittest") { testonly = true deps = [ ":SoftbusUtilsTest", ":Sqlite3UtilsTest", "permission_state_test:PermissionStateTest", ] } }