about summary refs log tree commit diff
path: root/src/test/compiletest
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-09-08 13:42:04 -0700
committerBrian Anderson <banderson@mozilla.com>2011-09-11 17:31:40 -0700
commit0ea55ffdc87cd65de707d2d947cb57084be950f7 (patch)
tree6a8b9c10df23f2cc0f75873640615bb60a37d6bf /src/test/compiletest
parent6f6f36172b2e0cd86ffffd1d0ed2deb75972db72 (diff)
downloadrust-0ea55ffdc87cd65de707d2d947cb57084be950f7.tar.gz
rust-0ea55ffdc87cd65de707d2d947cb57084be950f7.zip
Use a unique exit status when the runtime fails normally
Check for it in run-fail tests
Diffstat (limited to 'src/test/compiletest')
-rw-r--r--src/test/compiletest/runtest.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/test/compiletest/runtest.rs b/src/test/compiletest/runtest.rs
index c98f1deba24..fdcd627811d 100644
--- a/src/test/compiletest/runtest.rs
+++ b/src/test/compiletest/runtest.rs
@@ -51,15 +51,21 @@ fn run_rfail_test(cx: &cx, props: &test_props, testfile: &str) {
 
     procres = exec_compiled_test(cx, props, testfile);
 
-    if procres.status == 0 {
-        fatal_procres("run-fail test didn't produce an error!", procres);
-    }
-
+    // The value our Makefile configures valgrind to return on failure
     const valgrind_err: int = 100;
     if procres.status == valgrind_err {
         fatal_procres("run-fail test isn't valgrind-clean!", procres);
     }
 
+    // The value the rust runtime returns on failure
+    const rust_err: int = 101;
+    if procres.status != rust_err {
+        fatal_procres(
+            #fmt("run-fail test produced the wrong error code: %d",
+                 procres.status),
+            procres);
+    }
+
     check_error_patterns(props, testfile, procres);
 }