| 23 | std::filesystem::remove_all(root, ec); |
| 24 | std::filesystem::create_directories(root); |
| 25 | return root; |
| 26 | } |
| 27 | |
| 28 | std::filesystem::path write_config( |
| 29 | const std::filesystem::path & root, |
| 30 | const std::string & name, |
| 31 | const std::string & text) { |
| 32 | const auto path = root / name; |
| 33 | std::ofstream out(path); |
| 34 | if (!out) { |
| 35 | throw std::runtime_error("failed to create test config: " + path.string()); |
| 36 | } |
| 37 | out << text; |
| 38 | if (!out) { |
| 39 | throw std::runtime_error("failed to write test config: " + path.string()); |
| 40 | } |
| 41 | return path; |
| 42 | } |
no outgoing calls
no test coverage detected