@@ -1,3 +1,11 @@ | |||||
;; Copyright (C) 2016 Ben Kurtovic <ben.kurtovic@gmail.com> | |||||
;; Released under the terms of the MIT License. See LICENSE for details. | |||||
; ----- CRATER UNIT TESTING SUITE --------------------------------------------- | |||||
; 02-headers1.asm | |||||
; Basic test for headers and other directives, mostly using default values | |||||
.rom_size auto | .rom_size auto | ||||
.rom_header auto | .rom_header auto | ||||
.rom_product 0 | .rom_product 0 | ||||
@@ -1,3 +1,11 @@ | |||||
;; Copyright (C) 2016 Ben Kurtovic <ben.kurtovic@gmail.com> | |||||
;; Released under the terms of the MIT License. See LICENSE for details. | |||||
; ----- CRATER UNIT TESTING SUITE --------------------------------------------- | |||||
; 03-headers2.asm | |||||
; Header/directive test using non-default values | |||||
.rom_size "64 KB" | .rom_size "64 KB" | ||||
.rom_header $7FF0 | .rom_header $7FF0 | ||||
.rom_product 101893 | .rom_product 101893 | ||||
@@ -1,3 +1,11 @@ | |||||
;; Copyright (C) 2016 Ben Kurtovic <ben.kurtovic@gmail.com> | |||||
;; Released under the terms of the MIT License. See LICENSE for details. | |||||
; ----- CRATER UNIT TESTING SUITE --------------------------------------------- | |||||
; 04-basic.asm | |||||
; Basic instruction test | |||||
.org $0000 | .org $0000 | ||||
main: | main: | ||||
di | di | ||||
@@ -1,3 +1,12 @@ | |||||
;; Copyright (C) 2016 Ben Kurtovic <ben.kurtovic@gmail.com> | |||||
;; Released under the terms of the MIT License. See LICENSE for details. | |||||
; ----- CRATER UNIT TESTING SUITE --------------------------------------------- | |||||
; 05-includes.asm | |||||
; Source file inclusion test, involving cross-file label references and complex | |||||
; origins | |||||
.include "05.inc1.asm" | .include "05.inc1.asm" | ||||
.org $0000 | .org $0000 | ||||
@@ -0,0 +1,15 @@ | |||||
;; Copyright (C) 2016 Ben Kurtovic <ben.kurtovic@gmail.com> | |||||
;; Released under the terms of the MIT License. See LICENSE for details. | |||||
; ----- CRATER UNIT TESTING SUITE --------------------------------------------- | |||||
; 06-formatting.asm | |||||
; Complex formatting test, involving strange indentation and newline usage | |||||
foo: .inCLUde "06.inc.asm" | |||||
.ORG $0100 | |||||
ayy: lmao: | |||||
di | |||||
ret |
@@ -0,0 +1,13 @@ | |||||
test1:test2: test3: test4: | |||||
inc a | |||||
inc b | |||||
inc c | |||||
ret | |||||
@@ -0,0 +1,31 @@ | |||||
;; Copyright (C) 2016 Ben Kurtovic <ben.kurtovic@gmail.com> | |||||
;; Released under the terms of the MIT License. See LICENSE for details. | |||||
; ----- CRATER UNIT TESTING SUITE --------------------------------------------- | |||||
; 07-data.asm | |||||
; Test of data directives to fill ROM with non-code bytes | |||||
.org $1000 | |||||
str1: .ascii "Hello, world!" | |||||
str2: .asciz "World, hello!" | |||||
str3: .asciiz "foobar" | |||||
arr1: .byte 1 2 3 4 5 6 | |||||
arr2: .byte 14 $14 $FF 255 $F0 | |||||
arr3: .byte 8, $10, 4 5 6, 8, 10 | |||||
void1: .space 3 | |||||
void2: .space 6 $D0 | |||||
void3: .space 128 $DE | |||||
.org $0000 | |||||
main: | |||||
di | |||||
loop: | |||||
jp loop | |||||
.org $0066 | |||||
nmi: | |||||
retn |
@@ -0,0 +1,7 @@ | |||||
;; Copyright (C) 2016 Ben Kurtovic <ben.kurtovic@gmail.com> | |||||
;; Released under the terms of the MIT License. See LICENSE for details. | |||||
; ----- CRATER UNIT TESTING SUITE --------------------------------------------- | |||||
; 08-instructions.asm | |||||
; Exhaustive test of instruction syntax |
@@ -3,3 +3,5 @@ | |||||
03-headers2.asm 03-headers2.gg | 03-headers2.asm 03-headers2.gg | ||||
04-basic.asm 04-basic.gg | 04-basic.asm 04-basic.gg | ||||
05-includes.asm 05-includes.gg | 05-includes.asm 05-includes.gg | ||||
06-formatting.asm 06-formatting.gg | |||||
07-data.asm 07-data.gg |
@@ -206,7 +206,7 @@ static bool test_asm() | |||||
*(split++) = '\0'; | *(split++) = '\0'; | ||||
if (!run_asm_test(line, split)) { | if (!run_asm_test(line, split)) { | ||||
fprintf(stderr, "test: %s -> %s\n", line, split); | |||||
fprintf(stderr, "in test: %s -> %s\n", line, split); | |||||
return false; | return false; | ||||
} | } | ||||
PASS_TEST() | PASS_TEST() | ||||