Add some basic regression tests.

Most cause crashes. Only macro-@ works correctly; the others need to
be fixed.
This commit is contained in:
Anthony J. Bentley
2015-01-27 04:33:38 -07:00
parent 361f1ac50b
commit d9f5ce339a
11 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
SECTION "sec", ROM0
db BANK(noexist)

View File

@@ -0,0 +1,2 @@
ERROR: bank-noexist.asm(2) :
'noexist' not defined

View File

@@ -0,0 +1 @@
SECTION "sec", ROMX[$/0]

View File

@@ -0,0 +1,3 @@
ERROR: foo.asm(1) :
syntax error
rgbasm: Assembly aborted in pass 1 (1 errors)!

1
test/asm/macro-@.asm Normal file
View File

@@ -0,0 +1 @@
foo @bar

2
test/asm/macro-@.out Normal file
View File

@@ -0,0 +1,2 @@
ERROR: macro-@.asm(1) -> @(-1) :
Macro '@' not defined

BIN
test/asm/null-in-macro.asm Normal file

Binary file not shown.

View File

7
test/asm/test.sh Normal file
View File

@@ -0,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

View File

@@ -0,0 +1,3 @@
SECTION "sec", ROM0
foo:
add sp, .

View File

@@ -0,0 +1,2 @@
ERROR: undefined-dot.asm(3) :
'.' not defined