mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-22 11:12:07 +00:00
Increase RGBASM test coverage
This commit is contained in:
3
test/asm/abort-on-missing-incbin-slice.asm
Normal file
3
test/asm/abort-on-missing-incbin-slice.asm
Normal file
@@ -0,0 +1,3 @@
|
||||
section "test", rom0
|
||||
incbin "incbin-mg-noexist.bin", 0, 2
|
||||
println "never reached"
|
||||
1
test/asm/abort-on-missing-incbin-slice.flags
Normal file
1
test/asm/abort-on-missing-incbin-slice.flags
Normal file
@@ -0,0 +1 @@
|
||||
-MG
|
||||
3
test/asm/abort-on-missing-incbin.asm
Normal file
3
test/asm/abort-on-missing-incbin.asm
Normal file
@@ -0,0 +1,3 @@
|
||||
section "test", rom0
|
||||
incbin "incbin-mg-noexist.bin", 2
|
||||
println "never reached"
|
||||
1
test/asm/abort-on-missing-incbin.flags
Normal file
1
test/asm/abort-on-missing-incbin.flags
Normal file
@@ -0,0 +1 @@
|
||||
-MG
|
||||
15
test/asm/deprecated-functions.asm
Normal file
15
test/asm/deprecated-functions.asm
Normal file
@@ -0,0 +1,15 @@
|
||||
opt Wno-unmapped-char
|
||||
def s equs "Hello world!"
|
||||
|
||||
assert strin(#s, "l") == strfind(#s, "l") + 1
|
||||
assert strrin(#s, "l") == strrfind(#s, "l") + 1
|
||||
|
||||
assert !strcmp(strsub(#s, 7), strslice(#s, 6))
|
||||
assert !strcmp(strsub(#s, 7, 5), strslice(#s, 6, 11))
|
||||
assert !strcmp(strsub(#s, strlen(#s), 1), strslice(#s, strlen(#s) - 1, strlen(#s)))
|
||||
assert !strcmp(strsub(#s, 7, 999), strslice(#s, 6, 999))
|
||||
|
||||
assert !strcmp(charsub(#s, 12), strchar(#s, 11))
|
||||
assert !strcmp(charsub(#s, -1), strchar(#s, -1))
|
||||
assert !strcmp(charsub(#s, -999), strchar(#s, -999))
|
||||
assert !strcmp(charsub(#s, 999), strchar(#s, 999))
|
||||
32
test/asm/deprecated-functions.err
Normal file
32
test/asm/deprecated-functions.err
Normal file
@@ -0,0 +1,32 @@
|
||||
warning: `STRIN` is deprecated; use 0-indexed `STRFIND` instead [-Wobsolete]
|
||||
at deprecated-functions.asm(4)
|
||||
warning: `STRRIN` is deprecated; use 0-indexed `STRRFIND` instead [-Wobsolete]
|
||||
at deprecated-functions.asm(5)
|
||||
warning: `STRSUB` is deprecated; use 0-indexed `STRSLICE` instead [-Wobsolete]
|
||||
at deprecated-functions.asm(7)
|
||||
warning: `STRSUB` is deprecated; use 0-indexed `STRSLICE` instead [-Wobsolete]
|
||||
at deprecated-functions.asm(8)
|
||||
warning: `STRSUB` is deprecated; use 0-indexed `STRSLICE` instead [-Wobsolete]
|
||||
at deprecated-functions.asm(9)
|
||||
warning: `STRSUB` is deprecated; use 0-indexed `STRSLICE` instead [-Wobsolete]
|
||||
at deprecated-functions.asm(10)
|
||||
warning: STRSUB: Length too big: 999 [-Wbuiltin-args]
|
||||
at deprecated-functions.asm(10)
|
||||
warning: STRSLICE: Stop index 999 is past the end of the string [-Wbuiltin-args]
|
||||
at deprecated-functions.asm(10)
|
||||
warning: `CHARSUB` is deprecated; use 0-indexed `STRCHAR` instead [-Wobsolete]
|
||||
at deprecated-functions.asm(12)
|
||||
warning: `CHARSUB` is deprecated; use 0-indexed `STRCHAR` instead [-Wobsolete]
|
||||
at deprecated-functions.asm(13)
|
||||
warning: `CHARSUB` is deprecated; use 0-indexed `STRCHAR` instead [-Wobsolete]
|
||||
at deprecated-functions.asm(14)
|
||||
warning: CHARSUB: Position starts at 1 [-Wbuiltin-args]
|
||||
at deprecated-functions.asm(14)
|
||||
warning: STRCHAR: Index starts at 0 [-Wbuiltin-args]
|
||||
at deprecated-functions.asm(14)
|
||||
warning: `CHARSUB` is deprecated; use 0-indexed `STRCHAR` instead [-Wobsolete]
|
||||
at deprecated-functions.asm(15)
|
||||
warning: CHARSUB: Position 999 is past the end of the string [-Wbuiltin-args]
|
||||
at deprecated-functions.asm(15)
|
||||
warning: STRCHAR: Index 999 is past the end of the string [-Wbuiltin-args]
|
||||
at deprecated-functions.asm(15)
|
||||
@@ -4,7 +4,9 @@ PUSHS
|
||||
SECTION "test", WRAM0
|
||||
UNION
|
||||
INCLUDE "does not exist"
|
||||
/*
|
||||
ENDU
|
||||
POPS
|
||||
POPO
|
||||
POPC
|
||||
*/
|
||||
|
||||
2
test/asm/readfile-max-mg.asm
Normal file
2
test/asm/readfile-max-mg.asm
Normal file
@@ -0,0 +1,2 @@
|
||||
def s equs readfile("readfile-mg-noexist.inc", $ff)
|
||||
println "unreached"
|
||||
1
test/asm/readfile-max-mg.flags
Normal file
1
test/asm/readfile-max-mg.flags
Normal file
@@ -0,0 +1 @@
|
||||
-MG
|
||||
2
test/asm/readfile-mg.asm
Normal file
2
test/asm/readfile-mg.asm
Normal file
@@ -0,0 +1,2 @@
|
||||
def s equs readfile("readfile-mg-noexist.inc")
|
||||
println "unreached"
|
||||
1
test/asm/readfile-mg.flags
Normal file
1
test/asm/readfile-mg.flags
Normal file
@@ -0,0 +1 @@
|
||||
-MG
|
||||
10
test/link/pipeline/a.asm
Normal file
10
test/link/pipeline/a.asm
Normal file
@@ -0,0 +1,10 @@
|
||||
section "test", rom0
|
||||
db 1, 4, 9, 16
|
||||
|
||||
section "entrypoint", rom0[$100]
|
||||
ld b, b
|
||||
jp Start
|
||||
|
||||
section "start", rom0[$150]
|
||||
Start::
|
||||
jp Start
|
||||
BIN
test/link/pipeline/out.gb
Normal file
BIN
test/link/pipeline/out.gb
Normal file
Binary file not shown.
@@ -26,6 +26,7 @@ rescolors="$(tput op)"
|
||||
|
||||
RGBASM=../../rgbasm
|
||||
RGBLINK=../../rgblink
|
||||
RGBFIX=../../rgbfix
|
||||
|
||||
startTest () {
|
||||
echo "${bold}${green}${test} assembling...${rescolors}${resbold}"
|
||||
@@ -71,7 +72,7 @@ tryCmpRomSize () {
|
||||
}
|
||||
|
||||
rgblinkQuiet () {
|
||||
out="$(env $RGBLINK -Weverything -B collapse "$@")" || return $?
|
||||
out="$(env "$RGBLINK" -Weverything -B collapse "$@")" || return $?
|
||||
if [[ -n "$out" ]]; then
|
||||
echo "$bold${red}Linking shouldn't produce anything on stdout!${rescolors}${resbold}"
|
||||
false
|
||||
@@ -251,6 +252,16 @@ tryDiff "$test"/out.err "$outtemp"
|
||||
tryCmp "$test"/out.gb "$gbtemp"
|
||||
evaluateTest
|
||||
|
||||
test="pipeline"
|
||||
startTest
|
||||
continueTest
|
||||
("$RGBASM" -Weverything -B collapse -o - - | \
|
||||
"$RGBLINK" -Weverything -B collapse -o - - | \
|
||||
"$RGBFIX" -Weverything -v -p 0xff -) < "$test"/a.asm > "$gbtemp"
|
||||
# This test does not trim its output with 'dd' because it needs to verify the correct output size
|
||||
tryCmp "$test"/out.gb "$gbtemp"
|
||||
evaluateTest
|
||||
|
||||
test="same-consts"
|
||||
startTest
|
||||
"$RGBASM" -o "$otemp" "$test"/a.asm
|
||||
|
||||
Reference in New Issue
Block a user