MCPcopy Create free account
hub / github.com/boostorg/filesystem / main

Function main

test/copy_test.cpp:292–340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290} // namespace
291
292int main()
293{
294 try
295 {
296 fs::path root_dir = create_tree();
297
298 test_copy_file_default(root_dir);
299 test_copy_dir_default(root_dir, false);
300 test_copy_dir_default_ec(root_dir, false);
301 test_copy_dir_recursive(root_dir);
302 test_copy_dir_recursive_tree(root_dir);
303
304 bool symlinks_supported = false;
305 try
306 {
307 fs::create_symlink("f1", root_dir / "s1");
308 symlinks_supported = true;
309 std::cout << " *** For information only ***\n"
310 " create_symlink() attempt succeeded"
311 << std::endl;
312 }
313 catch (fs::filesystem_error& e)
314 {
315 std::cout << " *** For information only ***\n"
316 " create_symlink() attempt failed\n"
317 " filesystem_error.what() reports: "
318 << e.what() << "\n"
319 " create_symlink() may not be supported on this operating system or file system"
320 << std::endl;
321 }
322
323 if (symlinks_supported)
324 {
325 test_copy_dir_default(root_dir, true);
326 test_copy_file_symlinks(root_dir);
327 }
328
329 test_copy_errors(root_dir, symlinks_supported);
330
331 fs::remove_all(root_dir);
332
333 return boost::report_errors();
334 }
335 catch (std::exception& e)
336 {
337 std::cout << "FAIL, exception caught: " << boost::diagnostic_information(e) << std::endl;
338 return 1;
339 }
340}

Callers

nothing calls this directly

Calls 11

test_copy_file_defaultFunction · 0.85
test_copy_dir_defaultFunction · 0.85
test_copy_dir_default_ecFunction · 0.85
test_copy_dir_recursiveFunction · 0.85
test_copy_file_symlinksFunction · 0.85
test_copy_errorsFunction · 0.85
whatMethod · 0.80
create_treeFunction · 0.70
create_symlinkFunction · 0.50
remove_allFunction · 0.50

Tested by

no test coverage detected