1# Copyright (c) 2024-2024 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/ohos.gni") 15import("//build/test.gni") 16import("../../hapsigntool_cpp/signature_tools.gni") 17 18module_out_path = "hapsigner/hapsigner_pc" 19 20ohos_unittest("hapsigntool_pc_unittest") { 21 testonly = true 22 module_out_path = module_out_path 23 resource_config_file = "ohos_test.xml" 24 25 configs = [ "${signature_tools_test}:service_include" ] 26 27 sources = [ 28 "./byteBuffer/byte_buffer_test.cpp", 29 "./codeSigning/datastructure/code_sign_block_header_test.cpp", 30 "./codeSigning/datastructure/code_sign_block_test.cpp", 31 "./codeSigning/datastructure/elf_sign_block_test.cpp", 32 "./codeSigning/datastructure/extension_test.cpp", 33 "./codeSigning/datastructure/fs_verity_info_segment_test.cpp", 34 "./codeSigning/datastructure/hap_info_segment_test.cpp", 35 "./codeSigning/datastructure/merkle_tree_extension_test.cpp", 36 "./codeSigning/datastructure/native_lib_info_segment_test.cpp", 37 "./codeSigning/datastructure/segment_header_test.cpp", 38 "./codeSigning/datastructure/sign_info_test.cpp", 39 "./codeSigning/datastructure/signed_file_pos_test.cpp", 40 "./codeSigning/fsverity/fs_verity_descriptor_test.cpp", 41 "./codeSigning/fsverity/fs_verity_descriptor_with_sign_test.cpp", 42 "./codeSigning/fsverity/fs_verity_digest_test.cpp", 43 "./codeSigning/fsverity/fs_verity_generator_test.cpp", 44 "./codeSigning/fsverity/fs_verity_hash_algorithm_test.cpp", 45 "./codeSigning/fsverity/merkle_tree_builder_test.cpp", 46 "./codeSigning/sign/bc_signeddata_generator_test.cpp", 47 "./codeSigning/sign/code_signing_test.cpp", 48 "./codeSigning/sign/verify_code_signature_test.cpp", 49 "./codeSigning/utils/cms_utils_test.cpp", 50 "./codeSigning/utils/fs_digest_utils_test.cpp", 51 "./elfVerify/hap_utils_test.cpp", 52 "./elfVerify/sign_block_info_test.cpp", 53 "./elfVerify/sign_content_info_test.cpp", 54 "./elfVerify/signature_block_types_test.cpp", 55 "./elfVerify/signing_block_test.cpp", 56 "./elfVerify/verify_bin_test.cpp", 57 "./elfVerify/verify_elf_test.cpp", 58 "./generateCA/generate_ca_test.cpp", 59 "./generateCA/generate_general_ca_test.cpp", 60 "./generateCA/generate_sub_ca_test.cpp", 61 "./generateCsr/generate_csr_test.cpp", 62 "./generateKeyPair/generate_keypair_test.cpp", 63 "./generateKeyPair/hap_sign_cmd_test.cpp", 64 "./generateKeyPair/hap_sign_tool_test.cpp", 65 "./generateKeyPair/options_test.cpp", 66 "./generateKeyPair/process_cmd_expansion_test.cpp", 67 "./generateKeyPair/process_cmd_test.cpp", 68 "./hapSign/block_data_test.cpp", 69 "./hapSign/block_head_test.cpp", 70 "./hapSign/hap_openssl_utils_test.cpp", 71 "./hapSign/hap_sign_test.cpp", 72 "./hapSign/sign_bin_test.cpp", 73 "./hapSign/sign_block_data_test.cpp", 74 "./hapSign/sign_elf_test.cpp", 75 "./hapSign/sign_head_test.cpp", 76 "./hapSign/sign_provider_test.cpp", 77 "./hapVerify/hap_cert_verify_openssl_utils_test.cpp", 78 "./hapVerify/hap_signer_block_utils_test.cpp", 79 "./hapVerify/hap_verify_test.cpp", 80 "./hapVerify/provision_verify_test.cpp", 81 "./hapVerify/random_access_file_test.cpp", 82 "./signProfile/pkcs7_data_test.cpp", 83 "./signProfile/profile_test.cpp", 84 "./signProfile/provision_test.cpp", 85 "./signProfile/sign_profile_test.cpp", 86 "./utils/byte_array_utils_test.cpp", 87 "./utils/cert_tools_test.cpp", 88 "./utils/file_utils_test.cpp", 89 "./zip/random_access_file_input_output_test.cpp", 90 "./zip/zip_signer_test.cpp", 91 ] 92 93 remove_configs = [ "//build/config/compiler:no_exceptions" ] 94 95 deps = [ "${signature_tools_test}:service_target" ] 96 97 install_images = [ "system" ] 98 install_enable = true 99 part_name = "hapsigner" 100 subsystem_name = "developtools" 101} 102