From c5effc8a5c33b1c6769f5def538489a4a0fe1a5b Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Sat, 25 Mar 2017 21:23:06 +0100 Subject: [PATCH] Add test for directory in ignore_headers_in_manifest MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit I should have added this test in a61d0f24 – that would have prevented issue #165. --- test.sh | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) 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 -- 2.47.2