• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2022 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("//base/security/crypto_framework/frameworks/frameworks.gni")
15import("//base/security/crypto_framework/plugin/plugin.gni")
16import("//build/test.gni")
17
18module_output_path = "crypto_framework/crypto_framework_test"
19
20ohos_unittest("crypto_framework_test") {
21  testonly = true
22  module_out_path = module_output_path
23
24  include_dirs = [ "./include" ]
25  include_dirs += [
26    "//commonlibrary/c_utils/base/include",
27    "//third_party/openssl/include/",
28  ]
29  include_dirs += framework_inc_path + plugin_inc_path
30
31  sources = [
32    "src/crypto_3des_cipher_test.cpp",
33    "src/crypto_aes_cipher_test.cpp",
34    "src/crypto_ecc_asy_key_generator_test.cpp",
35    "src/crypto_ecc_key_agreement_test.cpp",
36    "src/crypto_ecc_sign_test.cpp",
37    "src/crypto_ecc_verify_test.cpp",
38    "src/crypto_mac_test.cpp",
39    "src/crypto_md_test.cpp",
40    "src/crypto_rand_test.cpp",
41    "src/crypto_rsa_asy_key_generator_test.cpp",
42    "src/crypto_rsa_cipher_test.cpp",
43    "src/crypto_rsa_sign_test.cpp",
44    "src/crypto_rsa_verify_test.cpp",
45    "src/crypto_x509_cert_chain_validator_test.cpp",
46    "src/crypto_x509_certificate_test.cpp",
47    "src/crypto_x509_crl_test.cpp",
48  ]
49
50  sources += framework_files + plugin_files
51  sources += [
52    "//base/security/crypto_framework/common/src/blob.c",
53    "//base/security/crypto_framework/common/src/hcf_parcel.c",
54    "//base/security/crypto_framework/common/src/hcf_string.c",
55    "//base/security/crypto_framework/common/src/log.c",
56    "//base/security/crypto_framework/common/src/object_base.c",
57    "//base/security/crypto_framework/common/src/params_parser.c",
58    "//base/security/crypto_framework/common/src/utils.c",
59    "src/memory_mock.c",
60  ]
61  cflags = [ "-DHILOG_ENABLE" ]
62  if (target_cpu == "arm") {
63    cflags += [ "-DBINDER_IPC_32BIT" ]
64  }
65
66  deps = [
67    "//third_party/bounds_checking_function:libsec_shared",
68    "//third_party/openssl:libcrypto_shared",
69  ]
70
71  defines = [ "HILOG_ENABLE" ]
72
73  external_deps = [
74    "c_utils:utils",
75    "hiviewdfx_hilog_native:libhilog",
76  ]
77}
78