From d9f5ce339affacec318f41ebad77aa4a7a09be1b Mon Sep 17 00:00:00 2001 From: "Anthony J. Bentley" Date: Tue, 27 Jan 2015 04:33:38 -0700 Subject: [PATCH] Add some basic regression tests. Most cause crashes. Only macro-@ works correctly; the others need to be fixed. --- test/asm/bank-noexist.asm | 2 ++ test/asm/bank-noexist.out | 2 ++ test/asm/divzero-section-bank.asm | 1 + test/asm/divzero-section-bank.out | 3 +++ test/asm/macro-@.asm | 1 + test/asm/macro-@.out | 2 ++ test/asm/null-in-macro.asm | Bin 0 -> 15 bytes test/asm/null-in-macro.out | 0 test/asm/test.sh | 7 +++++++ test/asm/undefined-dot.asm | 3 +++ test/asm/undefined-dot.out | 2 ++ 11 files changed, 23 insertions(+) create mode 100644 test/asm/bank-noexist.asm create mode 100644 test/asm/bank-noexist.out create mode 100644 test/asm/divzero-section-bank.asm create mode 100644 test/asm/divzero-section-bank.out create mode 100644 test/asm/macro-@.asm create mode 100644 test/asm/macro-@.out create mode 100644 test/asm/null-in-macro.asm create mode 100644 test/asm/null-in-macro.out create mode 100644 test/asm/test.sh create mode 100644 test/asm/undefined-dot.asm create mode 100644 test/asm/undefined-dot.out diff --git a/test/asm/bank-noexist.asm b/test/asm/bank-noexist.asm new file mode 100644 index 00000000..e8826ac6 --- /dev/null +++ b/test/asm/bank-noexist.asm @@ -0,0 +1,2 @@ +SECTION "sec", ROM0 + db BANK(noexist) diff --git a/test/asm/bank-noexist.out b/test/asm/bank-noexist.out new file mode 100644 index 00000000..33c3e439 --- /dev/null +++ b/test/asm/bank-noexist.out @@ -0,0 +1,2 @@ +ERROR: bank-noexist.asm(2) : + 'noexist' not defined diff --git a/test/asm/divzero-section-bank.asm b/test/asm/divzero-section-bank.asm new file mode 100644 index 00000000..10ac53e0 --- /dev/null +++ b/test/asm/divzero-section-bank.asm @@ -0,0 +1 @@ +SECTION "sec", ROMX[$/0] diff --git a/test/asm/divzero-section-bank.out b/test/asm/divzero-section-bank.out new file mode 100644 index 00000000..c79c772c --- /dev/null +++ b/test/asm/divzero-section-bank.out @@ -0,0 +1,3 @@ +ERROR: foo.asm(1) : + syntax error +rgbasm: Assembly aborted in pass 1 (1 errors)! diff --git a/test/asm/macro-@.asm b/test/asm/macro-@.asm new file mode 100644 index 00000000..afd2711a --- /dev/null +++ b/test/asm/macro-@.asm @@ -0,0 +1 @@ +foo @bar diff --git a/test/asm/macro-@.out b/test/asm/macro-@.out new file mode 100644 index 00000000..8ad32e0f --- /dev/null +++ b/test/asm/macro-@.out @@ -0,0 +1,2 @@ +ERROR: macro-@.asm(1) -> @(-1) : + Macro '@' not defined diff --git a/test/asm/null-in-macro.asm b/test/asm/null-in-macro.asm new file mode 100644 index 0000000000000000000000000000000000000000..c9f87a3db649b187390074c2dd3139012bb8803e GIT binary patch literal 15 WcmYex&$m*@O-wGz=i+2Y$fname 2>&1 +# diff -u $fname $(basename $i .asm).out + diff -u $fname ${i%.asm}.out +done diff --git a/test/asm/undefined-dot.asm b/test/asm/undefined-dot.asm new file mode 100644 index 00000000..a30baee1 --- /dev/null +++ b/test/asm/undefined-dot.asm @@ -0,0 +1,3 @@ +SECTION "sec", ROM0 +foo: + add sp, . diff --git a/test/asm/undefined-dot.out b/test/asm/undefined-dot.out new file mode 100644 index 00000000..f6b05bf9 --- /dev/null +++ b/test/asm/undefined-dot.out @@ -0,0 +1,2 @@ +ERROR: undefined-dot.asm(3) : + '.' not defined