Commit fb7877c
committed
Refactor tests to use more of std::filesystem
Because the tests didn't use std::filesystem originally, there was a lot
of logic that had to be re-implemented with OS specific function calls.
Now that std::filesystem is in use, many things can be refactored:
* Replace create_folder with std::filesystem::create_directories
* Replace delete_folder & delete_folder_contents with
std::filesystem::remove_all
* Lazily create folders on first use, resulting in many fewer filesystem
operations
* FolderManager::copy_file is a wrapper around std::filesystem::copy_file
* FolderManager::remove is a wrapper around std::filesystem::remove
* Each test uses a separate directory, allowing parallel test execution
* FolderManager::add_symlink wraps around std::filesystem::create_symlink,
allows for easier usage of symlinks in tests
* Use switch in FrameworkEnvironment::add_icd() for consistency
* Use error code filesystem calls to get better error messages
* Don't make changes to the filesystem when running death tests
* Move fs::FolderManager to test_environment since the type was only in
test_util so that the shim could get access to it. Now a function
pointer is used.1 parent 345c989 commit fb7877c
File tree
12 files changed
+298
-347
lines changed- tests
- framework
- shim
12 files changed
+298
-347
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
| 80 | + | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
138 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
139 | 142 | | |
140 | 143 | | |
141 | | - | |
| 144 | + | |
142 | 145 | | |
143 | 146 | | |
144 | 147 | | |
| |||
214 | 217 | | |
215 | 218 | | |
216 | 219 | | |
| 220 | + | |
| 221 | + | |
217 | 222 | | |
218 | 223 | | |
219 | 224 | | |
| |||
233 | 238 | | |
234 | 239 | | |
235 | 240 | | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | 241 | | |
240 | 242 | | |
241 | 243 | | |
242 | | - | |
| 244 | + | |
243 | 245 | | |
244 | 246 | | |
245 | 247 | | |
246 | 248 | | |
247 | | - | |
| 249 | + | |
248 | 250 | | |
249 | 251 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | 61 | | |
72 | 62 | | |
73 | 63 | | |
| |||
191 | 181 | | |
192 | 182 | | |
193 | 183 | | |
| 184 | + | |
| 185 | + | |
194 | 186 | | |
195 | 187 | | |
196 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
| 39 | + | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
| 208 | + | |
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
515 | | - | |
516 | | - | |
| 515 | + | |
| 516 | + | |
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
0 commit comments