File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -120,13 +120,26 @@ And that's reflected in the summary line:
120
120
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured
121
121
```
122
122
123
- We also get a non-zero status code:
123
+ We also get a non-zero status code. We can use ` $? ` on OS X and Linux :
124
124
125
125
``` bash
126
126
$ echo $?
127
127
101
128
128
```
129
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
+ ``` bash
139
+ > echo $LASTEXITCODE # the code itself
140
+ > echo $? # a boolean, fail or succeed
141
+ ```
142
+
130
143
This is useful if you want to integrate ` cargo test ` into other tooling.
131
144
132
145
We can invert our test's failure with another attribute: ` should_panic ` :
You can’t perform that action at this time.
0 commit comments