From: Joel Rosdahl Date: Sat, 22 Feb 2020 16:37:22 +0000 (+0100) Subject: Don’t increment STATS_COMPILER on fatal error X-Git-Tag: v4.0~610 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=458793e46a15016a63e0fb0e799ba0067196ca60;p=thirdparty%2Fccache.git Don’t increment STATS_COMPILER on fatal error Statistics counters are otherwise never incremented on fatal errors. --- diff --git a/src/ccache.cpp b/src/ccache.cpp index c93756196..35db7cc94 100644 --- a/src/ccache.cpp +++ b/src/ccache.cpp @@ -2147,7 +2147,6 @@ find_compiler(Context& ctx, char** argv) char* compiler = find_executable(ctx, base.c_str(), MYNAME); if (!compiler) { - stats_update(ctx, STATS_COMPILER); fatal("Could not find compiler \"%s\" in PATH", base.c_str()); } if (str_eq(compiler, argv[0])) { diff --git a/test/suites/base.bash b/test/suites/base.bash index 4f5ea648e..f3dc8f262 100644 --- a/test/suites/base.bash +++ b/test/suites/base.bash @@ -97,7 +97,10 @@ base_tests() { TEST "Couldn't find the compiler" $CCACHE blahblah -c test1.c 2>/dev/null - expect_stat "couldn't find the compiler" 1 + exit_code=$? + if [ $exit_code -ne 1 ]; then + test_failed "Expected exit code to be 1, actual value $exit_code" + fi # ------------------------------------------------------------------------- TEST "Bad compiler arguments"