From: Joel Rosdahl Date: Sat, 27 Aug 2022 18:04:26 +0000 (+0200) Subject: test: Disable "output file failure" test for unsupported filesystem X-Git-Tag: v4.7~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=553fc98f846bf6de1566e8526f4a779b70d814c8;p=thirdparty%2Fccache.git test: Disable "output file failure" test for unsupported filesystem The "Failure to write output file" test assumes that the filesystem supports read-only directories. Improve this by probing this assumption before running the test. Fixes #1150. --- diff --git a/test/suites/base.bash b/test/suites/base.bash index 12b874f30..9b53237eb 100644 --- a/test/suites/base.bash +++ b/test/suites/base.bash @@ -1194,22 +1194,27 @@ EOF expect_stat cache_miss 1 # ------------------------------------------------------------------------- - TEST "Failure to write output file" mkdir dir + chmod a-w dir + if ! touch dir/test 2>/dev/null; then + TEST "Failure to write output file" - $CCACHE_COMPILE -c test1.c -o dir/test1.o - expect_stat preprocessed_cache_hit 0 - expect_stat cache_miss 1 - expect_stat bad_output_file 0 + mkdir dir - rm dir/test1.o - chmod a-w dir + $CCACHE_COMPILE -c test1.c -o dir/test1.o + expect_stat preprocessed_cache_hit 0 + expect_stat cache_miss 1 + expect_stat bad_output_file 0 - $CCACHE_COMPILE -c test1.c -o dir/test1.o 2>/dev/null - expect_stat preprocessed_cache_hit 0 - expect_stat cache_miss 1 - expect_stat bad_output_file 1 + rm dir/test1.o + chmod a-w dir + + $CCACHE_COMPILE -c test1.c -o dir/test1.o 2>/dev/null + expect_stat preprocessed_cache_hit 0 + expect_stat cache_miss 1 + expect_stat bad_output_file 1 + fi # ------------------------------------------------------------------------- TEST "Caching stderr"