From bddd5bc678064f0fdf3ce18942ecb6c6bed4b208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20K=C4=85dzio=C5=82ka?= Date: Thu, 29 Aug 2019 20:23:50 +0200 Subject: [PATCH] test/asm: Generate .out.pipe files on the fly --- test/asm/test.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/asm/test.sh b/test/asm/test.sh index 23e4b7fe..7f4c1b79 100755 --- a/test/asm/test.sh +++ b/test/asm/test.sh @@ -9,11 +9,21 @@ for i in *.asm; do for variant in '' '.pipe'; do if [ -z "$variant" ]; then ../../rgbasm -o $o $i > $after 2>&1 + desired_output=${i%.asm}.out else + # Stop! This is not a Useless Use Of Cat. Using cat instead of + # stdin redirection makes the input an unseekable pipe - a scenario + # that's harder to deal with and was broken when the feature was + # first implemented. cat $i | ../../rgbasm -o $o - > $after 2>&1 + + # Escape regex metacharacters + desired_output=$before + subst="$(printf '%s\n' "$i" | sed 's:[][\/.^$*]:\\&:g')" + sed "s/$subst/-/g" ${i%.asm}.out > $desired_output fi - diff -u ${i%.asm}.out$variant $after + diff -u $desired_output $after rc=$(($? || $rc)) bin=${i%.asm}.out.bin if [ -f $bin ]; then