]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Add test for rewriting of absolute dependency arguments
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 29 Jul 2012 20:53:20 +0000 (22:53 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 29 Jul 2012 21:14:40 +0000 (23:14 +0200)
test.sh

diff --git a/test.sh b/test.sh
index eb32b9d00f47fdc9af3a7096012d505d44a18093..372c1889c50cb1c33636ceec37af0aee43b41a98 100755 (executable)
--- 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() {