From 6f69867d0421d86127f0afa8a07e1f2f8b1c029e Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Wed, 16 Sep 2026 18:13:10 -0400 Subject: [PATCH] Make more RGBLINK tests use at-files Less special handling = good Possibly this can be done to more tests, but this is what I found. --- .../link/{rept-trace/a.asm => rept-trace.asm} | 0 test/link/rept-trace.flags | 1 + test/link/rept-trace.out | 17 +++++++++++++ test/link/rept-trace/out.err | 17 ------------- test/link/scramble-bad-region.asm | 2 ++ test/link/scramble-bad-region.flags | 1 + test/link/scramble-bad-region.out | 2 ++ test/link/test.sh | 25 +------------------ .../level1/a.asm => truncation1.asm} | 0 test/link/truncation1.flags | 1 + .../level1/out.err => truncation1.out} | 2 +- .../level2/a.asm => truncation2.asm} | 0 test/link/truncation2.flags | 1 + .../level2/out.err => truncation2.out} | 4 +-- 14 files changed, 29 insertions(+), 44 deletions(-) rename test/link/{rept-trace/a.asm => rept-trace.asm} (100%) create mode 100644 test/link/rept-trace.flags create mode 100644 test/link/rept-trace.out delete mode 100644 test/link/rept-trace/out.err create mode 100644 test/link/scramble-bad-region.asm create mode 100644 test/link/scramble-bad-region.flags create mode 100644 test/link/scramble-bad-region.out rename test/link/{truncation/level1/a.asm => truncation1.asm} (100%) create mode 100644 test/link/truncation1.flags rename test/link/{truncation/level1/out.err => truncation1.out} (68%) rename test/link/{truncation/level2/a.asm => truncation2.asm} (100%) create mode 100644 test/link/truncation2.flags rename test/link/{truncation/level2/out.err => truncation2.out} (68%) diff --git a/test/link/rept-trace/a.asm b/test/link/rept-trace.asm similarity index 100% rename from test/link/rept-trace/a.asm rename to test/link/rept-trace.asm diff --git a/test/link/rept-trace.flags b/test/link/rept-trace.flags new file mode 100644 index 00000000..50f0633e --- /dev/null +++ b/test/link/rept-trace.flags @@ -0,0 +1 @@ +-Bno-collapse diff --git a/test/link/rept-trace.out b/test/link/rept-trace.out new file mode 100644 index 00000000..95d4d13f --- /dev/null +++ b/test/link/rept-trace.out @@ -0,0 +1,17 @@ +error: assert failure + at rept-trace.asm::REPT~4::REPT~3::REPT~2::REPT~1::m(10) + <- rept-trace.asm::REPT~4::REPT~3::REPT~2::REPT~1::REPT~1(15) + <- rept-trace.asm::REPT~4::REPT~3::REPT~2::REPT~1(14) + <- rept-trace.asm::REPT~4::REPT~3::REPT~2(13) + <- rept-trace.asm::REPT~4::REPT~3(6) + <- rept-trace.asm::REPT~4(4) + <- rept-trace.asm(2) +error: assert failure + at rept-trace.asm::REPT~4::REPT~3::REPT~2::REPT~1::m(10) + <- rept-trace.asm::REPT~4::REPT~3::REPT~2::REPT~1::REPT~2(15) + <- rept-trace.asm::REPT~4::REPT~3::REPT~2::REPT~1(14) + <- rept-trace.asm::REPT~4::REPT~3::REPT~2(13) + <- rept-trace.asm::REPT~4::REPT~3(6) + <- rept-trace.asm::REPT~4(4) + <- rept-trace.asm(2) +Linking failed with 2 errors diff --git a/test/link/rept-trace/out.err b/test/link/rept-trace/out.err deleted file mode 100644 index 74715269..00000000 --- a/test/link/rept-trace/out.err +++ /dev/null @@ -1,17 +0,0 @@ -error: assert failure - at rept-trace/a.asm::REPT~4::REPT~3::REPT~2::REPT~1::m(10) - <- rept-trace/a.asm::REPT~4::REPT~3::REPT~2::REPT~1::REPT~1(15) - <- rept-trace/a.asm::REPT~4::REPT~3::REPT~2::REPT~1(14) - <- rept-trace/a.asm::REPT~4::REPT~3::REPT~2(13) - <- rept-trace/a.asm::REPT~4::REPT~3(6) - <- rept-trace/a.asm::REPT~4(4) - <- rept-trace/a.asm(2) -error: assert failure - at rept-trace/a.asm::REPT~4::REPT~3::REPT~2::REPT~1::m(10) - <- rept-trace/a.asm::REPT~4::REPT~3::REPT~2::REPT~1::REPT~2(15) - <- rept-trace/a.asm::REPT~4::REPT~3::REPT~2::REPT~1(14) - <- rept-trace/a.asm::REPT~4::REPT~3::REPT~2(13) - <- rept-trace/a.asm::REPT~4::REPT~3(6) - <- rept-trace/a.asm::REPT~4(4) - <- rept-trace/a.asm(2) -Linking failed with 2 errors diff --git a/test/link/scramble-bad-region.asm b/test/link/scramble-bad-region.asm new file mode 100644 index 00000000..58cd5c5d --- /dev/null +++ b/test/link/scramble-bad-region.asm @@ -0,0 +1,2 @@ +SECTION "test", ROM0 +db 1, 2, 3 diff --git a/test/link/scramble-bad-region.flags b/test/link/scramble-bad-region.flags new file mode 100644 index 00000000..57125d29 --- /dev/null +++ b/test/link/scramble-bad-region.flags @@ -0,0 +1 @@ +-S r0mx=4 diff --git a/test/link/scramble-bad-region.out b/test/link/scramble-bad-region.out new file mode 100644 index 00000000..987d5ad4 --- /dev/null +++ b/test/link/scramble-bad-region.out @@ -0,0 +1,2 @@ +FATAL: Unknown region name "r0mx" in spec for option '-S' +Linking aborted with 1 error diff --git a/test/link/test.sh b/test/link/test.sh index a4c39ab2..63a0085b 100755 --- a/test/link/test.sh +++ b/test/link/test.sh @@ -312,14 +312,6 @@ continueTest tryCmp "$test"/out.gb "$gbtemp" evaluateTest -test="rept-trace" -startTest -"$RGBASM" -o "$otemp" "$test"/a.asm -continueTest -rgblinkQuiet -Bno-collapse -o "$gbtemp" "$otemp" 2>"$outtemp" -tryDiff "$test"/out.err "$outtemp" -evaluateTest - test="same-consts" startTest "$RGBASM" -o "$otemp" "$test"/a.asm @@ -333,6 +325,7 @@ test="scramble-invalid" startTest "$RGBASM" -o "$otemp" "$test"/a.asm continueTest +# This `-S` argument contains spaces, so cannot be specified in a .flags file. rgblinkQuiet -o "$gbtemp" -S "romx := 4" "$otemp" 2>"$outtemp" tryDiff "$test"/out.err "$outtemp" evaluateTest @@ -523,22 +516,6 @@ rgblinkQuiet "$otemp" "$gbtemp" "$gbtemp2" "$outtemp" "$outtemp2" 2>"$outtemp3" tryDiff "$test"/out.err "$outtemp3" evaluateTest -test="truncation/level1" -startTest -"$RGBASM" -o "$otemp" "$test"/a.asm -continueTest -rgblinkQuiet -Wtruncation=1 -o "$gbtemp" "$otemp" 2>"$outtemp" -tryDiff "$test"/out.err "$outtemp" -evaluateTest - -test="truncation/level2" -startTest -"$RGBASM" -o "$otemp" "$test"/a.asm -continueTest -rgblinkQuiet -Wtruncation=2 -o "$gbtemp" "$otemp" 2>"$outtemp" -tryDiff "$test"/out.err "$outtemp" -evaluateTest - if [[ "$failed" -eq 0 ]]; then echo "${bold}${green}All ${tests} tests passed!${rescolors}${resbold}" else diff --git a/test/link/truncation/level1/a.asm b/test/link/truncation1.asm similarity index 100% rename from test/link/truncation/level1/a.asm rename to test/link/truncation1.asm diff --git a/test/link/truncation1.flags b/test/link/truncation1.flags new file mode 100644 index 00000000..3cdfca07 --- /dev/null +++ b/test/link/truncation1.flags @@ -0,0 +1 @@ +-Wtruncation=1 diff --git a/test/link/truncation/level1/out.err b/test/link/truncation1.out similarity index 68% rename from test/link/truncation/level1/out.err rename to test/link/truncation1.out index 4b33068e..2aa0db63 100644 --- a/test/link/truncation/level1/out.err +++ b/test/link/truncation1.out @@ -1,2 +1,2 @@ warning: Value $fffe8000 (may be negative?) is not 16-bit [-Wtruncation] - at truncation/level1/a.asm(3) + at truncation1.asm(3) diff --git a/test/link/truncation/level2/a.asm b/test/link/truncation2.asm similarity index 100% rename from test/link/truncation/level2/a.asm rename to test/link/truncation2.asm diff --git a/test/link/truncation2.flags b/test/link/truncation2.flags new file mode 100644 index 00000000..534075f8 --- /dev/null +++ b/test/link/truncation2.flags @@ -0,0 +1 @@ +-Wtruncation=2 diff --git a/test/link/truncation/level2/out.err b/test/link/truncation2.out similarity index 68% rename from test/link/truncation/level2/out.err rename to test/link/truncation2.out index eec42e89..8dc06552 100644 --- a/test/link/truncation/level2/out.err +++ b/test/link/truncation2.out @@ -1,4 +1,4 @@ warning: Value $fffe8000 (may be negative?) is not 16-bit [-Wtruncation] - at truncation/level2/a.asm(3) + at truncation2.asm(3) warning: Value $ffff4000 (may be negative?) is not 16-bit [-Wtruncation] - at truncation/level2/a.asm(2) + at truncation2.asm(2)