diff options
author | Joel Rosdahl <joel@rosdahl.net> | 2010-01-05 20:43:18 +0100 |
---|---|---|
committer | Joel Rosdahl <joel@rosdahl.net> | 2010-01-06 22:23:10 +0100 |
commit | 42273c937f72802ad3b21abcd8886b5d5012368c (patch) | |
tree | c0e6bdbf674d55ed3a773c8c9aa2c2197485bf28 /test.sh | |
parent | f98719bc9048dc72072c55cd5b5432493cc8a3b1 (diff) | |
download | ccache-42273c937f72802ad3b21abcd8886b5d5012368c.tar.gz |
Let compressed files get different hash sums than uncompressed
This is to avoid problems when older ccache versions (without compression
support) access the cache.
Diffstat (limited to 'test.sh')
-rwxr-xr-x | test.sh | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -792,6 +792,40 @@ EOF fi } +compression_suite() { + rm -rf $CCACHE_DIR + + ################################################################## + # Create some code to compile. + cat <<EOF >test.c +int test; +EOF + + ################################################################## + # Check that compressed and uncompressed files get different hash sums in + # order to maintain forward compatibility of previous ccache versions. + testname="compression hash sum" + $CCACHE $COMPILER -c test.c + checkstat 'cache hit (direct)' 0 + checkstat 'cache hit (preprocessed)' 0 + checkstat 'cache miss' 1 + + $CCACHE $COMPILER -c test.c + checkstat 'cache hit (direct)' 0 + checkstat 'cache hit (preprocessed)' 1 + checkstat 'cache miss' 1 + + CCACHE_NOCOMPRESS=1 $CCACHE $COMPILER -c test.c + checkstat 'cache hit (direct)' 0 + checkstat 'cache hit (preprocessed)' 1 + checkstat 'cache miss' 2 + + CCACHE_NOCOMPRESS=1 $CCACHE $COMPILER -c test.c + checkstat 'cache hit (direct)' 0 + checkstat 'cache hit (preprocessed)' 2 + checkstat 'cache miss' 2 +} + ###################################################################### # main program @@ -820,6 +854,7 @@ nlevels4 nlevels1 direct basedir +compression " if [ -z "$suites" ]; then |