checkstat 'cache hit (direct)' 0
checkstat 'cache hit (preprocessed)' 0
checkstat 'cache miss' 1
- checkfile other.d "test.o: test.c test1.h test3.h test2.h"
+ checkfile other.d "$expected_d_content"
+ CCACHE_DISABLE=1 $COMPILER -c -Wp,-MD,other.d test.c -o reference_test.o
+ compare_file reference_test.o test.o
rm -f other.d
checkstat 'cache hit (direct)' 1
checkstat 'cache hit (preprocessed)' 0
checkstat 'cache miss' 1
- checkfile other.d "test.o: test.c test1.h test3.h test2.h"
+ checkfile other.d "$expected_d_content"
+ compare_file reference_test.o test.o
rm -f other.d
checkstat 'cache hit (direct)' 0
checkstat 'cache hit (preprocessed)' 0
checkstat 'cache miss' 1
- checkfile other.d "test.o: test.c test1.h test3.h test2.h"
+ checkfile other.d "$expected_d_content"
+ CCACHE_DISABLE=1 $COMPILER -c -Wp,-MMD,other.d test.c -o reference_test.o
+ compare_file reference_test.o test.o
rm -f other.d
checkstat 'cache hit (direct)' 1
checkstat 'cache hit (preprocessed)' 0
checkstat 'cache miss' 1
- checkfile other.d "test.o: test.c test1.h test3.h test2.h"
+ checkfile other.d "$expected_d_content"
+ compare_file reference_test.o test.o
rm -f other.d
checkstat 'cache hit (direct)' 0
checkstat 'cache hit (preprocessed)' 0
checkstat 'cache miss' 1
- checkfile test.d "test.o: test.c test1.h test3.h test2.h"
+ checkfile test.d "$expected_d_content"
+ CCACHE_DISABLE=1 $COMPILER -c -MD test.c -o reference_test.o
+ compare_file reference_test.o test.o
rm -f test.d
checkstat 'cache hit (direct)' 1
checkstat 'cache hit (preprocessed)' 0
checkstat 'cache miss' 1
- checkfile test.d "test.o: test.c test1.h test3.h test2.h"
+ checkfile test.d "$expected_d_content"
+ compare_file reference_test.o test.o
##################################################################
# Check the scenario of running a ccache with direct mode on a cache
checkstat 'cache hit (direct)' 0
checkstat 'cache hit (preprocessed)' 0
checkstat 'cache miss' 1
- checkfile test.d "test.o: test.c test1.h test3.h test2.h"
+ checkfile test.d "$expected_d_content"
+ CCACHE_DISABLE=1 $COMPILER -c -MD test.c -o reference_test.o
+ compare_file reference_test.o test.o
rm -f test.d
checkstat 'cache hit (direct)' 0
checkstat 'cache hit (preprocessed)' 1
checkstat 'cache miss' 1
- checkfile test.d "test.o: test.c test1.h test3.h test2.h"
+ checkfile test.d "$expected_d_content"
+ compare_file reference_test.o test.o
rm -f test.d
checkstat 'cache hit (direct)' 0
checkstat 'cache hit (preprocessed)' 2
checkstat 'cache miss' 1
- checkfile test.d "test.o: test.c test1.h test3.h test2.h"
+ checkfile test.d "$expected_d_content"
+ compare_file reference_test.o test.o
rm -f test.d
checkstat 'cache hit (direct)' 1
checkstat 'cache hit (preprocessed)' 2
checkstat 'cache miss' 1
- checkfile test.d "test.o: test.c test1.h test3.h test2.h"
+ checkfile test.d "$expected_d_content"
+ compare_file reference_test.o test.o
##################################################################
# Check that -MF works.
checkstat 'cache hit (direct)' 0
checkstat 'cache hit (preprocessed)' 0
checkstat 'cache miss' 1
- checkfile other.d "test.o: test.c test1.h test3.h test2.h"
+ checkfile other.d "$expected_d_content"
+ CCACHE_DISABLE=1 $COMPILER -c -MD -MF other.d test.c -o reference_test.o
+ compare_file reference_test.o test.o
rm -f other.d
checkstat 'cache hit (direct)' 1
checkstat 'cache hit (preprocessed)' 0
checkstat 'cache miss' 1
- checkfile other.d "test.o: test.c test1.h test3.h test2.h"
+ checkfile other.d "$expected_d_content"
+ compare_file reference_test.o test.o
##################################################################
# Check that a missing .d file in the cache is handled correctly.
checkstat 'cache hit (direct)' 0
checkstat 'cache hit (preprocessed)' 0
checkstat 'cache miss' 1
- checkfile other.d "test.o: test.c test1.h test3.h test2.h"
+ checkfile other.d "$expected_d_content"
+ CCACHE_DISABLE=1 $COMPILER -c -MD test.c -o reference_test.o
+ compare_file reference_test.o test.o
$CCACHE $COMPILER -c -MD test.c
checkstat 'cache hit (direct)' 1
checkstat 'cache hit (preprocessed)' 0
checkstat 'cache miss' 1
- checkfile other.d "test.o: test.c test1.h test3.h test2.h"
+ checkfile other.d "$expected_d_content"
+ compare_file reference_test.o test.o
find $CCACHE_DIR -name '*.d' -exec rm -f '{}' \;
checkstat 'cache hit (direct)' 1
checkstat 'cache hit (preprocessed)' 1
checkstat 'cache miss' 1
- checkfile other.d "test.o: test.c test1.h test3.h test2.h"
+ checkfile other.d "$expected_d_content"
+ compare_file reference_test.o test.o
##################################################################
# Check that stderr from both the preprocessor and the compiler is emitted