]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
test: Improve names of expect_* functions
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 19 Aug 2020 05:18:33 +0000 (07:18 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 22 Aug 2020 13:26:51 +0000 (15:26 +0200)
14 files changed:
test/run
test/suites/base.bash
test/suites/basedir.bash
test/suites/color_diagnostics.bash
test/suites/depend.bash
test/suites/direct.bash
test/suites/direct_gcc.bash
test/suites/hardlink.bash
test/suites/nvcc.bash
test/suites/nvcc_direct.bash
test/suites/nvcc_ldir.bash
test/suites/pch.bash
test/suites/readonly.bash
test/suites/serialize_diagnostics.bash

index 89e0ec2e38608bc1ad077825b7aec670153ad257..692f755d9c259591b1fb8682906f6ef35caad15f 100755 (executable)
--- 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
index 393018f55ebcc522cb672c645488ee04b64293d6..2090e36571066d25cdb85cb3edf0836649bbec39 100644 (file)
@@ -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
 
index 0ad4cff11d7657e20e6527c999a8823c7522d3d2..d1d0aef153cac45be92cf92bc64826230d01fc67 100644 (file)
@@ -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
 }
index abfa4b74caf0287cf2e0ec1cd5065044bb7dc127..7badb4b67e730064e1843ea9aea8db86722cddb8 100644 (file)
@@ -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() {
index 60443ee7868e9c39a603e49011247d504159fc0e..d69591c307e65c911af453397db8a639deb9c62f 100644 (file)
@@ -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
index 2d685f82dbb6312747f0b27bd9a5e5e28b0ad3d4..7ae5ebe9181d98ad06202892ead77b31250f9b94 100644 (file)
@@ -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.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"
@@ -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"
index ad5b490d585442cee93471511cca35a14d23c3cd..57b6ed9fdbfc3cd4911d4a331ceaf32cdde28c72 100644 (file)
@@ -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
 
     # -------------------------------------------------------------------------
index 1cb5fc84b8eb899dbfb77b938688bccc8969a00c..e37edce5323449dddbdb83e25ad03edff8af2309 100644 (file)
@@ -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"
 }
index 1e8cb9be00ec72b9240804ee771f1b4950cf53b5..d73623b650a65c24aa2edc9f54f8e6d379e60e13 100644 (file)
@@ -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"
index 613579fd0d4f9edf1050d8a20c6d311d0668c561..3762153a0f2eaf911df12bb1219021ab2dffae81 100644 (file)
@@ -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
 }
index 132684d233c001b84d0ed88f48a2827d5a843f30..a19432ad532532659af640eba91f83031ad46b92 100644 (file)
@@ -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
 }
index 89cdf9baa0c82d5266fb9233e9559a741b359cfe..5729575b9eb42012f4e3e11faba6ee026c48f89e 100644 (file)
@@ -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 <string.h> /*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 <string.h> /*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 <string.h> /*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"
index 5d28a970147b0daac7cbc35f80ff6caabb53c1bb..200f5c0de48426a57778f4490dcb5023fd9efa4a 100644 (file)
@@ -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"
index 29ce9734d78436ef917350a771f345df6e40d29c..a6eb4a17613b5d5f387b172b8041faaf3fae9941 100644 (file)
@@ -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"