about summary refs log tree commit diff
path: root/src/compiletest
diff options
context:
space:
mode:
authorMatt Brubeck <mbrubeck@limpet.net>2011-11-01 10:31:23 -0700
committerMatt Brubeck <mbrubeck@limpet.net>2011-11-01 16:55:39 -0700
commit76077a9fb7f67a8af1b2eb16c2814ca703ad6c97 (patch)
tree5093785e88259f901a94c9199f6908053d4841ca /src/compiletest
parenteabc9f229574a906437dd63359caec1c15fb75ad (diff)
Add should_fail annotation for unit tests
This allows test cases to assert that a function is expected to fail.
Tests annotated with "should_fail" will succeed only if the function
fails.
Diffstat (limited to 'src/compiletest')
-rw-r--r--src/compiletest/compiletest.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiletest/compiletest.rs b/src/compiletest/compiletest.rs
index aa77febd228..a582aa57b0d 100644
--- a/src/compiletest/compiletest.rs
+++ b/src/compiletest/compiletest.rs
@@ -170,7 +170,8 @@ fn make_test(cx: cx, testfile: str, configport: port<[u8]>) ->
    test::test_desc<fn@()> {
     {name: make_test_name(cx.config, testfile),
      fn: make_test_closure(testfile, chan(configport)),
-     ignore: header::is_test_ignored(cx.config, testfile)}
+     ignore: header::is_test_ignored(cx.config, testfile),
+     should_fail: false}
 }
 
 fn make_test_name(config: config, testfile: str) -> str {