put_result_in_manifest = true;
}
- ctx.storage.primary.increment_statistic(Statistic::direct_cache_miss);
+ if (!ctx.config.recache()) {
+ ctx.storage.primary.increment_statistic(Statistic::direct_cache_miss);
+ }
}
if (ctx.config.read_only_direct()) {
expect_stat secondary_storage_hit 2
expect_stat secondary_storage_miss 2
expect_file_count 3 '*' secondary # CACHEDIR.TAG + result + manifest
+
+ # -------------------------------------------------------------------------
+ TEST "Recache"
+
+ CCACHE_RECACHE=1 $CCACHE_COMPILE -c test.c
+ expect_stat direct_cache_hit 0
+ expect_stat direct_cache_miss 0
+ expect_stat cache_miss 0
+ expect_stat recache 1
+ expect_stat files_in_cache 2
+ expect_stat primary_storage_hit 0
+ expect_stat primary_storage_miss 1 # Try to read manifest for updating
+ expect_stat secondary_storage_hit 0
+ expect_stat secondary_storage_miss 1 # Try to read manifest for updating
+ expect_file_count 3 '*' secondary # CACHEDIR.TAG + result + manifest
+
+ $CCACHE -C >/dev/null
+ expect_stat files_in_cache 0
+ expect_file_count 3 '*' secondary # CACHEDIR.TAG + result + manifest
+
+ CCACHE_RECACHE=1 $CCACHE_COMPILE -c test.c
+ expect_stat direct_cache_hit 0
+ expect_stat direct_cache_miss 0
+ expect_stat cache_miss 0
+ expect_stat recache 2
+ expect_stat files_in_cache 2
+ expect_stat primary_storage_hit 0
+ expect_stat primary_storage_miss 2 # Try to read manifest for updating
+ expect_stat secondary_storage_hit 1 # Read manifest for updating
+ expect_stat secondary_storage_miss 1
}