We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef3255b commit af58e5cCopy full SHA for af58e5c
src/doc/trpl/testing.md
@@ -120,13 +120,26 @@ And that's reflected in the summary line:
120
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured
121
```
122
123
-We also get a non-zero status code:
+We also get a non-zero status code. We can use `$?` on OS X and Linux:
124
125
```bash
126
$ echo $?
127
101
128
129
130
+On Windows, if you’re using `cmd`:
131
+
132
+```bash
133
+> echo %ERRORLEVEL%
134
+```
135
136
+And if you’re using PowerShell:
137
138
139
+> echo $LASTEXITCODE # the code itself
140
+> echo $? # a boolean, fail or succeed
141
142
143
This is useful if you want to integrate `cargo test` into other tooling.
144
145
We can invert our test's failure with another attribute: `should_panic`:
0 commit comments