fi
}
-expect_file_exists() {
+expect_exists() {
if [ ! -e "$1" ]; then
test_failed "Expected $1 to exist, but it's missing"
fi
}
-expect_file_missing() {
+expect_missing() {
if [ -e "$1" ]; then
test_failed "Expected $1 to be missing, but it exists"
fi
}
-expect_equal_files() {
+expect_equal_content() {
if [ ! -e "$1" ]; then
- test_failed "expect_equal_files: $1 missing"
+ test_failed "expect_equal_content: $1 missing"
fi
if [ ! -e "$2" ]; then
- test_failed "expect_equal_files: $2 missing"
+ test_failed "expect_equal_content: $2 missing"
fi
if ! cmp -s "$1" "$2"; then
test_failed "$1 and $2 differ"
fi
}
-expect_equal_text_files() {
+expect_equal_text_content() {
if [ ! -e "$1" ]; then
- test_failed "expect_equal_files: $1 missing"
+ test_failed "expect_equal_text_content: $1 missing"
fi
if [ ! -e "$2" ]; then
- test_failed "expect_equal_files: $2 missing"
+ test_failed "expect_equal_text_content: $2 missing"
fi
if ! cmp -s "$1" "$2"; then
test_failed "$1 and $2 differ: $(echo; diff -u "$1" "$2")"
fi
}
-expect_different_files() {
+expect_different_content() {
if [ ! -e "$1" ]; then
- test_failed "expect_different_files: $1 missing"
+ test_failed "expect_different_content: $1 missing"
fi
if [ ! -e "$2" ]; then
- test_failed "expect_different_files: $2 missing"
+ test_failed "expect_different_content: $2 missing"
fi
if cmp -s "$1" "$2"; then
test_failed "$1 and $2 are identical"
fi
}
-expect_file_content() {
+expect_content() {
local file="$1"
local content="$2"
fi
}
-expect_file_contains() {
+expect_contains() {
local file="$1"
local string="$2"
fi
}
-expect_file_not_contains() {
+expect_not_contains() {
local file="$1"
local string="$2"
}
# Verify that $1 is newer than (or same age as) $2.
-expect_file_newer_than() {
+expect_newer_than() {
local newer_file=$1
local older_file=$2
if [ "$newer_file" -ot "$older_file" ]; then
$CCACHE_COMPILE -c test1.c -o out/foo.o 2>/dev/null
expect_stat 'could not write to output file' 1
expect_stat 'cache miss' 1
- expect_file_missing out/foo.o
+ expect_missing out/foo.o
# -------------------------------------------------------------------------
TEST "No input file"
$CCACHE_COMPILE -x c -c src/foo
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_file_exists foo.o
+ expect_exists foo.o
rm foo.o
$CCACHE_COMPILE -x c -c src/foo
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 1
- expect_file_exists foo.o
+ expect_exists foo.o
rm foo.o
rm -rf src
$CCACHE_COMPILE -x c -c src/foo.
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_file_exists foo.o
+ expect_exists foo.o
rm foo.o
$CCACHE_COMPILE -x c -c src/foo.
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 1
- expect_file_exists foo.o
+ expect_exists foo.o
rm foo.o
rm -rf src
$CCACHE_COMPILE -c src/foo.c.c
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_file_exists foo.c.o
+ expect_exists foo.c.o
rm foo.c.o
$CCACHE_COMPILE -c src/foo.c.c
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 1
- expect_file_exists foo.c.o
+ expect_exists foo.c.o
rm foo.c.o
rm -rf src
expect_stat 'cache miss' 5
$CCACHE_COMPILE -c test1.c
expect_stat 'cache miss' 6
- expect_file_contains "$stats_file" 101
- expect_file_newer_than "$stats_file" "$CCACHE_DIR/timestamp_reference"
+ expect_contains "$stats_file" 101
+ expect_newer_than "$stats_file" "$CCACHE_DIR/timestamp_reference"
# -------------------------------------------------------------------------
TEST "CCACHE_RECACHE"
expect_stat 'cache hit (direct)' 0
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_file_content prefix.result "a
+ expect_content prefix.result "a
b"
PATH=.:$PATH CCACHE_PREFIX="prefix-a prefix-b" $CCACHE_COMPILE -c file.c
expect_stat 'cache hit (direct)' 0
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 1
- expect_file_content prefix.result "a
+ expect_content prefix.result "a
b"
rm -f prefix.result
expect_stat 'cache hit (direct)' 0
expect_stat 'cache hit (preprocessed)' 2
expect_stat 'cache miss' 1
- expect_file_content prefix.result "a
+ expect_content prefix.result "a
b"
# -------------------------------------------------------------------------
EOF
$REAL_COMPILER -c -Wall -W -c stderr.c 2>reference_stderr.txt
$CCACHE_COMPILE -Wall -W -c stderr.c 2>stderr.txt
- expect_equal_files reference_stderr.txt stderr.txt
+ expect_equal_content reference_stderr.txt stderr.txt
# -------------------------------------------------------------------------
TEST "Merging stderr"
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
- expect_file_content stderr "[cc_stderr]"
+ expect_content stderr "[cc_stderr]"
stderr=$(CCACHE_NOCPP2=1 $CCACHE ./compiler.sh -c test1.c 2>stderr)
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 2
expect_stat 'files in cache' 2
- expect_file_content stderr "[cpp_stderr][cc_stderr]"
+ expect_content stderr "[cpp_stderr][cc_stderr]"
# -------------------------------------------------------------------------
TEST "Stderr and dependency file"
$CCACHE_COMPILE -c test.c -MMD 2>test.stderr
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files reference.stderr test.stderr
- expect_equal_files reference.d test.d
+ expect_equal_content reference.stderr test.stderr
+ expect_equal_content reference.d test.d
$CCACHE_COMPILE -c test.c -MMD 2>test.stderr
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 1
- expect_equal_files reference.stderr test.stderr
- expect_equal_files reference.d test.d
+ expect_equal_content reference.stderr test.stderr
+ expect_equal_content reference.d test.d
# -------------------------------------------------------------------------
TEST "--zero-stats"
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
if [ -z "$CCACHE_NOCPP2" ]; then
- expect_file_content compiler.args "[-E test1.c][-c -o test1.o test1.c]"
+ expect_content compiler.args "[-E test1.c][-c -o test1.o test1.c]"
fi
rm compiler.args
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
- expect_file_content compiler.args "[-E test1.c]"
+ expect_content compiler.args "[-E test1.c]"
rm compiler.args
# Even though -Werror is not passed to the preprocessor, it should be part
expect_stat 'cache miss' 2
expect_stat 'files in cache' 2
if [ -z "$CCACHE_NOCPP2" ]; then
- expect_file_content compiler.args "[-E test1.c][-Werror -rdynamic -c -o test1.o test1.c]"
+ expect_content compiler.args "[-E test1.c][-Werror -rdynamic -c -o test1.o test1.c]"
fi
rm compiler.args
for obj in test1.o build/test1.o; do
$CCACHE_COMPILE -c -MMD $src -o $obj
dep=$(echo $obj | sed 's/\.o$/.d/')
- expect_file_content $dep "$obj: $src"
+ expect_content $dep "$obj: $src"
done
done
expect_stat 'cache hit (direct)' 0
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files reference.stderr ccache.stderr
+ expect_equal_content reference.stderr ccache.stderr
CCACHE_ABSSTDERR=1 CCACHE_BASEDIR="$pwd" $CCACHE_COMPILE -c $pwd/test.c 2>ccache.stderr
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files reference.stderr ccache.stderr
+ expect_equal_content reference.stderr ccache.stderr
if $REAL_COMPILER -fdiagnostics-color=always -c test.c 2>/dev/null; then
$REAL_COMPILER -fdiagnostics-color=always -c $pwd/test.c 2>reference.stderr
expect_stat 'cache hit (direct)' 2
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files reference.stderr ccache.stderr
+ expect_equal_content reference.stderr ccache.stderr
CCACHE_ABSSTDERR=1 CCACHE_BASEDIR="$pwd" $CCACHE_COMPILE -fdiagnostics-color=always -c $pwd/test.c 2>ccache.stderr
expect_stat 'cache hit (direct)' 3
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files reference.stderr ccache.stderr
+ expect_equal_content reference.stderr ccache.stderr
fi
}
}
color_diagnostics_expect_color() {
- expect_file_contains "${1:?}" $'\033['
- expect_file_contains <(fgrep 'previous prototype' "$1") $'\033['
- expect_file_contains <(fgrep 'from preprocessor' "$1") $'\033['
+ expect_contains "${1:?}" $'\033['
+ expect_contains <(fgrep 'previous prototype' "$1") $'\033['
+ expect_contains <(fgrep 'from preprocessor' "$1") $'\033['
}
color_diagnostics_expect_no_color() {
- expect_file_not_contains "${1:?}" $'\033['
+ expect_not_contains "${1:?}" $'\033['
}
color_diagnostics_generate_code() {
expect_stat 'cache hit (direct)' 0
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_file_content stderr-orig.txt "`cat stderr-baseline.txt`"
+ expect_content stderr-orig.txt "`cat stderr-baseline.txt`"
CCACHE_DEPEND=1 $CCACHE_COMPILE -MD -Wall -W -c cpp-warning.c 2>stderr-mf.txt
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_file_content stderr-mf.txt "`cat stderr-baseline.txt`"
+ expect_content stderr-mf.txt "`cat stderr-baseline.txt`"
# -------------------------------------------------------------------------
# This test case covers a case in depend mode with unchanged source file
generate_reference_compiler_output
CCACHE_DEPEND=1 CCACHE_BASEDIR=$BASEDIR1 $CCACHE_COMPILE $DEPFLAGS -c test.c
expect_equal_object_files reference_test.o test.o
- expect_equal_files reference_test.d test.d
+ expect_equal_content reference_test.d test.d
expect_stat 'cache hit (direct)' 0
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
generate_reference_compiler_output
CCACHE_DEPEND=1 CCACHE_BASEDIR=$BASEDIR1 $CCACHE_COMPILE $DEPFLAGS -c test.c
expect_equal_object_files reference_test.o test.o
- expect_equal_files reference_test.d test.d
+ expect_equal_content reference_test.d test.d
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
generate_reference_compiler_output
CCACHE_DEPEND=1 CCACHE_BASEDIR=$BASEDIR2 $CCACHE_COMPILE $DEPFLAGS -c test.c
expect_equal_object_files reference_test.o test.o
- expect_equal_files reference_test.d test.d
+ expect_equal_content reference_test.d test.d
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 2
generate_reference_compiler_output
CCACHE_DEPEND=1 CCACHE_BASEDIR=$BASEDIR3 $CCACHE_COMPILE $DEPFLAGS -c test.c
expect_equal_object_files reference_test.o test.o
- expect_equal_files reference_test.d test.d
+ expect_equal_content reference_test.d test.d
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 3
generate_reference_compiler_output
CCACHE_DEPEND=1 CCACHE_BASEDIR=$BASEDIR4 $CCACHE_COMPILE $DEPFLAGS -c test.c
expect_equal_object_files reference_test.o test.o
- expect_equal_files reference_test.d test.d
- expect_different_files reference_test.d $BASEDIR1/test.d
+ expect_equal_content reference_test.d test.d
+ expect_different_content reference_test.d $BASEDIR1/test.d
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 4
generate_reference_compiler_output
CCACHE_DEPEND=1 CCACHE_BASEDIR=$BASEDIR1 $CCACHE_COMPILE $DEPFLAGS -c test.c
expect_equal_object_files reference_test.o test.o
- expect_equal_files reference_test.d test.d
+ expect_equal_content reference_test.d test.d
expect_stat 'cache hit (direct)' 2
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 4
generate_reference_compiler_output
CCACHE_DEPEND=1 CCACHE_BASEDIR=$BASEDIR2 $CCACHE_COMPILE $DEPFLAGS -c test.c
expect_equal_object_files test.o test.o
- expect_equal_files reference_test.d test.d
+ expect_equal_content reference_test.d test.d
expect_stat 'cache hit (direct)' 3
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 4
generate_reference_compiler_output
CCACHE_DEPEND=1 CCACHE_BASEDIR=$BASEDIR3 $CCACHE_COMPILE $DEPFLAGS -c test.c
expect_equal_object_files reference_test.o test.o
- expect_equal_files reference_test.d test.d
+ expect_equal_content reference_test.d test.d
expect_stat 'cache hit (direct)' 4
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 4
generate_reference_compiler_output
CCACHE_DEPEND=1 CCACHE_BASEDIR=$BASEDIR4 $CCACHE_COMPILE $DEPFLAGS -c test.c
expect_equal_object_files reference_test.o test.o
- expect_equal_files reference_test.d test.d
- expect_different_files reference_test.d $BASEDIR1/test.d
+ expect_equal_content reference_test.d test.d
+ expect_different_content reference_test.d $BASEDIR1/test.d
expect_stat 'cache hit (direct)' 5
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 4
expect_stat 'cache miss' 1
expect_stat 'files in cache' 2
expect_equal_object_files reference_test.o test.o
- expect_file_newer_than $manifest_file test.c
+ expect_newer_than $manifest_file test.c
# -------------------------------------------------------------------------
TEST "Corrupt manifest file"
touch a/source.c b/source.c
backdate a/source.h b/source.h
$CCACHE_COMPILE -MMD -c a/source.c -o a/source.o
- expect_file_content a/source.d "a/source.o: a/source.c"
+ expect_content a/source.d "a/source.o: a/source.c"
$CCACHE_COMPILE -MMD -c b/source.c -o b/source.o
- expect_file_content b/source.d "b/source.o: b/source.c"
+ expect_content b/source.d "b/source.o: b/source.c"
$CCACHE_COMPILE -MMD -c a/source.c -o a/source.o
- expect_file_content a/source.d "a/source.o: a/source.c"
+ expect_content a/source.d "a/source.o: a/source.c"
# -------------------------------------------------------------------------
for dep_args in "-MMD" "-MMD -MF foo.d" "-Wp,-MMD,foo.d"; do
$CCACHE_COMPILE -c test.c $dep_args $obj_args
expect_stat 'cache hit (direct)' 0
expect_stat 'cache miss' 1
- expect_equal_text_files $dep_file.real $dep_file
+ expect_equal_text_content $dep_file.real $dep_file
# cache hit
$CCACHE_COMPILE -c test.c $dep_args $obj_args
expect_stat 'cache hit (direct)' 1
expect_stat 'cache miss' 1
- expect_equal_text_files $dep_file.real $dep_file
+ expect_equal_text_content $dep_file.real $dep_file
# change object file name
$CCACHE_COMPILE -c test.c $dep_args -o another.o
- expect_equal_text_files another.d.real $another_dep_file
+ expect_equal_text_content another.d.real $another_dep_file
done
done
$CCACHE_COMPILE $option -c test1.c -o $obj
diff -u orig.d $dep
- expect_equal_files $dep orig.d
+ expect_equal_content $dep orig.d
expect_stat 'cache hit (direct)' $i
expect_stat 'cache miss' 1
$CCACHE_COMPILE -MMD -c $src -o $obj
dep=$(echo $obj | sed 's/\.o$/.d/')
- expect_file_content $dep "$obj: $src"
+ expect_content $dep "$obj: $src"
expect_stat 'cache hit (direct)' $hit
expect_stat 'cache miss' 1
hit=$((hit + 1))
for obj in test1.o build/test1.o; do
$CCACHE_COMPILE -c -MMD $src -o $obj
dep=$(echo $obj | sed 's/\.o$/.d/')
- expect_file_content $dep "$obj: $src"
+ expect_content $dep "$obj: $src"
done
done
backdate a/source.h b/source.h
echo '#include <source.h>' >source.c
$CCACHE_COMPILE -MMD -Ia -c source.c
- expect_file_content source.d "source.o: source.c a/source.h"
+ expect_content source.d "source.o: source.c a/source.h"
$CCACHE_COMPILE -MMD -Ib -c source.c
- expect_file_content source.d "source.o: source.c b/source.h"
+ expect_content source.d "source.o: source.c b/source.h"
$CCACHE_COMPILE -MMD -Ia -c source.c
- expect_file_content source.d "source.o: source.c a/source.h"
+ expect_content source.d "source.o: source.c a/source.h"
# -------------------------------------------------------------------------
TEST "-Wp,-MD"
expect_stat 'cache hit (direct)' 0
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files other.d expected.d
+ expect_equal_content other.d expected.d
$REAL_COMPILER -c -Wp,-MD,other.d test.c -o reference_test.o
expect_equal_object_files reference_test.o test.o
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files other.d expected.d
+ expect_equal_content other.d expected.d
expect_equal_object_files reference_test.o test.o
$CCACHE_COMPILE -c -Wp,-MD,different_name.d test.c
expect_stat 'cache hit (direct)' 2
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files different_name.d expected.d
+ expect_equal_content different_name.d expected.d
expect_equal_object_files reference_test.o test.o
# -------------------------------------------------------------------------
expect_stat 'cache hit (direct)' 0
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files other.d expected_mmd.d
+ expect_equal_content other.d expected_mmd.d
$REAL_COMPILER -c -Wp,-MMD,other.d test.c -o reference_test.o
expect_equal_object_files reference_test.o test.o
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files other.d expected_mmd.d
+ expect_equal_content other.d expected_mmd.d
expect_equal_object_files reference_test.o test.o
$CCACHE_COMPILE -c -Wp,-MMD,different_name.d test.c
expect_stat 'cache hit (direct)' 2
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files different_name.d expected_mmd.d
+ expect_equal_content different_name.d expected_mmd.d
expect_equal_object_files reference_test.o test.o
# -------------------------------------------------------------------------
expect_stat 'cache hit (direct)' 0
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_file_content source.d "source.o: source.c"
+ expect_content source.d "source.o: source.c"
$CCACHE_COMPILE -c -Wp,-MMD,source.d,-MT,source.o source.c 2>/dev/null
expect_stat 'cache hit (direct)' 0
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 1
- expect_file_content source.d "source.o: source.c"
+ expect_content source.d "source.o: source.c"
# -------------------------------------------------------------------------
TEST "-MMD for different source files"
mkdir a b
touch a/source.c b/source.c
$CCACHE_COMPILE -MMD -c a/source.c
- expect_file_content source.d "source.o: a/source.c"
+ expect_content source.d "source.o: a/source.c"
$CCACHE_COMPILE -MMD -c b/source.c
- expect_file_content source.d "source.o: b/source.c"
+ expect_content source.d "source.o: b/source.c"
$CCACHE_COMPILE -MMD -c a/source.c
- expect_file_content source.d "source.o: a/source.c"
+ expect_content source.d "source.o: a/source.c"
# -------------------------------------------------------------------------
TEST "Multiple object entries in manifest"
expect_stat 'cache hit (direct)' 0
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files test.d expected.d
+ expect_equal_content test.d expected.d
$REAL_COMPILER -c -MD test.c -o reference_test.o
expect_equal_object_files reference_test.o test.o
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files test.d expected.d
+ expect_equal_content test.d expected.d
expect_equal_object_files reference_test.o test.o
# -------------------------------------------------------------------------
expect_stat 'cache hit (direct)' 0
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files test.d expected.d
+ expect_equal_content test.d expected.d
$REAL_COMPILER -c -MD test.c -o reference_test.o
expect_equal_object_files reference_test.o test.o
expect_stat 'cache hit (direct)' 0
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 1
- expect_equal_files test.d expected.d
+ expect_equal_content test.d expected.d
expect_equal_object_files reference_test.o test.o
rm -f test.d
expect_stat 'cache hit (direct)' 0
expect_stat 'cache hit (preprocessed)' 2
expect_stat 'cache miss' 1
- expect_equal_files test.d expected.d
+ expect_equal_content test.d expected.d
expect_equal_object_files reference_test.o test.o
rm -f test.d
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 2
expect_stat 'cache miss' 1
- expect_equal_files test.d expected.d
+ expect_equal_content test.d expected.d
expect_equal_object_files reference_test.o test.o
# -------------------------------------------------------------------------
expect_stat 'cache hit (direct)' 0
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files other.d expected.d
+ expect_equal_content other.d expected.d
$REAL_COMPILER -c -MD -MF other.d test.c -o reference_test.o
expect_equal_object_files reference_test.o test.o
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files other.d expected.d
+ expect_equal_content other.d expected.d
expect_equal_object_files reference_test.o test.o
$CCACHE_COMPILE -c -MD -MF different_name.d test.c
expect_stat 'cache hit (direct)' 2
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files different_name.d expected.d
+ expect_equal_content different_name.d expected.d
expect_equal_object_files reference_test.o test.o
rm -f different_name.d
expect_stat 'cache hit (direct)' 3
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files third_name.d expected.d
+ expect_equal_content third_name.d expected.d
expect_equal_object_files reference_test.o test.o
rm -f third_name.d
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 2
expect_stat 'files in cache' 4
- expect_equal_files test.d expected.d
+ expect_equal_content test.d expected.d
rm -f test.d
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 2
expect_stat 'files in cache' 4
- expect_equal_files test.d expected.d
+ expect_equal_content test.d expected.d
# -------------------------------------------------------------------------
TEST "stderr from both preprocessor and compiler"
expect_stat 'cache hit (direct)' 0
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 1
- expect_file_content stderr-cpp.txt "`cat stderr-orig.txt`"
+ expect_content stderr-cpp.txt "`cat stderr-orig.txt`"
$CCACHE_COMPILE -Wall -W -c cpp-warning.c 2>stderr-mf.txt
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 1
- expect_file_content stderr-mf.txt "`cat stderr-orig.txt`"
+ expect_content stderr-mf.txt "`cat stderr-orig.txt`"
# -------------------------------------------------------------------------
TEST "Empty source file"
expect_stat 'cache hit (direct)' 0
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files other.d expected_dependencies_output.d
+ expect_equal_content other.d expected_dependencies_output.d
DEPENDENCIES_OUTPUT="other.d" $REAL_COMPILER -c test.c -o reference_test.o
expect_equal_object_files reference_test.o test.o
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files other.d expected_dependencies_output.d
+ expect_equal_content other.d expected_dependencies_output.d
expect_equal_object_files reference_test.o test.o
DEPENDENCIES_OUTPUT="different_name.d" $CCACHE_COMPILE -c test.c
expect_stat 'cache hit (direct)' 2
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files different_name.d expected_dependencies_output.d
+ expect_equal_content different_name.d expected_dependencies_output.d
expect_equal_object_files reference_test.o test.o
# -------------------------------------------------------------------------
expect_stat 'cache hit (direct)' 0
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files other.d expected_dependencies_output_target.d
+ expect_equal_content other.d expected_dependencies_output_target.d
DEPENDENCIES_OUTPUT="other.d target.o" $REAL_COMPILER -c test.c -o reference_test.o
expect_equal_object_files reference_test.o test.o
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files other.d expected_dependencies_output_target.d
+ expect_equal_content other.d expected_dependencies_output_target.d
expect_equal_object_files reference_test.o test.o
DEPENDENCIES_OUTPUT="different_name.d target.o" $CCACHE_COMPILE -c test.c
expect_stat 'cache hit (direct)' 2
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files different_name.d expected_dependencies_output_target.d
+ expect_equal_content different_name.d expected_dependencies_output_target.d
expect_equal_object_files reference_test.o test.o
# -------------------------------------------------------------------------
expect_stat 'cache hit (direct)' 0
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files other.d expected_sunpro_dependencies.d
+ expect_equal_content other.d expected_sunpro_dependencies.d
SUNPRO_DEPENDENCIES="other.d" $REAL_COMPILER -c test.c -o reference_test.o
expect_equal_object_files reference_test.o test.o
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files other.d expected_sunpro_dependencies.d
+ expect_equal_content other.d expected_sunpro_dependencies.d
expect_equal_object_files reference_test.o test.o
SUNPRO_DEPENDENCIES="different_name.d" $CCACHE_COMPILE -c test.c
expect_stat 'cache hit (direct)' 2
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files different_name.d expected_sunpro_dependencies.d
+ expect_equal_content different_name.d expected_sunpro_dependencies.d
expect_equal_object_files reference_test.o test.o
# -------------------------------------------------------------------------
expect_stat 'cache hit (direct)' 0
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files other.d expected_sunpro_dependencies_target.d
+ expect_equal_content other.d expected_sunpro_dependencies_target.d
SUNPRO_DEPENDENCIES="other.d target.o" $REAL_COMPILER -c test.c -o reference_test.o
expect_equal_object_files reference_test.o test.o
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files other.d expected_sunpro_dependencies_target.d
+ expect_equal_content other.d expected_sunpro_dependencies_target.d
expect_equal_object_files reference_test.o test.o
SUNPRO_DEPENDENCIES="different_name.d target.o" $CCACHE_COMPILE -c test.c
expect_stat 'cache hit (direct)' 2
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_equal_files different_name.d expected_sunpro_dependencies_target.d
+ expect_equal_content different_name.d expected_sunpro_dependencies_target.d
expect_equal_object_files reference_test.o test.o
# -------------------------------------------------------------------------
$CCACHE_COMPILE -c -MMD test1.c
expect_stat 'cache hit (direct)' 0
expect_stat 'cache miss' 1
- expect_file_content test1.d "test1.o: test1.c"
+ expect_content test1.d "test1.o: test1.c"
touch test1.h
echo '#include "test1.h"' >>test1.c
$CCACHE_COMPILE -c -MMD test1.c
expect_stat 'cache hit (direct)' 0
expect_stat 'cache miss' 2
- expect_file_content test1.d "test1.o: test1.c test1.h"
+ expect_content test1.d "test1.o: test1.c test1.h"
echo "int x;" >test1.c
$CCACHE_COMPILE -c -MMD test1.c
expect_stat 'cache hit (direct)' 1
expect_stat 'cache miss' 2
- expect_file_content test1.d "test1.o: test1.c"
+ expect_content test1.d "test1.o: test1.c"
}
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
- expect_equal_files reference_test1.o test_cpp.o
+ expect_equal_content reference_test1.o test_cpp.o
$ccache_nvcc_cpp test_cpp.cu
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
- expect_equal_files reference_test1.o test_cpp.o
+ expect_equal_content reference_test1.o test_cpp.o
# -------------------------------------------------------------------------
TEST "Different GPU architectures"
$cuobjdump reference_test1.o > reference_test1.dump
$cuobjdump reference_test2.o > reference_test2.dump
$cuobjdump reference_test3.o > reference_test3.dump
- expect_different_files reference_test1.dump reference_test2.dump
- expect_different_files reference_test1.dump reference_test3.dump
- expect_different_files reference_test2.dump reference_test3.dump
+ expect_different_content reference_test1.dump reference_test2.dump
+ expect_different_content reference_test1.dump reference_test3.dump
+ expect_different_content reference_test2.dump reference_test3.dump
$ccache_nvcc_cuda test_cuda.cu
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
$cuobjdump test_cuda.o > test1.dump
- expect_equal_files reference_test1.dump test1.dump
+ expect_equal_content reference_test1.dump test1.dump
# Other GPU.
$ccache_nvcc_cuda $nvcc_opts_gpu1 test_cuda.cu
expect_stat 'cache miss' 2
expect_stat 'files in cache' 2
$cuobjdump test_cuda.o > test1.dump
- expect_equal_files reference_test2.dump test1.dump
+ expect_equal_content reference_test2.dump test1.dump
$ccache_nvcc_cuda $nvcc_opts_gpu1 test_cuda.cu
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 2
expect_stat 'files in cache' 2
$cuobjdump test_cuda.o > test1.dump
- expect_equal_files reference_test2.dump test1.dump
+ expect_equal_content reference_test2.dump test1.dump
# Another GPU.
$ccache_nvcc_cuda $nvcc_opts_gpu2 test_cuda.cu
expect_stat 'cache miss' 3
expect_stat 'files in cache' 3
$cuobjdump test_cuda.o > test1.dump
- expect_equal_files reference_test3.dump test1.dump
+ expect_equal_content reference_test3.dump test1.dump
$ccache_nvcc_cuda $nvcc_opts_gpu2 test_cuda.cu
expect_stat 'cache hit (preprocessed)' 2
expect_stat 'cache miss' 3
expect_stat 'files in cache' 3
$cuobjdump test_cuda.o > test1.dump
- expect_equal_files reference_test3.dump test1.dump
+ expect_equal_content reference_test3.dump test1.dump
# -------------------------------------------------------------------------
TEST "Option -dc"
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
$cuobjdump test_cuda.o > test4.dump
- expect_equal_files test4.dump reference_test4.dump
+ expect_equal_content test4.dump reference_test4.dump
$ccache_nvcc_cuda -dc -o test_cuda.o test_cuda.cu
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
$cuobjdump test_cuda.o > test4.dump
- expect_equal_files test4.dump reference_test4.dump
+ expect_equal_content test4.dump reference_test4.dump
# -------------------------------------------------------------------------
TEST "Different defines"
$REAL_NVCC $nvcc_opts_cpp -o reference_test1.o test_cpp.cu
$REAL_NVCC $nvcc_opts_cpp -DNUM=10 -o reference_test2.o test_cpp.cu
- expect_different_files reference_test1.o reference_test2.o
+ expect_different_content reference_test1.o reference_test2.o
$ccache_nvcc_cpp test_cpp.cu
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
- expect_equal_files reference_test1.o test_cpp.o
+ expect_equal_content reference_test1.o test_cpp.o
# Specified define, but unused. Can only be found by preprocessed mode.
$ccache_nvcc_cpp -DDUMMYENV=1 test_cpp.cu
expect_stat "cache hit (preprocessed)" 1
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
- expect_equal_files reference_test1.o test_cpp.o
+ expect_equal_content reference_test1.o test_cpp.o
# Specified used define.
$ccache_nvcc_cpp -DNUM=10 test_cpp.cu
expect_stat "cache hit (preprocessed)" 1
expect_stat 'cache miss' 2
expect_stat 'files in cache' 2
- expect_equal_files reference_test2.o test_cpp.o
+ expect_equal_content reference_test2.o test_cpp.o
$ccache_nvcc_cpp -DNUM=10 test_cpp.cu
expect_stat 'cache hit (preprocessed)' 2
expect_stat 'cache miss' 2
expect_stat 'files in cache' 2
- expect_equal_files reference_test2.o test_cpp.o
+ expect_equal_content reference_test2.o test_cpp.o
# -------------------------------------------------------------------------
TEST "Option file"
$REAL_NVCC $nvcc_opts_cpp -optf test1.optf -o reference_test1.o test_cpp.cu
$REAL_NVCC $nvcc_opts_cpp -optf test2.optf -o reference_test2.o test_cpp.cu
- expect_different_files reference_test1.o reference_test2.o
+ expect_different_content reference_test1.o reference_test2.o
$ccache_nvcc_cpp -optf test1.optf test_cpp.cu
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
- expect_equal_files reference_test1.o test_cpp.o
+ expect_equal_content reference_test1.o test_cpp.o
$ccache_nvcc_cpp -optf test1.optf test_cpp.cu
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
- expect_equal_files reference_test1.o test_cpp.o
+ expect_equal_content reference_test1.o test_cpp.o
$ccache_nvcc_cpp -optf test2.optf test_cpp.cu
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 2
expect_stat 'files in cache' 2
- expect_equal_files reference_test2.o test_cpp.o
+ expect_equal_content reference_test2.o test_cpp.o
$ccache_nvcc_cpp -optf test2.optf test_cpp.cu
expect_stat 'cache hit (preprocessed)' 2
expect_stat 'cache miss' 2
expect_stat 'files in cache' 2
- expect_equal_files reference_test2.o test_cpp.o
+ expect_equal_content reference_test2.o test_cpp.o
# -------------------------------------------------------------------------
TEST "Option --compiler-bindir"
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
- expect_equal_files reference_test1.o test_cpp.o
+ expect_equal_content reference_test1.o test_cpp.o
$ccache_nvcc_cpp --compiler-bindir $REAL_COMPILER_BIN test_cpp.cu
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
- expect_equal_files reference_test1.o test_cpp.o
+ expect_equal_content reference_test1.o test_cpp.o
# -------------------------------------------------------------------------
TEST "Option -ccbin"
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
- expect_equal_files reference_test1.o test_cpp.o
+ expect_equal_content reference_test1.o test_cpp.o
$ccache_nvcc_cpp -ccbin $REAL_COMPILER_BIN test_cpp.cu
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
- expect_equal_files reference_test1.o test_cpp.o
+ expect_equal_content reference_test1.o test_cpp.o
# -------------------------------------------------------------------------
TEST "Option --output-directory"
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
- expect_equal_files reference_test1.o test_cpp.o
+ expect_equal_content reference_test1.o test_cpp.o
$ccache_nvcc_cpp --output-directory . test_cpp.cu
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
- expect_equal_files reference_test1.o test_cpp.o
+ expect_equal_content reference_test1.o test_cpp.o
# -------------------------------------------------------------------------
TEST "Option -odir"
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
- expect_equal_files reference_test1.o test_cpp.o
+ expect_equal_content reference_test1.o test_cpp.o
$ccache_nvcc_cpp -odir . test_cpp.cu
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
- expect_equal_files reference_test1.o test_cpp.o
+ expect_equal_content reference_test1.o test_cpp.o
# -------------------------------------------------------------------------
TEST "Option -Werror"
expect_stat 'cache hit (direct)' 0
expect_stat 'cache miss' 1
expect_stat 'files in cache' 2
- expect_equal_files reference_test1.o test_cpp.o
+ expect_equal_content reference_test1.o test_cpp.o
$ccache_nvcc_cpp test_cpp.cu
expect_stat 'cache hit (direct)' 1
expect_stat 'cache miss' 1
expect_stat 'files in cache' 2
- expect_equal_files reference_test1.o test_cpp.o
+ expect_equal_content reference_test1.o test_cpp.o
# -------------------------------------------------------------------------
TEST "Different GPU architectures"
$cuobjdump reference_test1.o > reference_test1.dump
$cuobjdump reference_test2.o > reference_test2.dump
$cuobjdump reference_test3.o > reference_test3.dump
- expect_different_files reference_test1.dump reference_test2.dump
- expect_different_files reference_test1.dump reference_test3.dump
- expect_different_files reference_test2.dump reference_test3.dump
+ expect_different_content reference_test1.dump reference_test2.dump
+ expect_different_content reference_test1.dump reference_test3.dump
+ expect_different_content reference_test2.dump reference_test3.dump
$ccache_nvcc_cuda test_cuda.cu
expect_stat 'cache hit (direct)' 0
expect_stat 'cache miss' 1
expect_stat 'files in cache' 2
$cuobjdump test_cuda.o > test1.dump
- expect_equal_files reference_test1.dump test1.dump
+ expect_equal_content reference_test1.dump test1.dump
# Other GPU.
$ccache_nvcc_cuda $nvcc_opts_gpu1 test_cuda.cu
expect_stat 'cache miss' 2
expect_stat 'files in cache' 4
$cuobjdump test_cuda.o > test1.dump
- expect_equal_files reference_test2.dump test1.dump
+ expect_equal_content reference_test2.dump test1.dump
$ccache_nvcc_cuda $nvcc_opts_gpu1 test_cuda.cu
expect_stat 'cache hit (direct)' 1
expect_stat 'cache miss' 2
expect_stat 'files in cache' 4
$cuobjdump test_cuda.o > test1.dump
- expect_equal_files reference_test2.dump test1.dump
+ expect_equal_content reference_test2.dump test1.dump
# Another GPU.
$ccache_nvcc_cuda $nvcc_opts_gpu2 test_cuda.cu
expect_stat 'cache miss' 3
expect_stat 'files in cache' 6
$cuobjdump test_cuda.o > test1.dump
- expect_equal_files reference_test3.dump test1.dump
+ expect_equal_content reference_test3.dump test1.dump
$ccache_nvcc_cuda $nvcc_opts_gpu2 test_cuda.cu
expect_stat 'cache hit (direct)' 2
expect_stat 'cache miss' 3
expect_stat 'files in cache' 6
$cuobjdump test_cuda.o > test1.dump
- expect_equal_files reference_test3.dump test1.dump
+ expect_equal_content reference_test3.dump test1.dump
# -------------------------------------------------------------------------
TEST "Different defines"
$REAL_NVCC $nvcc_opts_cpp -o reference_test1.o test_cpp.cu
$REAL_NVCC $nvcc_opts_cpp -DNUM=10 -o reference_test2.o test_cpp.cu
- expect_different_files reference_test1.o reference_test2.o
+ expect_different_content reference_test1.o reference_test2.o
$ccache_nvcc_cpp test_cpp.cu
expect_stat 'cache hit (direct)' 0
expect_stat 'cache miss' 1
expect_stat 'files in cache' 2
- expect_equal_files reference_test1.o test_cpp.o
+ expect_equal_content reference_test1.o test_cpp.o
# Specified define, but unused. Can only be found by preprocessed mode.
$ccache_nvcc_cpp -DDUMMYENV=1 test_cpp.cu
expect_stat "cache hit (direct)" 0
expect_stat 'cache miss' 1
expect_stat 'files in cache' 3
- expect_equal_files reference_test1.o test_cpp.o
+ expect_equal_content reference_test1.o test_cpp.o
# Specified used define.
$ccache_nvcc_cpp -DNUM=10 test_cpp.cu
expect_stat "cache hit (direct)" 0
expect_stat 'cache miss' 2
expect_stat 'files in cache' 5
- expect_equal_files reference_test2.o test_cpp.o
+ expect_equal_content reference_test2.o test_cpp.o
$ccache_nvcc_cpp -DNUM=10 test_cpp.cu
expect_stat 'cache hit (direct)' 1
expect_stat 'cache miss' 2
expect_stat 'files in cache' 5
- expect_equal_files reference_test2.o test_cpp.o
+ expect_equal_content reference_test2.o test_cpp.o
# -------------------------------------------------------------------------
TEST "Option file"
$REAL_NVCC $nvcc_opts_cpp -optf test1.optf -o reference_test1.o test_cpp.cu
$REAL_NVCC $nvcc_opts_cpp -optf test2.optf -o reference_test2.o test_cpp.cu
- expect_different_files reference_test1.o reference_test2.o
+ expect_different_content reference_test1.o reference_test2.o
$ccache_nvcc_cpp -optf test1.optf test_cpp.cu
expect_stat 'cache hit (direct)' 0
expect_stat 'cache miss' 1
expect_stat 'files in cache' 2
- expect_equal_files reference_test1.o test_cpp.o
+ expect_equal_content reference_test1.o test_cpp.o
$ccache_nvcc_cpp -optf test1.optf test_cpp.cu
expect_stat 'cache hit (direct)' 1
expect_stat 'cache miss' 1
expect_stat 'files in cache' 2
- expect_equal_files reference_test1.o test_cpp.o
+ expect_equal_content reference_test1.o test_cpp.o
$ccache_nvcc_cpp -optf test2.optf test_cpp.cu
expect_stat 'cache hit (direct)' 1
expect_stat 'cache miss' 2
expect_stat 'files in cache' 4
- expect_equal_files reference_test2.o test_cpp.o
+ expect_equal_content reference_test2.o test_cpp.o
$ccache_nvcc_cpp -optf test2.optf test_cpp.cu
expect_stat 'cache hit (direct)' 2
expect_stat 'cache miss' 2
expect_stat 'files in cache' 4
- expect_equal_files reference_test2.o test_cpp.o
+ expect_equal_content reference_test2.o test_cpp.o
}
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
$cuobjdump test_cuda.o > test1.dump
- expect_equal_files reference_test1.dump test1.dump
+ expect_equal_content reference_test1.dump test1.dump
$ccache_nvcc_cuda $TEST_OPTS test_cuda.cu
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
$cuobjdump test_cuda.o > test1.dump
- expect_equal_files reference_test1.dump test1.dump
+ expect_equal_content reference_test1.dump test1.dump
# ---------------------------------------------------------------------
TEST "Option -ldir"
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
$cuobjdump test_cuda.o > test1.dump
- expect_equal_files reference_test1.dump test1.dump
+ expect_equal_content reference_test1.dump test1.dump
$ccache_nvcc_cuda $TEST_OPTS test_cuda.cu
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
$cuobjdump test_cuda.o > test1.dump
- expect_equal_files reference_test1.dump test1.dump
+ expect_equal_content reference_test1.dump test1.dump
export PATH=$OLD_PATH
}
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_file_exists pch.h.gch
+ expect_exists pch.h.gch
echo '#include <string.h> /*change pch*/' >>pch.h
backdate pch.h
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 2
- expect_file_exists pch.h.gch
+ expect_exists pch.h.gch
# -------------------------------------------------------------------------
TEST "Create .gch, no -c, -o, with opt-in"
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_file_exists pch.gch
+ expect_exists pch.gch
# -------------------------------------------------------------------------
TEST "Use .gch, #include, remove pch.h"
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_file_exists pch.h.gch
+ expect_exists pch.h.gch
echo '#include <string.h> /*change pch*/' >>pch.h
backdate pch.h
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 2
- expect_file_exists pch.h.gch
+ expect_exists pch.h.gch
# -------------------------------------------------------------------------
TEST "Use .gch, -include, PCH_EXTSUM=1"
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_file_exists pch.h.gch/foo
+ expect_exists pch.h.gch/foo
backdate pch.h.gch/foo
expect_stat 'cache miss' 2
$REAL_COMPILER $SYSROOT -c -include pch2.h pch2.c
- expect_file_exists pch2.o
+ expect_exists pch2.o
CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS pch_defines" $CCACHE_COMPILE $SYSROOT -c pch2.h
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
- expect_file_exists pch.h.pch
+ expect_exists pch.h.pch
echo '#include <string.h> /*change pch*/' >>pch.h
backdate pch.h
expect_stat 'cache hit (direct)' 1
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 2
- expect_file_exists pch.h.pch
+ expect_exists pch.h.pch
# -------------------------------------------------------------------------
TEST "Use .pch the with -Xclang options"
if [ $status2 -ne 0 ]; then
test_failed "Failure when compiling test2.c read-only"
fi
- expect_file_exists test.o
- expect_file_exists test2.o
+ expect_exists test.o
+ expect_exists test2.o
# -------------------------------------------------------------------------
TEST "Cache miss"
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
- expect_equal_files expected.dia test.dia
+ expect_equal_content expected.dia test.dia
rm test.dia
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
- expect_equal_files expected.dia test.dia
+ expect_equal_content expected.dia test.dia
# -------------------------------------------------------------------------
TEST "Compile failed"
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 0
expect_stat 'files in cache' 0
- expect_equal_files expected.dia test.dia
- expect_equal_files expected.stderr test.stderr
+ expect_equal_content expected.dia test.dia
+ expect_equal_content expected.stderr test.stderr
# -------------------------------------------------------------------------
TEST "--serialize-diagnostics + CCACHE_BASEDIR"