aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-10-06 17:33:16 +0200
committerMiquel Sabaté Solà <mssola@mssola.com>2026-10-06 17:33:16 +0200
commite71a73d0875c416507a3207bdec6fee145a79f68 (patch)
tree23bb734234b1e78d59333ef39f6a24937fae8c25 /scripts
parent4bf12db91feb5db98d65b518dbad0c1a8c6748df (diff)
downloadtools.nes-e71a73d0875c416507a3207bdec6fee145a79f68.tar.gz
tools.nes-e71a73d0875c416507a3207bdec6fee145a79f68.zip
Don't error out on conditional .include
The hard requirement that an .include statement cannot be inside of another block was, in the end, a bit short-sighted. Imagine the following block: .ifdef DEBUG .include "debug.s" .endif This is perfectly sound-looking code, and it should not be punished as the developer is doing something that is not bending the assembler in weird ways. Hence, just nuke this check. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/test-e2e.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/test-e2e.sh b/scripts/test-e2e.sh
index 21c4c7f..0cf37f0 100755
--- a/scripts/test-e2e.sh
+++ b/scripts/test-e2e.sh
@@ -154,6 +154,21 @@ exit_code=$((exit_code + $?))
diff tests/out/out.nes tests/expected/out.nes
exit_code=$((exit_code + $?))
+echo "test: custom => conditionally_include.nes"
+# No DEBUG
+./target/debug/nasm -c empty -Werror --asan -o tests/out/conditionally_include.nes tests/conditionally_include.s 2> tests/out/conditionally_include.txt
+diff tests/out/conditionally_include.txt tests/expected/conditionally_include.txt
+exit_code=$((exit_code + $?))
+diff tests/out/conditionally_include.nes tests/expected/conditionally_include.nes
+exit_code=$((exit_code + $?))
+
+# With DEBUG
+./target/debug/nasm -c empty -Werror --asan -o tests/out/conditionally_include_debug.nes -D DEBUG=1 tests/conditionally_include.s 2> tests/out/conditionally_include_debug.txt
+diff tests/out/conditionally_include_debug.txt tests/expected/conditionally_include_debug.txt
+exit_code=$((exit_code + $?))
+diff tests/out/conditionally_include_debug.nes tests/expected/conditionally_include_debug.nes
+exit_code=$((exit_code + $?))
+
##
# code.nes