From 297a11fcec5ae5478f6015fd177bbe64295532b4 Mon Sep 17 00:00:00 2001 From: Spiro Trikaliotis Date: Sat, 18 Jun 2022 22:22:27 +0200 Subject: [PATCH] Add more assert tests --- test/asm/listing/031-assert-error.err | 0 test/asm/listing/031-assert-error.err-ref | 2 ++ test/asm/listing/031-assert-error.no-ld65 | 0 test/asm/listing/031-assert-error.s | 28 +++++++++++++++++++ test/asm/listing/032-assert-error2.err | 0 .../asm/listing/032-assert-error2.ld65err-ref | 1 + test/asm/listing/032-assert-error2.s | 8 ++++++ test/asm/listing/032-assert-error3.err | 0 .../asm/listing/032-assert-error3.ld65err-ref | 1 + test/asm/listing/032-assert-error3.s | 8 ++++++ test/asm/listing/Makefile | 28 +++++++++++++++---- 11 files changed, 70 insertions(+), 6 deletions(-) create mode 100644 test/asm/listing/031-assert-error.err create mode 100644 test/asm/listing/031-assert-error.err-ref create mode 100644 test/asm/listing/031-assert-error.no-ld65 create mode 100644 test/asm/listing/031-assert-error.s create mode 100644 test/asm/listing/032-assert-error2.err create mode 100644 test/asm/listing/032-assert-error2.ld65err-ref create mode 100644 test/asm/listing/032-assert-error2.s create mode 100644 test/asm/listing/032-assert-error3.err create mode 100644 test/asm/listing/032-assert-error3.ld65err-ref create mode 100644 test/asm/listing/032-assert-error3.s diff --git a/test/asm/listing/031-assert-error.err b/test/asm/listing/031-assert-error.err new file mode 100644 index 000000000..e69de29bb diff --git a/test/asm/listing/031-assert-error.err-ref b/test/asm/listing/031-assert-error.err-ref new file mode 100644 index 000000000..f5cd108ac --- /dev/null +++ b/test/asm/listing/031-assert-error.err-ref @@ -0,0 +1,2 @@ +031-assert-error.s:27: Error: Code not at $8001 +031-assert-error.s:28: Error: Code not at $8001 diff --git a/test/asm/listing/031-assert-error.no-ld65 b/test/asm/listing/031-assert-error.no-ld65 new file mode 100644 index 000000000..e69de29bb diff --git a/test/asm/listing/031-assert-error.s b/test/asm/listing/031-assert-error.s new file mode 100644 index 000000000..4aafb560b --- /dev/null +++ b/test/asm/listing/031-assert-error.s @@ -0,0 +1,28 @@ +; 2022-06-15 Spiro Trikaliotis + + .ASSERT * = $0000, error, "Code not at $0000" + .assert * = $0000, error, "Code not at $0000" + + .ASSERT * = $0001, error, "Code not at $0001" + .assert * = $0001, error, "Code not at $0001" + + .ASSERT * = $1000, error, "Code not at $1000" + .assert * = $1000, error, "Code not at $1000" + + .ASSERT * = $1001, error, "Code not at $1001" + .assert * = $1001, error, "Code not at $1001" + + .ASSERT * = $8000, error, "Code not at $8000" + .assert * = $8000, error, "Code not at $8000" + + .ASSERT * = $8001, error, "Code not at $8001" + .assert * = $8001, error, "Code not at $8001" + + + .org $8000 + + .ASSERT * = $8000, error, "Code not at $8000" + .assert * = $8000, error, "Code not at $8000" + + .ASSERT * = $8001, error, "Code not at $8001" + .assert * = $8001, error, "Code not at $8001" diff --git a/test/asm/listing/032-assert-error2.err b/test/asm/listing/032-assert-error2.err new file mode 100644 index 000000000..e69de29bb diff --git a/test/asm/listing/032-assert-error2.ld65err-ref b/test/asm/listing/032-assert-error2.ld65err-ref new file mode 100644 index 000000000..d275d4ee9 --- /dev/null +++ b/test/asm/listing/032-assert-error2.ld65err-ref @@ -0,0 +1 @@ +ld65: Error: 032-assert-error2.s:3: Code not at $0000 diff --git a/test/asm/listing/032-assert-error2.s b/test/asm/listing/032-assert-error2.s new file mode 100644 index 000000000..236c2c6c4 --- /dev/null +++ b/test/asm/listing/032-assert-error2.s @@ -0,0 +1,8 @@ +; 2022-06-18 Spiro Trikaliotis + + .ASSERT * = $0000, error, "Code not at $0000" + .ASSERT * = $0001, error, "Code not at $0001" + .ASSERT * = $1000, error, "Code not at $1000" + .ASSERT * = $1001, error, "Code not at $1001" + .ASSERT * = $8000, error, "Code not at $8000" + .ASSERT * = $8001, error, "Code not at $8001" diff --git a/test/asm/listing/032-assert-error3.err b/test/asm/listing/032-assert-error3.err new file mode 100644 index 000000000..e69de29bb diff --git a/test/asm/listing/032-assert-error3.ld65err-ref b/test/asm/listing/032-assert-error3.ld65err-ref new file mode 100644 index 000000000..623c6642b --- /dev/null +++ b/test/asm/listing/032-assert-error3.ld65err-ref @@ -0,0 +1 @@ +ld65: Error: 032-assert-error3.s:3: Code not at $0000 diff --git a/test/asm/listing/032-assert-error3.s b/test/asm/listing/032-assert-error3.s new file mode 100644 index 000000000..c497dc6ed --- /dev/null +++ b/test/asm/listing/032-assert-error3.s @@ -0,0 +1,8 @@ +; 2022-06-18 Spiro Trikaliotis + + .assert * = $0000, error, "Code not at $0000" + .assert * = $0001, error, "Code not at $0001" + .assert * = $1000, error, "Code not at $1000" + .assert * = $1001, error, "Code not at $1001" + .assert * = $8000, error, "Code not at $8000" + .assert * = $8001, error, "Code not at $8001" diff --git a/test/asm/listing/Makefile b/test/asm/listing/Makefile index 6889a84dd..d65b47bde 100644 --- a/test/asm/listing/Makefile +++ b/test/asm/listing/Makefile @@ -52,8 +52,17 @@ $(WORKDIR)/$1.bin: $1.s $(ISEQUAL) $(WORKDIR)/_empty $(if $(QUIET),echo asm/$1.bin) # compile without generating listing +ifeq ($(wildcard $1.err),) $(CA65) -t none -o $$(@:.bin=.o) $$< > $$(@:.bin=.err) 2>&1 +ifeq ($(wildcard $1.no-ld65),) $(LD65) -t none -o $$@ $$(@:.bin=.o) none.lib +endif +else + $(CA65) -t none -o $$(@:.bin=.o) $$< > $$(@:.bin=.err) 2>&1 || true +ifeq ($(wildcard $1.no-ld65),) + $(LD65) -t none -o $$@ $$(@:.bin=.o) none.lib || true +endif +endif ifneq ($(wildcard $1.err-ref),) $(ISEQUAL) $1.err-ref $$(@:.bin=.err) @@ -65,8 +74,17 @@ ifneq ($(wildcard $1.bin-ref),) $(ISEQUAL) $1.bin-ref $$@ endif +ifeq ($(wildcard $1.err),) $(CA65) -t none -l $$(@:.bin=.list.orig) -o $$(@:.bin=.list-o) $$< > $$(@:.bin=.list-err) 2>&1 +ifeq ($(wildcard $1.no-ld65),) $(LD65) -t none -o $$(@:.bin=.list-bin) $$(@:.bin=.list-o) none.lib > $$(@:.bin=.ld65-err) 2>&1 +endif +else + $(CA65) -t none -l $$(@:.bin=.list.orig) -o $$(@:.bin=.list-o) $$< > $$(@:.bin=.list-err) 2>&1 || true +ifeq ($(wildcard $1.no-ld65),) + $(LD65) -t none -o $$(@:.bin=.list-bin) $$(@:.bin=.list-o) none.lib > $$(@:.bin=.ld65-err) 2>&1 || true +endif +endif ifneq ($(wildcard $1.err-ref),) $(ISEQUAL) $1.err-ref $$(@:.bin=.list-err) @@ -74,14 +92,18 @@ else $(ISEQUAL) $(WORKDIR)/_empty $$(@:.bin=.list-err) endif +ifneq ($(wildcard $(WORKDIR)/$1.ld65-err),) ifneq ($(wildcard $1.ld65err-ref),) $(ISEQUAL) $1.ld65err-ref $$(@:.bin=.ld65-err) else $(ISEQUAL) $(WORKDIR)/_empty $$(@:.bin=.ld65-err) endif +endif # check if the result bin is the same as without listing file +ifeq ($(wildcard $1.err),) $(ISEQUAL) $$@ $$(@:.bin=.list-bin) +endif ifneq ($(wildcard $1.list-ref),) # we have a reference file, compare that, too @@ -91,12 +113,6 @@ ifneq ($(wildcard $1.list-ref),) $(ISEQUAL) $1.list-ref $$(@:.bin=.lst) endif -# $(CA65) -t none -f -l $$(@:.bin=.flist.orig) -o $$(@:.bin=.flist-o) $$< -# $(LD65) -t none -o $$(@:.bin=.flist-bin) $$(@:.bin=.flist-o) none.lib - -# # check if the result bin is the same as without listing file -# $(ISEQUAL) $$@ $$(@:.bin=.flist-bin) - endef # LISTING_template