summaryrefslogtreecommitdiffstats
path: root/tests/run.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-04-16 11:52:44 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-04-16 11:58:19 -0400
commit98c539eeda8f9adfd22a3b2b6ece4fe1ca06b3b4 (patch)
tree6e168edc60e90297303a86a31aff488c7cad77f3 /tests/run.sh
parent1c1efd5c5ebc94be3b45958bfacb5ed9db99f8c7 (diff)
downloadbfs-98c539eeda8f9adfd22a3b2b6ece4fe1ca06b3b4.tar.xz
tests: Quiet diff
On Solaris/Illumos, `diff` prints "No differences encountered" if the files are the same. Guard it with `cmp -s` so we get no output for passing tests.
Diffstat (limited to 'tests/run.sh')
-rw-r--r--tests/run.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/run.sh b/tests/run.sh
index ab1ed6d..ad9c0be 100644
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -430,7 +430,7 @@ make_xattrs() {
EX_DIFF=20
# Detect colored diff support
-if diff --color /dev/null /dev/null 2>/dev/null; then
+if diff --color /dev/null /dev/null &>/dev/null; then
DIFF="diff --color"
else
DIFF="diff"
@@ -447,7 +447,7 @@ diff_output() {
if ((UPDATE)); then
cp "$OUT" "$GOLD"
- else
+ elif ! cmp -s "$GOLD" "$OUT"; then
$DIFF -u "$GOLD" "$OUT" >&$DUPERR
fi
}