| 145 | } |
| 146 | |
| 147 | void test_copy_dir_default_ec(fs::path const& root_dir, bool with_symlinks) |
| 148 | { |
| 149 | // This test is similar to test_copy_dir_default, but uses an error_code overload of the operation. |
| 150 | // Tests for https://github.com/boostorg/filesystem/issues/152 fix. |
| 151 | |
| 152 | std::cout << "test_copy_dir_default_ec" << std::endl; |
| 153 | |
| 154 | fs::path target_dir = fs::unique_path(); |
| 155 | |
| 156 | boost::system::error_code ec; |
| 157 | fs::copy(root_dir, target_dir, ec); |
| 158 | BOOST_TEST(!ec); |
| 159 | |
| 160 | directory_tree tree = collect_directory_tree(target_dir); |
| 161 | |
| 162 | BOOST_TEST_EQ(tree.size(), 4u + with_symlinks); |
| 163 | BOOST_TEST(tree.find("f1") != tree.end()); |
| 164 | BOOST_TEST(tree.find("f2") != tree.end()); |
| 165 | BOOST_TEST(tree.find("d1") != tree.end()); |
| 166 | BOOST_TEST(tree.find("d2") != tree.end()); |
| 167 | if (with_symlinks) |
| 168 | { |
| 169 | BOOST_TEST(tree.find("s1") != tree.end()); |
| 170 | } |
| 171 | |
| 172 | verify_file(target_dir / "f1", "f1"); |
| 173 | verify_file(target_dir / "f2", "f2"); |
| 174 | |
| 175 | fs::remove_all(target_dir); |
| 176 | } |
| 177 | |
| 178 | void test_copy_dir_recursive(fs::path const& root_dir) |
| 179 | { |
no test coverage detected