From 3e053b32e23cc97ebe382785c238303c876d7865 Mon Sep 17 00:00:00 2001 From: David Given Date: Tue, 30 Apr 2024 23:07:10 +0200 Subject: [PATCH] Display a useful command to repeat a test if one fails. --- scripts/encodedecodetest.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/encodedecodetest.sh b/scripts/encodedecodetest.sh index 8bb152c2..0583179a 100755 --- a/scripts/encodedecodetest.sh +++ b/scripts/encodedecodetest.sh @@ -8,9 +8,9 @@ script="$4" flags="$5" dir="$6" -srcfile=$dir.$format.src.img -fluxfile=$dir.$format.$ext -destfile=$dir.$format.dest.img +srcfile=$dir/src.img +fluxfile=$dir/flux.$ext +destfile=$dir/dest.img dd if=/dev/urandom of=$srcfile bs=1048576 count=2 2>&1 @@ -24,6 +24,8 @@ fi truncate $srcfile -r $destfile if ! cmp $srcfile $destfile; then echo "Comparison failed!" >&2 + echo "Run this to repeat:" >&2 + echo "./scripts/encodedecodetest.sh \"$1\" \"$2\" \"$3\" \"$4\" \"$5\" \"$6\"" >&2 exit 1 fi exit 0