about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2015-08-26 14:02:38 -0400
committerSteve Klabnik <steve@steveklabnik.com>2015-08-27 13:43:43 -0400
commitaf58e5cfea5af667e98610f8f885c2994fbf022a (patch)
tree63eea37ca24905f3ceac40c1bdd1bc89cd2c1fd3
parentef3255b063a28ef1ed8346192325cfac66398739 (diff)
downloadrust-af58e5cfea5af667e98610f8f885c2994fbf022a.tar.gz
rust-af58e5cfea5af667e98610f8f885c2994fbf022a.zip
Add Windows-specific comments to testing guide
Fixes #27936
-rw-r--r--src/doc/trpl/testing.md15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/doc/trpl/testing.md b/src/doc/trpl/testing.md
index 78803afd5c1..587f60343c3 100644
--- a/src/doc/trpl/testing.md
+++ b/src/doc/trpl/testing.md
@@ -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 you’re using `cmd`:
+
+```bash
+> echo %ERRORLEVEL%
+```
+
+And if you’re 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`: