diff options
| author | Nick Desaulniers <ndesaulniers@mozilla.com> | 2013-01-31 17:51:01 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-01-31 20:12:49 -0800 |
| commit | aee79294699153ac7da9d2e5d076192c6eee3238 (patch) | |
| tree | 18e14a0fcfddad87b2a2955e7821bb4c63acbbfa /src/compiletest | |
| parent | 2db3175c76b51e5124cfa135de7ceeea8ceee0d6 (diff) | |
Replace most invocations of fail keyword with die! macro
Diffstat (limited to 'src/compiletest')
| -rw-r--r-- | src/compiletest/compiletest.rc | 6 | ||||
| -rw-r--r-- | src/compiletest/header.rs | 2 | ||||
| -rw-r--r-- | src/compiletest/procsrv.rs | 4 | ||||
| -rw-r--r-- | src/compiletest/runtest.rs | 8 |
4 files changed, 10 insertions, 10 deletions
diff --git a/src/compiletest/compiletest.rc b/src/compiletest/compiletest.rc index 4f9c86b70f0..8f5f9547c52 100644 --- a/src/compiletest/compiletest.rc +++ b/src/compiletest/compiletest.rc @@ -69,7 +69,7 @@ pub fn parse_config(args: ~[~str]) -> config { let matches = &match getopts::getopts(args_, opts) { Ok(m) => m, - Err(f) => fail getopts::fail_str(f) + Err(f) => die!(getopts::fail_str(f)) }; fn opt_path(m: &getopts::Matches, nm: ~str) -> Path { @@ -131,7 +131,7 @@ pub fn str_mode(s: ~str) -> mode { ~"run-fail" => mode_run_fail, ~"run-pass" => mode_run_pass, ~"pretty" => mode_pretty, - _ => fail ~"invalid mode" + _ => die!(~"invalid mode") } } @@ -148,7 +148,7 @@ pub fn run_tests(config: config) { let opts = test_opts(config); let tests = make_tests(config); let res = test::run_tests_console(&opts, tests); - if !res { fail ~"Some tests failed"; } + if !res { die!(~"Some tests failed"); } } pub fn test_opts(config: config) -> test::TestOpts { diff --git a/src/compiletest/header.rs b/src/compiletest/header.rs index 64192e523db..0b9d67426ae 100644 --- a/src/compiletest/header.rs +++ b/src/compiletest/header.rs @@ -119,7 +119,7 @@ fn parse_exec_env(line: ~str) -> Option<(~str, ~str)> { match strs.len() { 1u => (strs[0], ~""), 2u => (strs[0], strs[1]), - n => fail fmt!("Expected 1 or 2 strings, not %u", n) + n => die!(fmt!("Expected 1 or 2 strings, not %u", n)) } } } diff --git a/src/compiletest/procsrv.rs b/src/compiletest/procsrv.rs index 8e575ca36f6..a8e4d91d89a 100644 --- a/src/compiletest/procsrv.rs +++ b/src/compiletest/procsrv.rs @@ -71,7 +71,7 @@ pub fn run(lib_path: ~str, os::close(pipe_in.out); os::close(pipe_out.in); os::close(pipe_err.in); - fail; + die!(); } @@ -99,7 +99,7 @@ pub fn run(lib_path: ~str, (2, s) => { errs = s; } - _ => { fail } + _ => { die!() } }; count -= 1; }; diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index e9c37115c49..a71b8a360a2 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -200,7 +200,7 @@ actual:\n\ \n", expected, actual); io::stdout().write_str(msg); - fail; + die!(); } } @@ -467,7 +467,7 @@ fn compose_and_run_compiler( fn ensure_dir(path: &Path) { if os::path_is_dir(path) { return; } if !os::make_dir(path, 0x1c0i32) { - fail fmt!("can't make dir %s", path.to_str()); + die!(fmt!("can't make dir %s", path.to_str())); } } @@ -617,7 +617,7 @@ fn maybe_dump_to_stdout(config: config, out: ~str, err: ~str) { fn error(err: ~str) { io::stdout().write_line(fmt!("\nerror: %s", err)); } -fn fatal(err: ~str) -> ! { error(err); fail; } +fn fatal(err: ~str) -> ! { error(err); die!(); } fn fatal_ProcRes(err: ~str, ProcRes: ProcRes) -> ! { let msg = @@ -635,5 +635,5 @@ stderr:\n\ \n", err, ProcRes.cmdline, ProcRes.stdout, ProcRes.stderr); io::stdout().write_str(msg); - fail; + die!(); } |
