# Copyright (c) 2022 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. import("//build/ohos.gni") import("//build/test.gni") config("dslm_cmoker") { include_dirs = [ "cmocker" ] } group("dslm_test") { testonly = true deps = [] if (os_level == "standard") { deps += [ ":DslmUnitTest" ] } } if (os_level == "standard") { # test unittest ohos_unittest("DslmUnitTest") { sanitize = { integer_overflow = true ubsan = true boundary_sanitize = true cfi = true cfi_cross_dso = true blocklist = "../../cfi_blocklist.txt" } branch_protector_ret = "pac_ret" install_enable = true testonly = true part_name = "device_security_level" subsystem_name = "security" module_out_path = "${part_name}/${target_name}" defines = [ "UT_ENABLE=1" ] sources = [ "../../baselib/msglib/src/common/messenger.c", "../../baselib/msglib/src/standard/messenger_device_socket_manager.c", "../../baselib/msglib/src/standard/messenger_device_status_manager.cpp", "../../baselib/msglib/src/utils/messenger_utils.c", "../../baselib/utils/src/utils_work_queue.c", "../../oem_property/ohos/standard/dslm_ohos_credential.c", "../../services/dfx/dslm_bigdata.cpp", "../../services/dfx/dslm_hidumper.c", "../../services/dfx/dslm_hitrace.cpp", "../../services/msg/dslm_messenger_wrapper.c", "../../services/sa/common/dslm_rpc_process.c", "device_manager.cpp", "device_manager_mock.cpp", "dslm_baselib_utils_test.cpp", "dslm_memory_mock.cpp", "dslm_msg_interface_mock.cpp", "dslm_msg_lib_test.cpp", "dslm_oem_property_test.cpp", "dslm_request_callback_mock.cpp", "dslm_rpc_process_test.cpp", "dslm_test.cpp", ] include_dirs = [ ".", "../../baselib/msglib/include", "../../baselib/msglib/src/common", "../../baselib/msglib/src/standard", "../../baselib/msglib/src/utils", "../../common/include", "../../interfaces/inner_api/include", "../../interfaces/inner_api/src/standard", "../../oem_property/common", "../../oem_property/include", "../../oem_property/ohos/common", "../../oem_property/ohos/standard/impl", "../../services/include", "../../services/dslm", "../../services/sa/common", ] configs = [ "../../common:common_configs" ] configs += [ ":dslm_cmoker" ] deps = [ "../../baselib/utils:utils_static", "../../oem_property/ohos/standard:dslm_ohos_cred_obj", "../../services/common:service_common_obj", "../../services/dslm:service_dslm_test_obj", "//third_party/googletest:gmock", ] external_deps = [ "access_token:libnativetoken", "access_token:libtoken_setproc", "c_utils:utils", "device_security_level:dslm_sdk", "dsoftbus:softbus_client", "hilog:libhilog", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "huks:libhukssdk", ] } }