]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Fix --dump-manifest test instability in newer GCC versions
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 23 Sep 2013 12:42:40 +0000 (14:42 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 23 Sep 2013 18:49:23 +0000 (20:49 +0200)
test.sh

diff --git a/test.sh b/test.sh
index f5a10d08e5963bd8b9cfcbf1ab84a6196eb1bf38..5e042b4dbe278f12ed21d54a95808ad67b610f51 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -1367,83 +1367,12 @@ EOF
     $CCACHE -Cz >/dev/null
     $CCACHE $COMPILER test.c -c -o test.o
     manifest=`find $CCACHE_DIR -name '*.manifest'`
-    $CCACHE --dump-manifest $manifest |
-        perl -ape 's/:.*/: normalized/ if ($F[0] =~ "(Mtime|Ctime):") or ($F[0] =~ "(Hash|Size):" and ++$n > 6)' \
-        >manifest.dump
-    if [ $COMPILER_TYPE_CLANG -eq 1 ]; then
-        cat <<EOF >expected.dump
-Magic: cCmF
-Version: 1
-Hash size: 16
-Reserved field: 0
-File paths (3):
-  0: ./test3.h
-  1: ./test1.h
-  2: ./test2.h
-File infos (3):
-  0:
-    Path index: 0
-    Hash: c2f5392dbc7e8ff6138d01608445240a
-    Size: 24
-    Mtime: normalized
-    Ctime: normalized
-  1:
-    Path index: 1
-    Hash: e6b009695d072974f2c4d1dd7e7ed4fc
-    Size: 95
-    Mtime: normalized
-    Ctime: normalized
-  2:
-    Path index: 2
-    Hash: e94ceb9f1b196c387d098a5f1f4fe862
-    Size: 11
-    Mtime: normalized
-    Ctime: normalized
-Results (1):
-  0:
-    File hash indexes: 0 1 2
-    Hash: normalized
-    Size: normalized
-EOF
-    else
-        cat <<EOF >expected.dump
-Magic: cCmF
-Version: 1
-Hash size: 16
-Reserved field: 0
-File paths (3):
-  0: test2.h
-  1: test3.h
-  2: test1.h
-File infos (3):
-  0:
-    Path index: 0
-    Hash: e94ceb9f1b196c387d098a5f1f4fe862
-    Size: 11
-    Mtime: normalized
-    Ctime: normalized
-  1:
-    Path index: 1
-    Hash: c2f5392dbc7e8ff6138d01608445240a
-    Size: 24
-    Mtime: normalized
-    Ctime: normalized
-  2:
-    Path index: 2
-    Hash: e6b009695d072974f2c4d1dd7e7ed4fc
-    Size: 95
-    Mtime: normalized
-    Ctime: normalized
-Results (1):
-  0:
-    File hash indexes: 0 1 2
-    Hash: normalized
-    Size: normalized
-EOF
-    fi
+    $CCACHE --dump-manifest $manifest >manifest.dump
 
-    if diff expected.dump manifest.dump; then
-        :
+    if grep 'Hash: e6b009695d072974f2c4d1dd7e7ed4fc' manifest.dump >/dev/null 2>&1 && \
+       grep 'Hash: e94ceb9f1b196c387d098a5f1f4fe862' manifest.dump >/dev/null 2>&1 && \
+       grep 'Hash: c2f5392dbc7e8ff6138d01608445240a' manifest.dump >/dev/null 2>&1; then
+        : OK
     else
         test_failed "unexpected output of --dump-manifest"
     fi