• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025 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("//base/startup/init/begetd.gni")
14import("//build/test.gni")
15
16ohos_unittest("fstab_mount_unittest") {
17  module_out_path = "init/init"
18  include_dirs = [
19    "//base/startup/init/test/unittest/single_test/fstab_mount/include",
20    "//base/startup/init/services/init/include",
21    "//base/startup/init/services/log",
22    "//base/startup/init/services/init/standard",
23    "//base/startup/init/interfaces/innerkits/include",
24    "//base/startup/init/ueventd/include",
25    "//base/startup/init/interfaces/innerkits/fs_manager/switch_root/include",
26    "//base/startup/init/interfaces/innerkits/init_module_engine/include",
27    "//base/startup/init/test/mock/libs/include"
28  ]
29
30  sources = [
31    "//base/startup/init/interfaces/innerkits/fs_manager/fstab_mount.c",
32    "//base/startup/init/test/unittest/single_test/fstab_mount/src/fstab_mount_test.cpp",
33    "//base/startup/init/test/mock/libs/src/func_wrapper.cpp",
34  ]
35
36  cflags_cc = [ "-fexceptions" ]
37  ldflags = [
38    "-Wl,--wrap=strdup",
39    "-Wl,--wrap=stat",
40    "-Wl,--wrap=mount",
41    "-Wl,--wrap=mkdir",
42    "-Wl,--wrap=malloc",
43    "-Wl,--wrap=strncat_s",
44    "-Wl,--wrap=snprintf_s",
45  ]
46  deps = [
47    "//base/startup/init/interfaces/innerkits:libbegetutil",
48    "//base/startup/init/interfaces/innerkits/fs_manager:libfsmanager_static",
49  ]
50
51  defines = [
52    "STARTUP_INIT_UT_PATH =\"/data/init_ut\"",
53    "ASAN_DETECTOR",
54    "STARTUP_INIT_TEST",
55  ]
56
57  configs = []
58
59  external_deps = [
60    "bounds_checking_function:libsec_static",
61    "cJSON:cjson",
62    "c_utils:utils",
63    "googletest:gtest",
64    "hilog:libhilog",
65  ]
66}
67