summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Sartori <alberto.sartori@huawei.com>2022-05-31 17:51:33 +0200
committerAlberto Sartori <alberto.sartori@huawei.com>2022-05-31 17:51:33 +0200
commitd79ad8871db8e4d88045e66e077b4f7412a84c09 (patch)
treec9f8e854699dd62afd49e1e6ae09ac01c7e70277
parentf52a182afe3af442ecd8ecf441124a6489f831a3 (diff)
downloadjustbuild-d79ad8871db8e4d88045e66e077b4f7412a84c09.tar.gz
improve file_system_manager test
test hard-link capabilities on self generated file instead of relying on right permissions of the input file.
-rw-r--r--test/buildtool/file_system/file_system_manager.test.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/buildtool/file_system/file_system_manager.test.cpp b/test/buildtool/file_system/file_system_manager.test.cpp
index dfbbd1ce..a57cdcc0 100644
--- a/test/buildtool/file_system/file_system_manager.test.cpp
+++ b/test/buildtool/file_system/file_system_manager.test.cpp
@@ -545,8 +545,11 @@ TEST_CASE("CreateFileHardlink", "[file_system]") {
REQUIRE(FileSystemManager::CreateDirectory(to.parent_path()));
SECTION("Existing file") {
- std::filesystem::path from{
- "test/buildtool/file_system/data/example_file"};
+ std::filesystem::path from{"example_file"};
+ {
+ std::ofstream f{from};
+ f << "foo";
+ }
CHECK(FileSystemManager::CreateFileHardlink(from, to));
CHECK(std::filesystem::exists(to));