Change the exit status used for valgrind errors and check for it in tests

This commit is contained in:
Brian Anderson 2011-09-08 13:28:03 -07:00
parent a1131748c2
commit f1e348ce6a
3 changed files with 3 additions and 7 deletions

View File

@ -114,7 +114,7 @@ ifdef CFG_UNIXY
endif
ifdef CFG_VALGRIND
CFG_VALGRIND += --leak-check=full \
--error-exitcode=1 \
--error-exitcode=100 \
--quiet --suppressions=$(CFG_SRC_DIR)src/etc/x86.supp
endif
endif

View File

@ -66,7 +66,7 @@ fn run(handle: &handle, lib_path: &str, prog: &str, args: &[str],
writeclose(resp.infd, input);
let output = readclose(resp.outfd);
let errput = readclose(resp.errfd);
let status = os::waitpid(resp.pid);
let status = run::waitpid(resp.pid);
ret {status: status, out: output, err: errput};
}

View File

@ -55,11 +55,7 @@ fn run_rfail_test(cx: &cx, props: &test_props, testfile: &str) {
fatal_procres("run-fail test didn't produce an error!", procres);
}
// This is the value valgrind returns on failure
// FIXME: Why is this value neither the value we pass to
// valgrind as --error-exitcode (1), nor the value we see as the
// exit code on the command-line (137)?
const valgrind_err: int = 9;
const valgrind_err: int = 100;
if procres.status == valgrind_err {
fatal_procres("run-fail test isn't valgrind-clean!", procres);
}