# Copyright (C) 2024 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/test.gni") SOURCE_DIR = "../../../" import("$SOURCE_DIR/telephony_core_service.gni") ohos_unittest("esim_service_client_branch_gtest") { install_enable = true subsystem_name = "telephony" part_name = "core_service" test_module = "tel_esim_gtest" module_out_path = part_name + "/" + test_module sources = [ "$SOURCE_DIR/frameworks/native/src/download_profile_config_info_parcel.cpp", "$SOURCE_DIR/frameworks/native/src/download_profile_result_parcel.cpp", "$SOURCE_DIR/frameworks/native/src/downloadable_profile_parcel.cpp", "$SOURCE_DIR/frameworks/native/src/euicc_info_parcel.cpp", "$SOURCE_DIR/frameworks/native/src/get_downloadable_profiles_result_parcel.cpp", "$SOURCE_DIR/frameworks/native/src/profile_info_list_parcel.cpp", "$SOURCE_DIR/frameworks/native/src/profile_metadata_result_parcel.cpp", "$SOURCE_DIR/frameworks/native/src/response_esim_result.cpp", "esim_service_client_branch_test.cpp", ] include_dirs = [ "$SOURCE_DIR/interfaces/innerkits/include", "$SOURCE_DIR/test/unittest/esim_gtest/mock/include", ] configs = [ "$SOURCE_DIR/utils:telephony_log_config" ] deps = [ "$SOURCE_DIR/interfaces/innerkits:tel_core_service_api", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:want", "ability_base:zuri", "ability_runtime:ability_manager", "ability_runtime:data_ability_helper", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "cJSON:cjson", "c_utils:utils", "common_event_service:cesfwk_innerkits", "config_policy:configpolicy_util", "core_service:libtel_vcard", "data_share:datashare_common", "data_share:datashare_consumer", "drivers_interface_ril:ril_idl_headers", "eventhandler:libeventhandler", "hdf_core:libhdi", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_single", "netmanager_base:net_conn_manager_if", "netmanager_ext:net_tether_manager_if", "power_manager:powermgr_client", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] defines = [ "TELEPHONY_LOG_TAG = \"CoreServiceGtest\"", "LOG_DOMAIN = 0xD000F00", ] cflags = [ "-flto", "-fsanitize=cfi", "-fsanitize-cfi-cross-dso", "-fvisibility=hidden", ] ldflags = [ "-flto", "-fsanitize=cfi", "-fsanitize-cfi-cross-dso", ] } ohos_unittest("tel_esim_gtest") { install_enable = true subsystem_name = "telephony" part_name = "core_service" test_module = "tel_esim_gtest" module_out_path = part_name + "/" + test_module sources = [ "esim_core_service_client_test.cpp", "esim_core_service_proxy_test.cpp", "esim_core_service_stub_test.cpp", "esim_core_service_test.cpp", "esim_file_manager_test.cpp", "esim_manager_test.cpp", "esim_test.cpp", ] include_dirs = [ "$SOURCE_DIR/services/core/include", "$SOURCE_DIR/utils/codec/include", "$SOURCE_DIR/utils/log/include", "$SOURCE_DIR/utils/preferences/include", "$SOURCE_DIR/services/sim/include", "$SOURCE_DIR/services/network_search/include", "$SOURCE_DIR/services/tel_ril/include", "$SOURCE_DIR/services/telephony_ext_wrapper/include", "$SOURCE_DIR/interfaces/innerkits/include", "$SOURCE_DIR/test/unittest/esim_gtest/mock/include", ] configs = [ "$SOURCE_DIR/utils:telephony_log_config" ] deps = [ "$SOURCE_DIR:tel_core_service", "$SOURCE_DIR/interfaces/innerkits:tel_core_service_api", "$SOURCE_DIR/utils:libtel_common", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:want", "ability_base:zuri", "ability_runtime:ability_manager", "ability_runtime:data_ability_helper", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "cJSON:cjson", "c_utils:utils", "common_event_service:cesfwk_innerkits", "config_policy:configpolicy_util", "core_service:libtel_vcard", "data_share:datashare_common", "data_share:datashare_consumer", "drivers_interface_ril:ril_idl_headers", "eventhandler:libeventhandler", "hdf_core:libhdi", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_single", "netmanager_base:net_conn_manager_if", "netmanager_ext:net_tether_manager_if", "power_manager:powermgr_client", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] defines = [ "TELEPHONY_LOG_TAG = \"CoreServiceGtest\"", "LOG_DOMAIN = 0xD000F00", ] if (defined(global_parts_info) && defined(global_parts_info.location_location) && global_parts_info.location_location) { external_deps += [ "location:lbsservice_common", "location:locator_sdk", ] defines += [ "ABILITY_LOCATION_SUPPORT" ] } defines += telephony_extra_defines cflags = [ "-flto", "-fsanitize=cfi", "-fsanitize-cfi-cross-dso", "-fvisibility=hidden", ] ldflags = [ "-flto", "-fsanitize=cfi", "-fsanitize-cfi-cross-dso", ] } ohos_unittest("esim_core_service_client_branch_test") { install_enable = true subsystem_name = "telephony" part_name = "core_service" test_module = "tel_esim_gtest" module_out_path = part_name + "/" + test_module sources = [ "esim_core_service_client_branch_test.cpp" ] include_dirs = [ "$SOURCE_DIR/services/core/include", "$SOURCE_DIR/utils/codec/include", "$SOURCE_DIR/utils/log/include", "$SOURCE_DIR/utils/preferences/include", "$SOURCE_DIR/services/sim/include", "$SOURCE_DIR/services/network_search/include", "$SOURCE_DIR/services/tel_ril/include", "$SOURCE_DIR/services/telephony_ext_wrapper/include", "$SOURCE_DIR/interfaces/innerkits/include", "$SOURCE_DIR/test/unittest/esim_gtest/mock/include", ] configs = [ "$SOURCE_DIR/utils:telephony_log_config" ] deps = [ "$SOURCE_DIR:tel_core_service", "$SOURCE_DIR/interfaces/innerkits:tel_core_service_api", "$SOURCE_DIR/utils:libtel_common", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:want", "ability_base:zuri", "ability_runtime:ability_manager", "ability_runtime:data_ability_helper", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "cJSON:cjson", "c_utils:utils", "common_event_service:cesfwk_innerkits", "config_policy:configpolicy_util", "core_service:libtel_vcard", "data_share:datashare_common", "data_share:datashare_consumer", "drivers_interface_ril:ril_idl_headers", "eventhandler:libeventhandler", "hdf_core:libhdi", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_single", "netmanager_base:net_conn_manager_if", "netmanager_ext:net_tether_manager_if", "power_manager:powermgr_client", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] defines = [ "TELEPHONY_LOG_TAG = \"CoreServiceGtest\"", "LOG_DOMAIN = 0xD000F00", ] defines += telephony_extra_defines if (defined(global_parts_info) && defined(global_parts_info.location_location) && global_parts_info.location_location) { external_deps += [ "location:lbsservice_common", "location:locator_sdk", ] defines += [ "ABILITY_LOCATION_SUPPORT" ] } cflags = [ "-flto", "-fsanitize=cfi", "-fsanitize-cfi-cross-dso", "-fvisibility=hidden", ] ldflags = [ "-flto", "-fsanitize=cfi", "-fsanitize-cfi-cross-dso", ] } group("unittest") { testonly = true deps = [ ":esim_core_service_client_branch_test", ":esim_service_client_branch_gtest", ":tel_esim_gtest", ] }