From: Joel Rosdahl Date: Sun, 29 Jul 2012 20:53:20 +0000 (+0200) Subject: Add test for rewriting of absolute dependency arguments X-Git-Tag: v3.1.8~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a363cf917680c4a6c078f835a826c88ff50b8781;p=thirdparty%2Fccache.git Add test for rewriting of absolute dependency arguments --- diff --git a/test.sh b/test.sh index eb32b9d00..372c1889c 100755 --- a/test.sh +++ b/test.sh @@ -1324,6 +1324,27 @@ EOF if grep `pwd` stderr.txt >/dev/null 2>&1; then test_failed "Base dir (`pwd`) found in stderr:\n`cat stderr.txt`" fi + + ################################################################## + # Check that -MF, -MQ and -MT arguments with absolute paths are rewritten + # to relative. + testname="-MF/-MQ/-MT with absolute paths" + for option in MF "MF " MQ "MQ " MT "MT "; do + $CCACHE -Cz >/dev/null + cd dir1 + CCACHE_BASEDIR="`pwd`" $CCACHE $COMPILER -I`pwd`/include -MD -${option}`pwd`/test.d -c src/test.c + checkstat 'cache hit (direct)' 0 + checkstat 'cache hit (preprocessed)' 0 + checkstat 'cache miss' 1 + cd .. + + cd dir2 + CCACHE_BASEDIR="`pwd`" $CCACHE $COMPILER -I`pwd`/include -MD -${option}`pwd`/test.d -c src/test.c + checkstat 'cache hit (direct)' 1 + checkstat 'cache hit (preprocessed)' 0 + checkstat 'cache miss' 1 + cd .. + done } compression_suite() {