From 77c987b7f93f71d3cca198e60538c7a75d7d11ab Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Sun, 4 Mar 2012 17:28:24 -0800 Subject: [PATCH] Valgrind returns a different error for invalid binary. --- libtest/unittest.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libtest/unittest.cc b/libtest/unittest.cc index bffa4ecb..9945e386 100644 --- a/libtest/unittest.cc +++ b/libtest/unittest.cc @@ -363,7 +363,15 @@ static test_return_t application_doesnotexist_BINARY(void *) const char *args[]= { "--fubar", 0 }; test_compare(Application::SUCCESS, true_app.run(args)); - test_compare(Application::INVALID, true_app.wait()); + // Behavior is different if we are running under valgrind + if (getenv("TESTS_ENVIRONMENT") and strstr(getenv("TESTS_ENVIRONMENT"), "valgrind")) + { + test_compare(Application::FAILURE, true_app.wait()); + } + else + { + test_compare(Application::INVALID, true_app.wait()); + } test_compare(0, true_app.stdout_result().size()); return TEST_SUCCESS; -- 2.30.2