# Copyright (c) 2022-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. import("//build/test.gni") import("../../soc_perf.gni") module_output_path = "soc_perf/socperftest" config("module_private_config") { visibility = [ ":*" ] include_dirs = [ "${socperf_common}/include", "${socperf_interfaces}/inner_api/socperf_client/include", "${socperf_services}/core/include", "${socperf_services}/server/include", ] } ohos_unittest("SocPerfServerTest") { module_out_path = module_output_path sources = [ "mock/mock_accesstoken_kit.cpp", "mock/mock_system_ability.cpp", "socperf_server_test.cpp", ] configs = [ ":module_private_config" ] deps = [ "${socperf_services}:socperf_server_static", "//third_party/googletest:gtest_main", "//third_party/libxml2:libxml2", ] external_deps = [ "access_token:libaccesstoken_sdk", "access_token:libtokenid_sdk", "c_utils:utils", "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "ipc:ipc_single", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" } ohos_unittest("SocPerfSubTest") { module_out_path = module_output_path sources = [ "socperf_sub_test.cpp" ] configs = [ ":module_private_config" ] deps = [ "${socperf_interfaces}/inner_api/socperf_client:socperf_client", "//third_party/googletest:gtest_main", "//third_party/libxml2:libxml2", ] external_deps = [ "c_utils:utils", "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "ipc:ipc_single", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] } ohos_unittest("SocPerfSubMockTest") { module_out_path = module_output_path sources = [ "mock/mock_socperf_client.cpp", "socperf_sub_mock_test.cpp", ] configs = [ ":module_private_config" ] deps = [ "${socperf_interfaces}/inner_api/socperf_client:socperf_client", "//third_party/googletest:gtest_main", "//third_party/libxml2:libxml2", ] external_deps = [ "c_utils:utils", "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "ipc:ipc_single", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] } group("unittest") { testonly = true deps = [ ":SocPerfServerTest", ":SocPerfSubMockTest", ":SocPerfSubTest", ] }