$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