1
Fork 0

Rollup merge of #28022 - steveklabnik:gh27936, r=alexcrichton

Fixes #27936
This commit is contained in:
Manish Goregaokar 2015-08-28 03:38:37 +05:30
commit ab3dc54bcf

View file

@ -120,13 +120,26 @@ And that's reflected in the summary line:
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured
```
We also get a non-zero status code:
We also get a non-zero status code. We can use `$?` on OS X and Linux:
```bash
$ echo $?
101
```
On Windows, if youre using `cmd`:
```bash
> echo %ERRORLEVEL%
```
And if youre using PowerShell:
```bash
> echo $LASTEXITCODE # the code itself
> echo $? # a boolean, fail or succeed
```
This is useful if you want to integrate `cargo test` into other tooling.
We can invert our test's failure with another attribute: `should_panic`: