From 8095143debe8db0f864e18d19185b33fd5cf9c70 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Fri, 8 Apr 2016 11:31:30 -0500 Subject: [PATCH] Add ASM tests --- tests/asm/{empty.asm => 01-empty.asm} | 0 tests/asm/02-headers1.asm | 8 ++++++++ tests/asm/03-headers2.asm | 8 ++++++++ tests/asm/04-basic.asm | 13 +++++++++++++ tests/asm/05-includes.asm | 8 ++++++++ tests/asm/05.inc1.asm | 13 +++++++++++++ tests/asm/05.inc2.asm | 3 +++ tests/asm/05.inc3.asm | 2 ++ tests/asm/05.inc4.asm | 3 +++ tests/asm/manifest | 6 +++++- tests/asm/roms.tar.gz | Bin 194 -> 807 bytes tests/runner.c | 13 +++++++------ 12 files changed, 70 insertions(+), 7 deletions(-) rename tests/asm/{empty.asm => 01-empty.asm} (100%) create mode 100644 tests/asm/02-headers1.asm create mode 100644 tests/asm/03-headers2.asm create mode 100644 tests/asm/04-basic.asm create mode 100644 tests/asm/05-includes.asm create mode 100644 tests/asm/05.inc1.asm create mode 100644 tests/asm/05.inc2.asm create mode 100644 tests/asm/05.inc3.asm create mode 100644 tests/asm/05.inc4.asm diff --git a/tests/asm/empty.asm b/tests/asm/01-empty.asm similarity index 100% rename from tests/asm/empty.asm rename to tests/asm/01-empty.asm diff --git a/tests/asm/02-headers1.asm b/tests/asm/02-headers1.asm new file mode 100644 index 0000000..a991487 --- /dev/null +++ b/tests/asm/02-headers1.asm @@ -0,0 +1,8 @@ +.rom_size auto +.rom_header auto +.rom_product 0 +.rom_version 0 +.rom_region "GG Export" +.rom_checksum off +.rom_declsize auto +.cross_blocks auto diff --git a/tests/asm/03-headers2.asm b/tests/asm/03-headers2.asm new file mode 100644 index 0000000..9ebea50 --- /dev/null +++ b/tests/asm/03-headers2.asm @@ -0,0 +1,8 @@ +.rom_size "64 KB" +.rom_header $7FF0 +.rom_product 101893 +.rom_version 3 +.rom_region "GG International" +.rom_checksum on +.rom_declsize "32 KB" +.cross_blocks off diff --git a/tests/asm/04-basic.asm b/tests/asm/04-basic.asm new file mode 100644 index 0000000..8a8d034 --- /dev/null +++ b/tests/asm/04-basic.asm @@ -0,0 +1,13 @@ +.org $0000 +main: + di + ld a, $23 + inc a + call foo + +foo: + push bc + xor c + ret z + rrca + ret diff --git a/tests/asm/05-includes.asm b/tests/asm/05-includes.asm new file mode 100644 index 0000000..46e80c8 --- /dev/null +++ b/tests/asm/05-includes.asm @@ -0,0 +1,8 @@ +.include "05.inc1.asm" + +.org $0000 +main: + di + ld c, $FA + inc c + call bar diff --git a/tests/asm/05.inc1.asm b/tests/asm/05.inc1.asm new file mode 100644 index 0000000..1a2fe8c --- /dev/null +++ b/tests/asm/05.inc1.asm @@ -0,0 +1,13 @@ +.org $0100 + +.include "05.inc2.asm" +.include "05.inc3.asm" + +bar: + push de + call blah + xor d + ret pe + call testfunc + exx + ret diff --git a/tests/asm/05.inc2.asm b/tests/asm/05.inc2.asm new file mode 100644 index 0000000..83b7a98 --- /dev/null +++ b/tests/asm/05.inc2.asm @@ -0,0 +1,3 @@ +testfunc: + sub b + ret diff --git a/tests/asm/05.inc3.asm b/tests/asm/05.inc3.asm new file mode 100644 index 0000000..aa42dc4 --- /dev/null +++ b/tests/asm/05.inc3.asm @@ -0,0 +1,2 @@ +.include "05.inc4.asm" +.rom_product 57005 diff --git a/tests/asm/05.inc4.asm b/tests/asm/05.inc4.asm new file mode 100644 index 0000000..4e2f059 --- /dev/null +++ b/tests/asm/05.inc4.asm @@ -0,0 +1,3 @@ +blah: + ei + ret diff --git a/tests/asm/manifest b/tests/asm/manifest index d0eedad..267f419 100644 --- a/tests/asm/manifest +++ b/tests/asm/manifest @@ -1 +1,5 @@ -empty.asm empty.gg +01-empty.asm 01-empty.gg +02-headers1.asm 02-headers1.gg +03-headers2.asm 03-headers2.gg +04-basic.asm 04-basic.gg +05-includes.asm 05-includes.gg diff --git a/tests/asm/roms.tar.gz b/tests/asm/roms.tar.gz index 7714e891e2f2fc1bb40c19b39d79d0f89bc48098..dfb1ed91f45f6b4ddf811315b9781bbb7dd3bab6 100644 GIT binary patch literal 807 zcmb2|=3qE{hdrEu`R%2RSvsK->>r9wl}F zc|!e;f8JVr_(sa6XEtHqcbrdul+S=4{E)Y@v^jPBH+!|_-aS5=u_b?V)K{&&{`g(a zo)@RTmCTZhbulTO`+ifd+v%RHt^FFOO{cHwz0~(=m8RvXyxZ@V$@IrRU5MT8q|5IG z@mtPd_VCFE4f*%-Zu5KGzf*U#}LPd+*8bHv@pcJn)Z_q!9Y_(sd*!;5S7)Nh!6>GWxNyZ;|= z`+jG{ucx8D85ApfOK*LBzJA;C%U?v47Oi|;GdOM$$kInv*+)tZvA|Fzy1Hd+)g*2UDu7@ zYK9N{=E%rBef+n1@05Mk{*YL5i+=t&T>N_abCWk`;@1% zysx@ty8CMS_61E33hFz){?moh`m4HaTFW2*ytOki$0)K`ZgusY=f)quUADL1`S-)o zW%HjNtEvBd{p{@9{BeK&9M7%#`1|a#*MwX)5AL!$$@-F?UtO6%Iv&`+l>fD<*@Z!Y GnE?O@fmP@L literal 194 zcmb2|=3r1OVGn0uetX_9?~sE4>jhh Uc~I3qg!eH#(0gUhuz-O90Qa#>jsO4v diff --git a/tests/runner.c b/tests/runner.c index 5a62358..3c54e34 100644 --- a/tests/runner.c +++ b/tests/runner.c @@ -23,12 +23,13 @@ pending_nl = true; \ } while(0); -#define FAIL_TEST(format, ...) \ - do { \ - printf("F\n"); \ - fprintf(stderr, "***** FAILURE *****\n" format "\n", __VA_ARGS__); \ - failed_tests++; \ - pending_nl = false; \ +#define FAIL_MSG "***** FAILURE *****" +#define FAIL_TEST(format, ...) \ + do { \ + printf("F\n"); \ + fprintf(stderr, FAIL_MSG "\n" format "\n", __VA_ARGS__); \ + failed_tests++; \ + pending_nl = false; \ } while(0); #define READY_STDOUT() \