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    deps += [
29      ":rust_utils_ashmem_test",
30      ":rust_utils_file_test",
31    ]
32  }
33
34  ohos_rust_unittest("rust_utils_ashmem_test") {
35    module_out_path = "utils/base/rust"
36    sources = [ "rust_utils_ashmem_test.rs" ]
37    configs = [ ":module_private_config" ]
38    deps = [ "//commonlibrary/c_utils/base:utils_rust" ]
39  }
40
41  ohos_rust_unittest("rust_utils_file_test") {
42    module_out_path = "utils/base/rust"
43    sources = [ "rust_utils_file_test.rs" ]
44    deps = [
45      "//commonlibrary/c_utils/base:utils_rust",
46      "//third_party/rust/crates/cxx:lib",
47    ]
48  }
49
50  ohos_rust_unittest("rust_utils_directory_test") {
51    module_out_path = "utils/base/rust"
52    sources = [ "rust_utils_directory_test.rs" ]
53    deps = [
54      "//commonlibrary/c_utils/base:utils_rust",
55      "//third_party/rust/crates/cxx:lib",
56    ]
57  }
58}
59