From 733f98804a4e43fb3adc9e36fa096bbea0f96592 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Wed, 19 Aug 2020 07:18:33 +0200 Subject: [PATCH] test: Improve names of expect_* functions --- test/run | 30 +++++----- test/suites/base.bash | 46 ++++++++-------- test/suites/basedir.bash | 8 +-- test/suites/color_diagnostics.bash | 8 +-- test/suites/depend.bash | 26 ++++----- test/suites/direct.bash | 76 +++++++++++++------------- test/suites/direct_gcc.bash | 24 ++++---- test/suites/hardlink.bash | 6 +- test/suites/nvcc.bash | 60 ++++++++++---------- test/suites/nvcc_direct.bash | 40 +++++++------- test/suites/nvcc_ldir.bash | 8 +-- test/suites/pch.bash | 18 +++--- test/suites/readonly.bash | 4 +- test/suites/serialize_diagnostics.bash | 8 +-- 14 files changed, 181 insertions(+), 181 deletions(-) diff --git a/test/run b/test/run index 89e0ec2e3..692f755d9 100755 --- a/test/run +++ b/test/run @@ -145,48 +145,48 @@ expect_stat() { 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" @@ -216,7 +216,7 @@ expect_equal_object_files() { fi } -expect_file_content() { +expect_content() { local file="$1" local content="$2" @@ -228,7 +228,7 @@ expect_file_content() { fi } -expect_file_contains() { +expect_contains() { local file="$1" local string="$2" @@ -240,7 +240,7 @@ expect_file_contains() { fi } -expect_file_not_contains() { +expect_not_contains() { local file="$1" local string="$2" @@ -263,7 +263,7 @@ expect_file_count() { } # 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 diff --git a/test/suites/base.bash b/test/suites/base.bash index 393018f55..2090e3657 100644 --- a/test/suites/base.bash +++ b/test/suites/base.bash @@ -158,7 +158,7 @@ base_tests() { $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" @@ -175,13 +175,13 @@ base_tests() { $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 @@ -195,13 +195,13 @@ base_tests() { $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 @@ -215,13 +215,13 @@ base_tests() { $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 @@ -373,8 +373,8 @@ base_tests() { 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" @@ -609,14 +609,14 @@ EOF 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 @@ -624,7 +624,7 @@ b" 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" # ------------------------------------------------------------------------- @@ -998,7 +998,7 @@ int stderr(void) 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" @@ -1020,13 +1020,13 @@ EOF 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" @@ -1040,14 +1040,14 @@ EOF $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" @@ -1145,7 +1145,7 @@ EOF 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 @@ -1153,7 +1153,7 @@ EOF 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 @@ -1163,7 +1163,7 @@ EOF 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 @@ -1177,7 +1177,7 @@ EOF 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 diff --git a/test/suites/basedir.bash b/test/suites/basedir.bash index 0ad4cff11..d1d0aef15 100644 --- a/test/suites/basedir.bash +++ b/test/suites/basedir.bash @@ -288,13 +288,13 @@ EOF 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 @@ -303,12 +303,12 @@ EOF 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 } diff --git a/test/suites/color_diagnostics.bash b/test/suites/color_diagnostics.bash index abfa4b74c..7badb4b67 100644 --- a/test/suites/color_diagnostics.bash +++ b/test/suites/color_diagnostics.bash @@ -34,13 +34,13 @@ SUITE_color_diagnostics_SETUP() { } 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() { diff --git a/test/suites/depend.bash b/test/suites/depend.bash index 60443ee78..d69591c30 100644 --- a/test/suites/depend.bash +++ b/test/suites/depend.bash @@ -168,13 +168,13 @@ EOF 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 @@ -196,7 +196,7 @@ EOF 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 @@ -206,7 +206,7 @@ EOF 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 @@ -217,7 +217,7 @@ EOF 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 @@ -230,7 +230,7 @@ EOF 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 @@ -241,8 +241,8 @@ EOF 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 @@ -253,7 +253,7 @@ EOF 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 @@ -264,7 +264,7 @@ EOF 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 @@ -275,7 +275,7 @@ EOF 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 @@ -286,8 +286,8 @@ EOF 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 diff --git a/test/suites/direct.bash b/test/suites/direct.bash index 2d685f82d..7ae5ebe91 100644 --- a/test/suites/direct.bash +++ b/test/suites/direct.bash @@ -45,7 +45,7 @@ SUITE_direct() { 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" @@ -175,13 +175,13 @@ EOF 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 @@ -210,17 +210,17 @@ EOF $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 @@ -243,7 +243,7 @@ EOF $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 @@ -271,7 +271,7 @@ EOF $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)) @@ -292,7 +292,7 @@ EOF 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 @@ -304,13 +304,13 @@ EOF backdate a/source.h b/source.h echo '#include ' >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" @@ -319,7 +319,7 @@ EOF 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 @@ -329,14 +329,14 @@ EOF 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 # ------------------------------------------------------------------------- @@ -346,7 +346,7 @@ EOF 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 @@ -356,14 +356,14 @@ EOF 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 # ------------------------------------------------------------------------- @@ -391,13 +391,13 @@ EOF 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" @@ -405,13 +405,13 @@ EOF 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" @@ -433,7 +433,7 @@ EOF 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 @@ -443,7 +443,7 @@ EOF 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 # ------------------------------------------------------------------------- @@ -497,7 +497,7 @@ EOF 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 @@ -507,7 +507,7 @@ EOF 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 @@ -516,7 +516,7 @@ EOF 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 @@ -525,7 +525,7 @@ EOF 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 # ------------------------------------------------------------------------- @@ -535,7 +535,7 @@ EOF 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 @@ -545,14 +545,14 @@ EOF 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 @@ -561,7 +561,7 @@ EOF 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 @@ -586,7 +586,7 @@ EOF 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 @@ -595,7 +595,7 @@ EOF 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" @@ -618,13 +618,13 @@ EOF 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" diff --git a/test/suites/direct_gcc.bash b/test/suites/direct_gcc.bash index ad5b490d5..57b6ed9fd 100644 --- a/test/suites/direct_gcc.bash +++ b/test/suites/direct_gcc.bash @@ -39,7 +39,7 @@ SUITE_direct_gcc() { 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 @@ -49,14 +49,14 @@ SUITE_direct_gcc() { 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 # ------------------------------------------------------------------------- @@ -66,7 +66,7 @@ SUITE_direct_gcc() { 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 @@ -76,14 +76,14 @@ SUITE_direct_gcc() { 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 # ------------------------------------------------------------------------- @@ -93,7 +93,7 @@ SUITE_direct_gcc() { 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 @@ -103,14 +103,14 @@ SUITE_direct_gcc() { 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 # ------------------------------------------------------------------------- @@ -120,7 +120,7 @@ SUITE_direct_gcc() { 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 @@ -130,14 +130,14 @@ SUITE_direct_gcc() { 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 # ------------------------------------------------------------------------- diff --git a/test/suites/hardlink.bash b/test/suites/hardlink.bash index 1cb5fc84b..e37edce53 100644 --- a/test/suites/hardlink.bash +++ b/test/suites/hardlink.bash @@ -105,7 +105,7 @@ SUITE_hardlink() { $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 @@ -113,12 +113,12 @@ SUITE_hardlink() { $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" } diff --git a/test/suites/nvcc.bash b/test/suites/nvcc.bash index 1e8cb9be0..d73623b65 100644 --- a/test/suites/nvcc.bash +++ b/test/suites/nvcc.bash @@ -70,13 +70,13 @@ nvcc_tests() { 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" @@ -87,16 +87,16 @@ nvcc_tests() { $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 @@ -104,14 +104,14 @@ nvcc_tests() { 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 @@ -119,14 +119,14 @@ nvcc_tests() { 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" @@ -139,78 +139,78 @@ nvcc_tests() { 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" @@ -223,13 +223,13 @@ nvcc_tests() { 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" @@ -242,13 +242,13 @@ nvcc_tests() { 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" @@ -261,13 +261,13 @@ nvcc_tests() { 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" @@ -279,13 +279,13 @@ nvcc_tests() { 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" diff --git a/test/suites/nvcc_direct.bash b/test/suites/nvcc_direct.bash index 613579fd0..3762153a0 100644 --- a/test/suites/nvcc_direct.bash +++ b/test/suites/nvcc_direct.bash @@ -32,13 +32,13 @@ SUITE_nvcc_direct() { 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" @@ -49,16 +49,16 @@ SUITE_nvcc_direct() { $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 @@ -66,14 +66,14 @@ SUITE_nvcc_direct() { 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 @@ -81,27 +81,27 @@ SUITE_nvcc_direct() { 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 @@ -109,49 +109,49 @@ SUITE_nvcc_direct() { 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 } diff --git a/test/suites/nvcc_ldir.bash b/test/suites/nvcc_ldir.bash index 132684d23..a19432ad5 100644 --- a/test/suites/nvcc_ldir.bash +++ b/test/suites/nvcc_ldir.bash @@ -57,14 +57,14 @@ SUITE_nvcc_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 # --------------------------------------------------------------------- TEST "Option -ldir" @@ -79,14 +79,14 @@ SUITE_nvcc_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 } diff --git a/test/suites/pch.bash b/test/suites/pch.bash index 89cdf9baa..5729575b9 100644 --- a/test/suites/pch.bash +++ b/test/suites/pch.bash @@ -93,7 +93,7 @@ pch_suite_common() { 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 /*change pch*/' >>pch.h backdate pch.h @@ -102,7 +102,7 @@ pch_suite_common() { 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" @@ -116,7 +116,7 @@ pch_suite_common() { 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" @@ -221,7 +221,7 @@ pch_suite_common() { 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 /*change pch*/' >>pch.h backdate pch.h @@ -231,7 +231,7 @@ pch_suite_common() { 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" @@ -513,7 +513,7 @@ pch_suite_gcc() { 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 @@ -639,7 +639,7 @@ EOF 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 @@ -786,7 +786,7 @@ EOF 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 /*change pch*/' >>pch.h backdate pch.h @@ -795,7 +795,7 @@ EOF 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" diff --git a/test/suites/readonly.bash b/test/suites/readonly.bash index 5d28a9701..200f5c0de 100644 --- a/test/suites/readonly.bash +++ b/test/suites/readonly.bash @@ -42,8 +42,8 @@ SUITE_readonly() { 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" diff --git a/test/suites/serialize_diagnostics.bash b/test/suites/serialize_diagnostics.bash index 29ce9734d..a6eb4a176 100644 --- a/test/suites/serialize_diagnostics.bash +++ b/test/suites/serialize_diagnostics.bash @@ -20,7 +20,7 @@ SUITE_serialize_diagnostics() { 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 @@ -28,7 +28,7 @@ SUITE_serialize_diagnostics() { 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" @@ -43,8 +43,8 @@ SUITE_serialize_diagnostics() { 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" -- 2.47.3