]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Fix color_diagnostics test failure if CCACHE_DIR is set in shell rc file
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 24 Jun 2020 07:26:23 +0000 (09:26 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 24 Jun 2020 07:26:23 +0000 (09:26 +0200)
If the user sets CCACHE_DIR in a shell startup file then that value will
override the one from the test suite, thus making changes in cache
statistics invisible which triggers failures.

test/suites/color_diagnostics.bash

index 550990488055e28d33677fd64928ac49f4cf5da2..60254a1865aa837c9c560cc8f0f275814bbbc005 100644 (file)
@@ -66,7 +66,7 @@ color_diagnostics_generate_permutations() {
 }
 
 color_diagnostics_run_on_pty() {
-    script --return --quiet --command "unset GCC_COLORS; ${1:?}" /dev/null </dev/null
+    script --return --quiet --command "unset GCC_COLORS; CCACHE_DIR='$CCACHE_DIR' ${1:?}" /dev/null </dev/null
 }
 
 color_diagnostics_test() {