diff --git a/src/bin/pg_upgrade/test.sh b/src/bin/pg_upgrade/test.sh
index 07002f6a1659a0256d783a7229569b5692ff096d..f4e5d9ae6e92031ec3966c1eaab73e5d7c00c759 100644
--- a/src/bin/pg_upgrade/test.sh
+++ b/src/bin/pg_upgrade/test.sh
@@ -216,10 +216,11 @@ case $testhost in
 	*)	    sh ./delete_old_cluster.sh ;;
 esac
 
-if diff -q "$temp_root"/dump1.sql "$temp_root"/dump2.sql; then
+if diff "$temp_root"/dump1.sql "$temp_root"/dump2.sql >/dev/null; then
 	echo PASSED
 	exit 0
 else
+	echo "Files $temp_root/dump1.sql and $temp_root/dump2.sql differ"
 	echo "dumps were not identical"
 	exit 1
 fi