From 766dcf1a2719828ac0be3f2ad688a6f623c5a9dc Mon Sep 17 00:00:00 2001 From: Felix Crux Date: Wed, 26 Feb 2014 20:27:30 -0500 Subject: [PATCH] Provide a more helpful error for tests that fail due to noexec The rustdoc tests create and execute a file in a temporary directory. By default on UNIX-like platforms this is in `/tmp`, which some users mount with the `noexec` option. In those cases, the tests fail in a mysterious way. This change adds a note that suggests what the problem might be, if the error looks like it could have been caused by the `noexec` setup. Closes #12558 --- src/librustdoc/test.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index ae22d9c84dccc..ab90b27a0dee3 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -9,6 +9,7 @@ // except according to those terms. use std::cell::RefCell; +use std::io; use std::io::Process; use std::local_data; use std::os; @@ -128,7 +129,10 @@ fn runtest(test: &str, cratename: &str, libs: HashSet, should_fail: bool) let exe = outdir.path().join("rust_out"); let out = Process::output(exe.as_str().unwrap(), []); match out { - Err(e) => fail!("couldn't run the test: {}", e), + Err(e) => fail!("couldn't run the test: {}{}", e, + if e.kind == io::PermissionDenied { + " - maybe your tempdir is mounted with noexec?" + } else { "" }), Ok(out) => { if should_fail && out.status.success() { fail!("test executable succeeded when it should have failed");