Skip to content

Commit 9a42834

Browse files
committed
docs: Added verify_file_layout() to testing docs
1 parent d017526 commit 9a42834

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/doc/contrib/src/tests/writing.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,21 @@ test.
6464
- See [`support::compare`] for an explanation of the string pattern matching.
6565
Patterns are used to make it easier to match against the expected output.
6666

67+
#### Filesystem layout testing
68+
69+
Tests often to need to verify Cargo created/removed files.
70+
The `CargoPathExt` trait (implmented by `Path` and `PathBuf`) provides a `verify_file_layout()` to verify a file system tree against a snapshot. The snapshot format is very similar to the unix `tree` command output.
71+
72+
Files vary across operating systems, for example `.pdb` files on Windows.
73+
The file name in the snapshot may be suffixed by `[target_platform=<platform1>,<platform2>,...]` to include the file only on targetted platforms.
74+
75+
The currently supported options are:
76+
* `windows-msvc`
77+
* `windows-gnu`
78+
* `windows` (includes both `windows-msvc` and `windows-gnu`)
79+
* `linux`
80+
* `macos`
81+
6782
#### Testing Nightly Features
6883

6984
If you are testing a Cargo feature that only works on "nightly" Cargo, then

0 commit comments

Comments
 (0)