1# Copyright (c) 2023 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. 13import("//build/ohos.gni") 14import("//build/test.gni") 15 16if (host_os == "linux" && !is_asan && !is_arkui_x) { 17 config("module_private_config") { 18 visibility = [ ":*" ] 19 20 # library path 21 lib_dirs = [ "libs" ] 22 } 23 24 group("unittest") { 25 testonly = true 26 deps = [] 27 28 if (!use_clang_coverage) { 29 deps += [ 30 ":rust_utils_ashmem_test", 31 ":rust_utils_file_test", 32 ] 33 } 34 } 35 36 ohos_rust_unittest("rust_utils_ashmem_test") { 37 module_out_path = "utils/base/rust" 38 sources = [ "rust_utils_ashmem_test.rs" ] 39 configs = [ ":module_private_config" ] 40 deps = [ "//commonlibrary/c_utils/base:utils_rust" ] 41 } 42 43 ohos_rust_unittest("rust_utils_file_test") { 44 module_out_path = "utils/base/rust" 45 sources = [ "rust_utils_file_test.rs" ] 46 deps = [ 47 "//commonlibrary/c_utils/base:utils_rust", 48 "//third_party/rust/crates/cxx:lib", 49 ] 50 } 51 52 ohos_rust_unittest("rust_utils_directory_test") { 53 module_out_path = "utils/base/rust" 54 sources = [ "rust_utils_directory_test.rs" ] 55 deps = [ 56 "//commonlibrary/c_utils/base:utils_rust", 57 "//third_party/rust/crates/cxx:lib", 58 ] 59 } 60} 61