about summary refs log tree commit diff
path: root/src/test/stdtest
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-09-08 12:03:07 -0700
committerBrian Anderson <banderson@mozilla.com>2011-09-11 17:31:34 -0700
commita1131748c2e86bcbcbbbec81a83ca844e58073b4 (patch)
tree5b2dbfc90af41e05af80be6d52ee484b8039611a /src/test/stdtest
parent476bbca87abb9aa17f84d1a8fb91bdefda4668ba (diff)
downloadrust-a1131748c2e86bcbcbbbec81a83ca844e58073b4.tar.gz
rust-a1131748c2e86bcbcbbbec81a83ca844e58073b4.zip
Add a waitpid wrapper to std::run that interprets the exit status on unix
This makes the result of running a program a little more uniform between unix
and windows
Diffstat (limited to 'src/test/stdtest')
-rw-r--r--src/test/stdtest/run.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/stdtest/run.rs b/src/test/stdtest/run.rs
index b60a3935500..f6cf8b5f07f 100644
--- a/src/test/stdtest/run.rs
+++ b/src/test/stdtest/run.rs
@@ -65,3 +65,10 @@ fn test_pipes() {
         ret buf;
     }
 }
+
+#[test]
+fn waitpid() {
+    let pid = run::spawn_process("false", [], 0, 0, 0);
+    let status = run::waitpid(pid);
+    assert status == 1;
+}