Increase RGBASM test coverage

This commit is contained in:
Rangi42
2025-08-13 10:56:32 -04:00
parent 92826a726a
commit 2bdf61da70
19 changed files with 94 additions and 18 deletions

10
test/link/pipeline/a.asm Normal file
View 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

Binary file not shown.

View File

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