diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-07-14 11:29:54 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-07-14 13:51:30 -0700 |
| commit | b3dee955144a722da50e17dde62cb36cbcccf73f (patch) | |
| tree | c4fe653b9eaf9be74f48fac73406f77a427768e9 /src/test/stdtest | |
| parent | 49da7da441716da2ae99b893907f0fbd1655d813 (diff) | |
| download | rust-b3dee955144a722da50e17dde62cb36cbcccf73f.tar.gz rust-b3dee955144a722da50e17dde62cb36cbcccf73f.zip | |
Add a facility for ignoring tests. Issue #428
Adding the #[ignore] attribute will cause the test not to be run, though it will still show up in the list of tests.
Diffstat (limited to 'src/test/stdtest')
| -rw-r--r-- | src/test/stdtest/stdtest.rc | 1 | ||||
| -rw-r--r-- | src/test/stdtest/test.rs | 36 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/test/stdtest/stdtest.rc b/src/test/stdtest/stdtest.rc index ab455001b61..5bce1659179 100644 --- a/src/test/stdtest/stdtest.rc +++ b/src/test/stdtest/stdtest.rc @@ -2,6 +2,7 @@ use std; mod sha1; mod int; +mod test; // Local Variables: // mode: rust // fill-column: 78; diff --git a/src/test/stdtest/test.rs b/src/test/stdtest/test.rs new file mode 100644 index 00000000000..17f18a5151e --- /dev/null +++ b/src/test/stdtest/test.rs @@ -0,0 +1,36 @@ +import std::test; + +#[test] +fn do_not_run_ignored_tests() { + auto ran = @mutable false; + auto f = bind fn(@mutable bool ran) { + *ran = true; + } (ran); + + auto desc = rec(name = "whatever", + fn = f, + ignore = true); + + auto res = test::run_test(desc); + + assert ran == false; +} + +#[test] +fn ignored_tests_result_in_ignored() { + fn f() { } + auto desc = rec(name = "whatever", + fn = f, + ignore = true); + auto res = test::run_test(desc); + assert res == test::tr_ignored; +} + +// Local Variables: +// mode: rust; +// fill-column: 78; +// indent-tabs-mode: nil +// c-basic-offset: 4 +// buffer-file-coding-system: utf-8-unix +// compile-command: "make -k -C .. 2>&1 | sed -e 's/\\/x\\//x:\\//g'"; +// End: |
