Browse Source

Add ASM tests

master
Ben Kurtovic 8 years ago
parent
commit
8095143deb
12 changed files with 70 additions and 7 deletions
  1. +0
    -0
      tests/asm/01-empty.asm
  2. +8
    -0
      tests/asm/02-headers1.asm
  3. +8
    -0
      tests/asm/03-headers2.asm
  4. +13
    -0
      tests/asm/04-basic.asm
  5. +8
    -0
      tests/asm/05-includes.asm
  6. +13
    -0
      tests/asm/05.inc1.asm
  7. +3
    -0
      tests/asm/05.inc2.asm
  8. +2
    -0
      tests/asm/05.inc3.asm
  9. +3
    -0
      tests/asm/05.inc4.asm
  10. +5
    -1
      tests/asm/manifest
  11. BIN
     
  12. +7
    -6
      tests/runner.c

tests/asm/empty.asm → tests/asm/01-empty.asm View File


+ 8
- 0
tests/asm/02-headers1.asm View File

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

+ 8
- 0
tests/asm/03-headers2.asm View File

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

+ 13
- 0
tests/asm/04-basic.asm View File

@@ -0,0 +1,13 @@
.org $0000
main:
di
ld a, $23
inc a
call foo

foo:
push bc
xor c
ret z
rrca
ret

+ 8
- 0
tests/asm/05-includes.asm View File

@@ -0,0 +1,8 @@
.include "05.inc1.asm"

.org $0000
main:
di
ld c, $FA
inc c
call bar

+ 13
- 0
tests/asm/05.inc1.asm View File

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

+ 3
- 0
tests/asm/05.inc2.asm View File

@@ -0,0 +1,3 @@
testfunc:
sub b
ret

+ 2
- 0
tests/asm/05.inc3.asm View File

@@ -0,0 +1,2 @@
.include "05.inc4.asm"
.rom_product 57005

+ 3
- 0
tests/asm/05.inc4.asm View File

@@ -0,0 +1,3 @@
blah:
ei
ret

+ 5
- 1
tests/asm/manifest View File

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

BIN
View File


+ 7
- 6
tests/runner.c View File

@@ -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() \


Loading…
Cancel
Save