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. 13 14import("//build/test.gni") 15import("//foundation/filemanagement/file_api/file_api.gni") 16 17ohos_unittest("class_atomicfile_test") { 18 module_out_path = "file_api/file_api" 19 20 sources = [ 21 "${file_api_path}/interfaces/kits/js/src/common/file_helper/fd_guard.cpp", 22 "${file_api_path}/interfaces/kits/js/src/mod_fs/class_atomicfile/atomicfile_n_exporter.cpp", 23 "${file_api_path}/interfaces/test/unittest/class_atomicfile/mock/atomicfile_mock.cpp", 24 "${file_api_path}/interfaces/test/unittest/class_atomicfile/atomicfile_mock_test.cpp", 25 ] 26 27 include_dirs = [ 28 "${file_api_path}/interfaces/kits/js/src/common", 29 "${file_api_path}/interfaces/kits/js/src/common/file_helper", 30 "${file_api_path}/interfaces/kits/js/src/mod_fs", 31 "${file_api_path}/interfaces/kits/js/src/mod_fs/class_atomicfile", 32 "${file_api_path}/interfaces/kits/js/src/mod_fs/properties", 33 "${file_api_path}/interfaces/test/unittest/class_atomicfile/mock", 34 ] 35 36 use_exceptions = true 37 38 deps = [ 39 "${file_api_path}/interfaces/kits/js:fs", 40 "${utils_path}/filemgmt_libhilog:filemgmt_libhilog", 41 "${utils_path}/filemgmt_libn:filemgmt_libn", 42 ] 43 44 external_deps = [ 45 "ability_base:zuri", 46 "app_file_service:fileuri_native", 47 "c_utils:utils", 48 "c_utils:utilsbase", 49 "dfs_service:distributed_file_daemon_kit_inner", 50 "dfs_service:libdistributedfileutils", 51 "googletest:gmock_main", 52 "googletest:gtest_main", 53 "hilog:libhilog", 54 "ipc:ipc_core", 55 "napi:ace_napi", 56 ] 57 58 defines = [ 59 "private=public", 60 ] 61}