Lines Matching refs:root_dir
64 fs::path root_dir = fs::unique_path(); in create_tree() local
66 fs::create_directory(root_dir); in create_tree()
67 create_file(root_dir / "f1", "f1"); in create_tree()
68 create_file(root_dir / "f2", "f2"); in create_tree()
70 fs::create_directory(root_dir / "d1"); in create_tree()
71 create_file(root_dir / "d1/f1", "d1f1"); in create_tree()
73 fs::create_directory(root_dir / "d1/d1"); in create_tree()
74 create_file(root_dir / "d1/d1/f1", "d1d1f1"); in create_tree()
76 fs::create_directory(root_dir / "d1/d2"); in create_tree()
78 fs::create_directory(root_dir / "d2"); in create_tree()
79 create_file(root_dir / "d2/f1", "d2f1"); in create_tree()
81 return root_dir; in create_tree()
86 directory_tree collect_directory_tree(fs::path const& root_dir) in collect_directory_tree() argument
88 std::cout << "Collecting directory tree in: " << root_dir << '\n'; in collect_directory_tree()
91 …fs::recursive_directory_iterator it(root_dir, fs::directory_options::skip_permission_denied | fs::… in collect_directory_tree()
94 fs::path p = fs::relative(it->path(), root_dir); in collect_directory_tree()
105 void test_copy_file_default(fs::path const& root_dir) in test_copy_file_default() argument
112 fs::copy(root_dir / "f1", target_dir); in test_copy_file_default()
113 fs::copy(root_dir / "f2", target_dir / "f3"); in test_copy_file_default()
127 void test_copy_dir_default(fs::path const& root_dir, bool with_symlinks) in test_copy_dir_default() argument
133 fs::copy(root_dir, target_dir); in test_copy_dir_default()
153 void test_copy_dir_default_ec(fs::path const& root_dir, bool with_symlinks) in test_copy_dir_default_ec() argument
163 fs::copy(root_dir, target_dir, ec); in test_copy_dir_default_ec()
184 void test_copy_dir_recursive(fs::path const& root_dir) in test_copy_dir_recursive() argument
190 fs::copy(root_dir, target_dir, fs::copy_options::recursive); in test_copy_dir_recursive()
214 void test_copy_dir_recursive_tree(fs::path const& root_dir) in test_copy_dir_recursive_tree() argument
220 … fs::copy(root_dir, target_dir, fs::copy_options::recursive | fs::copy_options::directories_only); in test_copy_dir_recursive_tree()
233 void test_copy_file_symlinks(fs::path const& root_dir) in test_copy_file_symlinks() argument
240 fs::copy(root_dir / "f1", target_dir); in test_copy_file_symlinks()
244 fs::copy(".." / root_dir / "f2", "f2", fs::copy_options::create_symlinks); in test_copy_file_symlinks()
253 if (link_target != (".." / root_dir / "f2")) in test_copy_file_symlinks()
269 void test_copy_errors(fs::path const& root_dir, bool symlinks_supported) in test_copy_errors() argument
276 BOOST_TEST_THROWS(fs::copy(root_dir / "non-existing", target_dir), fs::filesystem_error); in test_copy_errors()
280 BOOST_TEST_THROWS(fs::copy(root_dir / "f1", target_dir), fs::filesystem_error); in test_copy_errors()
281 BOOST_TEST_THROWS(fs::copy(root_dir / "f1", target_dir / "f1"), fs::filesystem_error); in test_copy_errors()
282 BOOST_TEST_THROWS(fs::copy(root_dir / "d1", target_dir / "f1"), fs::filesystem_error); in test_copy_errors()
290 …BOOST_TEST_THROWS(fs::copy(root_dir, target_dir, fs::copy_options::create_symlinks), fs::filesyste… in test_copy_errors()
302 fs::path root_dir = create_tree(); in main() local
304 test_copy_file_default(root_dir); in main()
305 test_copy_dir_default(root_dir, false); in main()
306 test_copy_dir_default_ec(root_dir, false); in main()
307 test_copy_dir_recursive(root_dir); in main()
308 test_copy_dir_recursive_tree(root_dir); in main()
313 fs::create_symlink("f1", root_dir / "s1"); in main()
330 test_copy_dir_default(root_dir, true); in main()
331 test_copy_file_symlinks(root_dir); in main()
334 test_copy_errors(root_dir, symlinks_supported); in main()
336 fs::remove_all(root_dir); in main()