]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
test: Check that device paths (and similar) are not stored in the manifest
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 2 Nov 2010 22:49:21 +0000 (23:49 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 3 Nov 2010 07:05:24 +0000 (08:05 +0100)
test.sh

diff --git a/test.sh b/test.sh
index 290830ba038b3c92e10793cc66cff9cd3fbe0ddf..c62a67169a41dcee44e3bdccaee409ac11f84867 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -1156,6 +1156,28 @@ EOF
     checkstat 'cache hit (direct)' 1
     checkstat 'cache hit (preprocessed)' 0
     checkstat 'cache miss' 1
+
+    ##################################################################
+    # Check that strange "#line" directives are handled.
+    testname="#line directives with troublesome files"
+    $CCACHE -Cz >/dev/null
+    cat <<EOF >strange.c
+int foo;
+EOF
+    for x in stdout tty sda hda; do
+        if [ -e /dev/$x ]; then
+            echo "#line 1 \"/dev/$x\"" >> strange.c
+        fi
+    done
+    CCACHE_SLOPPINESS=include_file_mtime $CCACHE $COMPILER -c strange.c
+    manifest=$(find $CCACHE_DIR -name '*.manifest')
+    if [ -n "$manifest" ]; then
+        data="$($CCACHE --dump-manifest $manifest | egrep '/dev/(stdout|tty|sda|hda)')"
+        if [ -n "$data" ]; then
+            test_failed "$manifest contained troublesome file(s): $data"
+        fi
+    fi
+    exit
 }
 
 basedir_suite() {