]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
test: New attempt at coping with unsynchronized clocks for new include file
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 21 Nov 2010 16:06:09 +0000 (17:06 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 21 Nov 2010 16:06:09 +0000 (17:06 +0100)
test.sh

diff --git a/test.sh b/test.sh
index d4c6911f229b89be744a615aad664dc202127520..0558e4a7b2d5313b577da8990a17f53bd8fefddc 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -1109,21 +1109,12 @@ EOF
     cat <<EOF >new.h
 int test;
 EOF
-    touchy_compiler=touchy-compiler.sh
-    cat <<EOF >$touchy_compiler
-#!/bin/sh
-CCACHE_DISABLE=1 # If $COMPILER happens to be a ccache symlink...
-export CCACHE_DISABLE
-[ x\$2 = "x-E" ] && touch -t `date +%Y%m%d%H%M.%S` new.h # Be sure that mtime >= time_of_compilation
-exec $COMPILER "\$@"
-EOF
-    chmod +x $touchy_compiler
-
-    $CCACHE ./$touchy_compiler -c new.c
+    touch -t 203801010000 new.h
+    $CCACHE $COMPILER -c new.c
     checkstat 'cache hit (direct)' 0
     checkstat 'cache hit (preprocessed)' 0
     checkstat 'cache miss' 1
-    $CCACHE ./$touchy_compiler -c new.c
+    $CCACHE $COMPILER -c new.c
     checkstat 'cache hit (direct)' 0
     checkstat 'cache hit (preprocessed)' 1
     checkstat 'cache miss' 1
@@ -1138,21 +1129,12 @@ EOF
     cat <<EOF >new.h
 int test;
 EOF
-    touchy_compiler=touchy-compiler.sh
-    cat <<EOF >$touchy_compiler
-#!/bin/sh
-CCACHE_DISABLE=1 # If $COMPILER happens to be a ccache symlink...
-export CCACHE_DISABLE
-[ x\$2 = "x-E" ] && touch -t `date +%Y%m%d%H%M.%S` new.h # Be sure that mtime >= time_of_compilation
-exec $COMPILER "\$@"
-EOF
-    chmod +x $touchy_compiler
-
-    CCACHE_SLOPPINESS=include_file_mtime $CCACHE ./$touchy_compiler -c new.c
+    touch -t 203801010000 new.h
+    CCACHE_SLOPPINESS=include_file_mtime $CCACHE $COMPILER -c new.c
     checkstat 'cache hit (direct)' 0
     checkstat 'cache hit (preprocessed)' 0
     checkstat 'cache miss' 1
-    CCACHE_SLOPPINESS=include_file_mtime $CCACHE ./$touchy_compiler -c new.c
+    CCACHE_SLOPPINESS=include_file_mtime $CCACHE $COMPILER -c new.c
     checkstat 'cache hit (direct)' 1
     checkstat 'cache hit (preprocessed)' 0
     checkstat 'cache miss' 1