# Copyright (c) 2024 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") rust_cxx("samgr_rust_test_gen") { sources = [ "mem.rs" ] } ohos_static_library("samgr_rust_test_c") { sources = [ "cxx/samgr_rust_test_mem.cpp" ] sources += get_target_outputs(":samgr_rust_test_gen") include_dirs = [ "include", "${target_gen_dir}/src", ] deps = [ ":samgr_rust_test_gen", "//third_party/rust/crates/cxx:cxx_cppdeps", ] external_deps = [ "c_utils:utils" ] subsystem_name = "systemabilitymgr" part_name = "samgr" } ohos_rust_unittest("rust_samgr_ut_test") { module_out_path = "samgr/samgr_rust" sources = [ "../src/lib.rs" ] external_deps = [ "hilog:hilog_rust", "ipc:ipc_rust", ] deps = [ "../../rust:samgr_rust_cpp", "//third_party/rust/crates/cxx:lib", ] subsystem_name = "systemabilitymgr" part_name = "samgr" } ohos_rust_systemtest("rust_samgr_sdv_test") { module_out_path = "samgr/samgr_rust" rustflags = [ "--cfg=gn_test" ] sources = [ "entry.rs" ] deps = [ ":samgr_rust_test_c", "../../rust:samgr_rust", "//third_party/rust/crates/cxx:lib", ] external_deps = [ "access_token:libnativetoken_shared", "access_token:libtokensetproc_shared", "hilog:hilog_rust", "ipc:ipc_rust", "safwk:system_ability_fwk_rust", ] subsystem_name = "systemabilitymgr" part_name = "samgr" } group("unittest") { testonly = true deps = [ ":rust_samgr_sdv_test", ":rust_samgr_ut_test", ] }