You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/doc/contrib/src/tests/writing.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,21 @@ test.
64
64
- See [`support::compare`] for an explanation of the string pattern matching.
65
65
Patterns are used to make it easier to match against the expected output.
66
66
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
+
67
82
#### Testing Nightly Features
68
83
69
84
If you are testing a Cargo feature that only works on "nightly" Cargo, then
0 commit comments