• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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/test.gni")
15import("../../../../services/samgr/var.gni")
16
17rust_cxx("samgr_rust_test_gen") {
18  sources = [ "mem.rs" ]
19}
20
21ohos_static_library("samgr_rust_test_c") {
22  sources = [ "cxx/samgr_rust_test_mem.cpp" ]
23
24  sources += get_target_outputs(":samgr_rust_test_gen")
25
26  include_dirs = [
27    "include",
28    "${target_gen_dir}/src",
29  ]
30
31  deps = [ ":samgr_rust_test_gen" ]
32
33  external_deps = [
34    "c_utils:utils",
35    "rust_cxx:cxx_cppdeps",
36  ]
37
38  subsystem_name = "systemabilitymgr"
39  part_name = "samgr"
40}
41
42ohos_rust_unittest("rust_samgr_ut_test") {
43  module_out_path = "samgr/samgr_rust"
44
45  sources = [ "../src/lib.rs" ]
46  external_deps = [
47    "hilog:hilog_rust",
48    "ipc:ipc_rust",
49    "rust_cxx:lib",
50  ]
51
52  deps = [ "../../rust:samgr_rust_cpp" ]
53
54  subsystem_name = "systemabilitymgr"
55  part_name = "samgr"
56}
57
58ohos_rust_systemtest("rust_samgr_sdv_test") {
59  module_out_path = "samgr/samgr_rust"
60
61  rustflags = [ "--cfg=gn_test" ]
62
63  sources = [ "entry.rs" ]
64
65  deps = [
66    ":samgr_rust_test_c",
67    "../../rust:samgr_rust",
68  ]
69  external_deps = [
70    "hilog:hilog_rust",
71    "ipc:ipc_rust",
72    "rust_cxx:lib",
73    "safwk:system_ability_fwk_rust",
74  ]
75  defines = []
76  if (samgr_support_access_token) {
77    external_deps += [
78      "access_token:libnativetoken",
79      "access_token:libtoken_setproc",
80    ]
81    defines += [ "SUPPORT_ACCESS_TOKEN" ]
82  }
83
84  subsystem_name = "systemabilitymgr"
85  part_name = "samgr"
86}
87
88group("unittest") {
89  testonly = true
90  deps = [
91    ":rust_samgr_sdv_test",
92    ":rust_samgr_ut_test",
93  ]
94}
95