shithub: rgbds

Download patch

ref: 35f7340dc91260d5a310a6f4a8b024834b113fb5
parent: b76567e7d17f70671b08097465b679777afe564d
author: ISSOtm <eldredhabert0@gmail.com>
date: Mon Feb 3 20:41:35 EST 2020

Report failing test names in RGBLINK as well

--- a/test/link/test.sh
+++ b/test/link/test.sh
@@ -7,6 +7,18 @@
 outtemp=$(mktemp)
 rc=0
 
+bold=$(tput bold)
+resbold=$(tput sgr0)
+red=$(tput setaf 1)
+rescolors=$(tput op)
+tryDiff () {
+	diff -u --strip-trailing-cr $1 $2 || (echo -e "${bold}${red}${i%.asm}.out mismatch!${rescolors}${resbold}"; false)
+}
+
+tryCmp () {
+	cmp $1 $2 || (echo -e "${bold}${red}${i%.asm}${variant}.out.bin mismatch!${rescolors}${resbold}"; false)
+}
+
 RGBASM=../../rgbasm
 RGBLINK=../../rgblink
 
@@ -18,13 +30,13 @@
 	for flag in '-d' '-t' '-w'; do
 		if [ -f ${i%.asm}-no${flag}.out ]; then
 			$RGBLINK -o $gbtemp $otemp > $outtemp 2>&1
-			diff --strip-trailing-cr ${i%.asm}-no${flag}.out $outtemp
+			tryDiff ${i%.asm}-no${flag}.out $outtemp
 			rc=$(($? || $rc))
 			ran_flag=1
 		fi
 		if [ -f ${i%.asm}${flag}.out ]; then
 			$RGBLINK ${flag} -o $gbtemp $otemp > $outtemp 2>&1
-			diff --strip-trailing-cr ${i%.asm}${flag}.out $outtemp
+			tryDiff ${i%.asm}${flag}.out $outtemp
 			rc=$(($? || $rc))
 			ran_flag=1
 		fi
@@ -36,7 +48,7 @@
 	# Other tests have several linker scripts
 	for script in `find . -name "${i%.asm}*.link"`; do
 		$RGBLINK -l $script -o $gbtemp $otemp > $outtemp 2>&1
-		diff --strip-trailing-cr ${script%.link}.out $outtemp
+		tryDiff ${script%.link}.out $outtemp
 		rc=$(($? || $rc))
 		ran_flag=1
 	done
@@ -47,7 +59,7 @@
 	# The rest of the tests just links a file, and maybe checks the binary
 	$RGBLINK -o $gbtemp $otemp > $outtemp 2>&1
 	if [ -f ${i%.asm}.out ]; then
-		diff --strip-trailing-cr ${i%.asm}.out $outtemp
+		tryDiff ${i%.asm}.out $outtemp
 		rc=$(($? || $rc))
 	fi
 
@@ -54,7 +66,7 @@
 	bin=${i%.asm}.out.bin
 	if [ -f $bin ]; then
 		dd if=$gbtemp count=1 bs=$(printf %s $(wc -c < $bin)) > $otemp 2>/dev/null
-		cmp $bin $otemp
+		tryCmp $bin $otemp
 		rc=$(($? || $rc))
 	fi
 done
@@ -64,7 +76,7 @@
 $RGBLINK -o $gbtemp $otemp
 $RGBASM -o $otemp high-low/b.asm
 $RGBLINK -o $gbtemp2 $otemp
-diff --strip-trailing-cr $gbtemp $gbtemp2
+i="high-low.asm" tryDiff $gbtemp $gbtemp2
 rc=$(($? || $rc))
 
 rm -f $otemp $gbtemp $gbtemp2 $outtemp