ref: d9f5ce339affacec318f41ebad77aa4a7a09be1b
parent: 361f1ac50b0239694b59fb79678a8fbb4ac962de
author: Anthony J. Bentley <[email protected]>
date: Mon Jan 26 23:33:38 EST 2015
Add some basic regression tests. Most cause crashes. Only macro-@ works correctly; the others need to be fixed.
--- /dev/null
+++ b/test/asm/bank-noexist.asm
@@ -1,0 +1,2 @@
+SECTION "sec", ROM0
+ db BANK(noexist)
--- /dev/null
+++ b/test/asm/bank-noexist.out
@@ -1,0 +1,2 @@
+ERROR: bank-noexist.asm(2) :
+ 'noexist' not defined
--- /dev/null
+++ b/test/asm/divzero-section-bank.asm
@@ -1,0 +1,1 @@
+SECTION "sec", ROMX[$/0]
--- /dev/null
+++ b/test/asm/divzero-section-bank.out
@@ -1,0 +1,3 @@
+ERROR: foo.asm(1) :
+ syntax error
+rgbasm: Assembly aborted in pass 1 (1 errors)!
--- /dev/null
+++ b/test/asm/[email protected]
@@ -1,0 +1,1 @@
+foo @bar
--- /dev/null
+++ b/test/asm/[email protected]
@@ -1,0 +1,2 @@
+ERROR: [email protected](1) -> @(-1) :
+ Macro '@' not defined
--- /dev/null
+++ b/test/asm/null-in-macro.asm
@@ -1,0 +1,2 @@
+foo: macro
+ --- /dev/null
+++ b/test/asm/test.sh
@@ -1,0 +1,7 @@
+fname=$(mktemp)
+
+for i in *.asm; do
+ ../../rgbasm $i >$fname 2>&1
+# diff -u $fname $(basename $i .asm).out
+ diff -u $fname ${i%.asm}.out
+done
--- /dev/null
+++ b/test/asm/undefined-dot.asm
@@ -1,0 +1,3 @@
+SECTION "sec", ROM0
+foo:
+ add sp, .
--- /dev/null
+++ b/test/asm/undefined-dot.out
@@ -1,0 +1,2 @@
+ERROR: undefined-dot.asm(3) :
+ '.' not defined