• 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("//build/ohos.gni")
15import("//build/test.gni")
16
17config("dslm_cmoker") {
18  include_dirs = [ "cmocker" ]
19}
20
21group("dslm_test") {
22  testonly = true
23  deps = []
24
25  if (os_level == "standard") {
26    deps += [ ":DslmUnitTest" ]
27  }
28}
29
30if (os_level == "standard") {
31  # test unittest
32  ohos_unittest("DslmUnitTest") {
33    install_enable = true
34    testonly = true
35    part_name = "device_security_level"
36    subsystem_name = "security"
37    module_out_path = "${part_name}/${target_name}"
38
39    sources = [
40      "../../oem_property/ohos/standard/dslm_ohos_credential.c",
41      "../../services/sa/common/dslm_rpc_process.c",
42      "dslm_baselib_utils_test.cpp",
43      "dslm_memory_mock.cpp",
44      "dslm_msg_interface_mock.cpp",
45      "dslm_oem_property_test.cpp",
46      "dslm_request_callback_mock.cpp",
47      "dslm_rpc_process_test.cpp",
48      "dslm_test.cpp",
49    ]
50
51    include_dirs = [
52      "../../baselib/msglib/include",
53      "../../common/include",
54      "../../interfaces/inner_api/include",
55      "../../interfaces/inner_api/src/standard",
56      "../../oem_property/common",
57      "../../oem_property/ohos/common",
58      "../../oem_property/ohos/standard/impl",
59      "../../services/include",
60      "../../services/dslm",
61      "../../services/sa/common",
62    ]
63
64    configs = [ "../../common:common_configs" ]
65
66    configs += [ ":dslm_cmoker" ]
67
68    deps = [
69      "../../baselib/utils:utils_static",
70      "../../oem_property/ohos/standard:dslm_ohos_cred_obj",
71      "../../services/common:service_common_obj",
72      "../../services/dslm:service_dslm_test_obj",
73      "../../services/msg:service_msg_obj",
74      "//third_party/googletest:gmock",
75    ]
76
77    external_deps = [
78      "access_token:libnativetoken",
79      "access_token:libtoken_setproc",
80      "c_utils:utils",
81      "device_security_level:dslm_sdk",
82      "hilog:libhilog",
83      "huks:libhukssdk",
84    ]
85  }
86}
87