shithub: rgbds

Download patch

ref: 587159448aa226ecc7039f4a91fe652b38c42281
parent: 64158cf513b878f2d916ba265c75bc85d5a13186
author: yenatch <yenatch@gmail.com>
date: Sat Jun 30 19:26:48 EDT 2018

Test binary output for rgbasm tests

--- a/test/asm/test.sh
+++ b/test/asm/test.sh
@@ -1,11 +1,23 @@
 #!/bin/sh
-fname=$(mktemp)
+o=$(mktemp)
+gb=$(mktemp)
+before=$(mktemp)
+after=$(mktemp)
 rc=0
 
 for i in *.asm; do
-	../../rgbasm $i >$fname 2>&1
-	diff -u $fname ${i%.asm}.out
+	../../rgbasm -o $o $i > $after 2>&1
+	diff -u ${i%.asm}.out $after
 	rc=$(($? || $rc))
+	bin=${i%.asm}.out.bin
+	if [ -f $bin ]; then
+		../../rgblink -o $gb $o > $after 2>&1
+		head -c $(wc -c < $bin) $gb > $after 2>&1
+		hexdump -C $after > $before && mv $before $after
+		hexdump -C $bin > $before
+		diff -u $before $after
+		rc=$(($? || $rc))
+	fi
 done
 
 exit $rc
--- /dev/null
+++ b/test/asm/utf-8.out.bin
@@ -1,0 +1,1 @@
\ No newline at end of file