From: Joel Rosdahl Date: Sat, 25 Mar 2017 20:23:06 +0000 (+0100) Subject: Add test for directory in ignore_headers_in_manifest X-Git-Tag: v3.3.5~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5effc8a5c33b1c6769f5def538489a4a0fe1a5b;p=thirdparty%2Fccache.git Add test for directory in ignore_headers_in_manifest I should have added this test in a61d0f24 – that would have prevented issue #165. --- diff --git a/test.sh b/test.sh index 89642e2b8..ea76e20d4 100755 --- a/test.sh +++ b/test.sh @@ -2257,20 +2257,41 @@ EOF expect_stat 'cache miss' 2 # ------------------------------------------------------------------------- - TEST "CCACHE_IGNOREHEADERS" + TEST "CCACHE_IGNOREHEADERS with filename" - cat <ignore.h + mkdir subdir + cat <subdir/ignore.h // We don't want this header in the manifest. EOF - backdate ignore.h + backdate subdir/ignore.h cat <ignore.c -#include "ignore.h" +#include "subdir/ignore.h" int foo; EOF - CCACHE_IGNOREHEADERS="ignore.h" $CCACHE_COMPILE -c ignore.c + CCACHE_IGNOREHEADERS="subdir/ignore.h" $CCACHE_COMPILE -c ignore.c manifest=`find $CCACHE_DIR -name '*.manifest'` - data="`$CCACHE --dump-manifest $manifest | grep ignore.h`" + data="`$CCACHE --dump-manifest $manifest | grep subdir/ignore.h`" + if [ -n "$data" ]; then + test_failed "$manifest contained ignored header: $data" + fi + + # ------------------------------------------------------------------------- + TEST "CCACHE_IGNOREHEADERS with directory" + + mkdir subdir + cat <subdir/ignore.h +// We don't want this header in the manifest. +EOF + backdate subdir/ignore.h + cat <ignore.c +#include "subdir/ignore.h" +int foo; +EOF + + CCACHE_IGNOREHEADERS="subdir" $CCACHE_COMPILE -c ignore.c + manifest=`find $CCACHE_DIR -name '*.manifest'` + data="`$CCACHE --dump-manifest $manifest | grep subdir/ignore.h`" if [ -n "$data" ]; then test_failed "$manifest contained ignored header: $data" fi