# 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("../cert_manager.gni") module_output_path = "cert_manager_standard/cert_manager_standard_test" ohos_unittest("cm_sdk_test") { module_out_path = module_output_path sources = [ "unittest/src/cm_abort_test.cpp", "unittest/src/cm_app_cert_test.cpp", "unittest/src/cm_finish_test.cpp", "unittest/src/cm_get_auth_list_test.cpp", "unittest/src/cm_get_certinfo_test.cpp", "unittest/src/cm_get_certlist_test.cpp", "unittest/src/cm_grant_test.cpp", "unittest/src/cm_init_test.cpp", "unittest/src/cm_is_authed_test.cpp", "unittest/src/cm_remove_grant_test.cpp", "unittest/src/cm_set_status_test.cpp", "unittest/src/cm_sys_app_cert_test.cpp", "unittest/src/cm_test_common.cpp", "unittest/src/cm_update_test.cpp", "unittest/src/cm_user_cert_test.cpp", ] include_dirs = [ "unittest/include" ] cflags_cc = [ "-Wall", "-Werror", ] cflags = cflags_cc branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true boundary_sanitize = true debug = false integer_overflow = true ubsan = true } deps = [ "../frameworks/cert_manager_standard/main:cert_manager_standard_frameworks", "../interfaces/innerkits/cert_manager_standard/main:cert_manager_sdk", ] external_deps = [ "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "bounds_checking_function:libsec_static", "c_utils:utils", "googletest:gtest", "openssl:libcrypto_shared", ] resource_config_file = "./resource/certificate_manager/ohos_test.xml" defines = [] if (certificate_manager_deps_huks_enabled == "software") { defines += [ "DEPS_HKS_UNTRUSTED_RUNNING_ENV" ] } } group("unittest") { testonly = true deps = [ ":cm_sdk_test" ] } group("module_test") { testonly = true deps = [ "./unittest/module_test:cm_module_test" ] } group("permission_test") { testonly = true deps = [ "./unittest/common_permission_test:cm_common_permission_test", "./unittest/inner_permission_test:cm_inner_permission_test", ] } group("multi_thread_test") { testonly = true deps = [ "./unittest/multi_thread_test:cm_multi_thread_test" ] }