From 388ae87cb384d1ef4bf4e01f5d683b0471386b2d Mon Sep 17 00:00:00 2001 From: Spiro Trikaliotis Date: Sat, 19 Feb 2022 12:44:20 +0100 Subject: [PATCH 1/3] Reorganized test/asm --- test/asm/Makefile | 71 +++----------- test/asm/{ => cpudetect}/4510-cpudetect.ref | Bin test/asm/{ => cpudetect}/6502-cpudetect.ref | Bin .../asm/{ => cpudetect}/6502dtv-cpudetect.ref | Bin test/asm/{ => cpudetect}/6502x-cpudetect.ref | Bin test/asm/{ => cpudetect}/65816-cpudetect.ref | Bin test/asm/{ => cpudetect}/65c02-cpudetect.ref | Bin test/asm/{ => cpudetect}/65sc02-cpudetect.ref | Bin test/asm/cpudetect/Makefile | 61 ++++++++++++ test/asm/{ => cpudetect}/cpudetect.s | 0 .../asm/{ => cpudetect}/huc6280-cpudetect.ref | Bin test/asm/listing/Makefile | 89 ++++++++++++++++++ test/asm/{ => listing}/paramcount.s | 0 test/asm/{ => opcodes}/4510-opcodes.ref | Bin test/asm/{ => opcodes}/4510-opcodes.s | 0 test/asm/{ => opcodes}/6502-opcodes.ref | Bin test/asm/{ => opcodes}/6502-opcodes.s | 0 test/asm/{ => opcodes}/6502dtv-opcodes.ref | Bin test/asm/{ => opcodes}/6502dtv-opcodes.s | 0 test/asm/{ => opcodes}/6502x-opcodes.ref | Bin test/asm/{ => opcodes}/6502x-opcodes.s | 0 test/asm/{ => opcodes}/65c02-opcodes.ref | Bin test/asm/{ => opcodes}/65c02-opcodes.s | 0 test/asm/{ => opcodes}/65sc02-opcodes.ref | Bin test/asm/{ => opcodes}/65sc02-opcodes.s | 0 test/asm/opcodes/Makefile | 61 ++++++++++++ test/asm/{ => opcodes}/huc6280-opcodes.ref | Bin test/asm/{ => opcodes}/huc6280-opcodes.s | 0 test/asm/{ => opcodes}/m740-opcodes.s | 0 29 files changed, 225 insertions(+), 57 deletions(-) rename test/asm/{ => cpudetect}/4510-cpudetect.ref (100%) rename test/asm/{ => cpudetect}/6502-cpudetect.ref (100%) rename test/asm/{ => cpudetect}/6502dtv-cpudetect.ref (100%) rename test/asm/{ => cpudetect}/6502x-cpudetect.ref (100%) rename test/asm/{ => cpudetect}/65816-cpudetect.ref (100%) rename test/asm/{ => cpudetect}/65c02-cpudetect.ref (100%) rename test/asm/{ => cpudetect}/65sc02-cpudetect.ref (100%) create mode 100644 test/asm/cpudetect/Makefile rename test/asm/{ => cpudetect}/cpudetect.s (100%) rename test/asm/{ => cpudetect}/huc6280-cpudetect.ref (100%) create mode 100644 test/asm/listing/Makefile rename test/asm/{ => listing}/paramcount.s (100%) rename test/asm/{ => opcodes}/4510-opcodes.ref (100%) rename test/asm/{ => opcodes}/4510-opcodes.s (100%) rename test/asm/{ => opcodes}/6502-opcodes.ref (100%) rename test/asm/{ => opcodes}/6502-opcodes.s (100%) rename test/asm/{ => opcodes}/6502dtv-opcodes.ref (100%) rename test/asm/{ => opcodes}/6502dtv-opcodes.s (100%) rename test/asm/{ => opcodes}/6502x-opcodes.ref (100%) rename test/asm/{ => opcodes}/6502x-opcodes.s (100%) rename test/asm/{ => opcodes}/65c02-opcodes.ref (100%) rename test/asm/{ => opcodes}/65c02-opcodes.s (100%) rename test/asm/{ => opcodes}/65sc02-opcodes.ref (100%) rename test/asm/{ => opcodes}/65sc02-opcodes.s (100%) create mode 100644 test/asm/opcodes/Makefile rename test/asm/{ => opcodes}/huc6280-opcodes.ref (100%) rename test/asm/{ => opcodes}/huc6280-opcodes.s (100%) rename test/asm/{ => opcodes}/m740-opcodes.s (100%) diff --git a/test/asm/Makefile b/test/asm/Makefile index e951c2015..d722c47db 100644 --- a/test/asm/Makefile +++ b/test/asm/Makefile @@ -1,77 +1,34 @@ -# Makefile for the assembler regression tests +# top-level Makefile for the regression tests ifneq ($(shell echo),) CMD_EXE = 1 endif ifdef CMD_EXE - EXE = .exe - MKDIR = mkdir $(subst /,\,$1) - RMDIR = -rmdir /q /s $(subst /,\,$1) + RMDIR = -rmdir /s /q $(subst /,\,$1) else - EXE = - MKDIR = mkdir -p $1 RMDIR = $(RM) -r $1 endif -ifdef QUIET - .SILENT: -endif +WORKDIR = ../testwrk/asm -CA65 := $(if $(wildcard ../../bin/ca65*),../../bin/ca65,ca65) -LD65 := $(if $(wildcard ../../bin/ld65*),../../bin/ld65,ld65) +SUBDIRS = cpudetect opcodes listing -WORKDIR = ../../testwrk/asm +.PHONY: test continue mostlyclean clean -ISEQUAL = ../../testwrk/isequal$(EXE) +test: mostlyclean continue -CC = gcc -CFLAGS = -O2 +define CALL_template -.PHONY: all clean +continue:: + @$(MAKE) -C $1 all -OPCODE_REFS := $(wildcard *-opcodes.ref) -OPCODE_BINS = $(OPCODE_REFS:%.ref=$(WORKDIR)/%.bin) -OPCODE_CPUS = $(OPCODE_REFS:%-opcodes.ref=%) +mostlyclean:: + @$(MAKE) -C $1 clean -CPUDETECT_REFS := $(wildcard *-cpudetect.ref) -CPUDETECT_BINS = $(CPUDETECT_REFS:%.ref=$(WORKDIR)/%.bin) -CPUDETECT_CPUS = $(CPUDETECT_REFS:%-cpudetect.ref=%) +endef -all: $(OPCODE_BINS) $(CPUDETECT_BINS) $(WORKDIR)/paramcount.o +$(foreach subdir,$(SUBDIRS),$(eval $(call CALL_template,$(subdir)))) -$(WORKDIR): - $(call MKDIR,$(WORKDIR)) - -$(ISEQUAL): ../isequal.c | $(WORKDIR) - $(CC) $(CFLAGS) -o $@ $< - -define OPCODE_template - -$(WORKDIR)/$1-opcodes.bin: $1-opcodes.s $(ISEQUAL) - $(if $(QUIET),echo asm/$1-opcodes.bin) - $(CA65) -t none --cpu $1 -l $$(@:.bin=.lst) -o $$(@:.bin=.o) $$< - $(LD65) -t none -o $$@ $$(@:.bin=.o) none.lib - $(ISEQUAL) $1-opcodes.ref $$@ - -endef # OPCODE_template - -$(foreach cpu,$(OPCODE_CPUS),$(eval $(call OPCODE_template,$(cpu)))) - -define CPUDETECT_template - -$(WORKDIR)/$1-cpudetect.bin: cpudetect.s $1-cpudetect.ref $(ISEQUAL) - $(if $(QUIET),echo asm/$1-cpudetect.bin) - $(CA65) -t none --cpu $1 -l $$(@:.bin=.lst) -o $$(@:.bin=.o) $$< - $(LD65) -t none -o $$@ $$(@:.bin=.o) none.lib - $(ISEQUAL) $1-cpudetect.ref $$@ - -endef # CPUDETECT_template - -$(foreach cpu,$(CPUDETECT_CPUS),$(eval $(call CPUDETECT_template,$(cpu)))) - -$(WORKDIR)/%.o: %.s | $(WORKDIR) - $(CA65) -l $(@:.o=.lst) -o $@ $< - -clean: +clean: mostlyclean @$(call RMDIR,$(WORKDIR)) diff --git a/test/asm/4510-cpudetect.ref b/test/asm/cpudetect/4510-cpudetect.ref similarity index 100% rename from test/asm/4510-cpudetect.ref rename to test/asm/cpudetect/4510-cpudetect.ref diff --git a/test/asm/6502-cpudetect.ref b/test/asm/cpudetect/6502-cpudetect.ref similarity index 100% rename from test/asm/6502-cpudetect.ref rename to test/asm/cpudetect/6502-cpudetect.ref diff --git a/test/asm/6502dtv-cpudetect.ref b/test/asm/cpudetect/6502dtv-cpudetect.ref similarity index 100% rename from test/asm/6502dtv-cpudetect.ref rename to test/asm/cpudetect/6502dtv-cpudetect.ref diff --git a/test/asm/6502x-cpudetect.ref b/test/asm/cpudetect/6502x-cpudetect.ref similarity index 100% rename from test/asm/6502x-cpudetect.ref rename to test/asm/cpudetect/6502x-cpudetect.ref diff --git a/test/asm/65816-cpudetect.ref b/test/asm/cpudetect/65816-cpudetect.ref similarity index 100% rename from test/asm/65816-cpudetect.ref rename to test/asm/cpudetect/65816-cpudetect.ref diff --git a/test/asm/65c02-cpudetect.ref b/test/asm/cpudetect/65c02-cpudetect.ref similarity index 100% rename from test/asm/65c02-cpudetect.ref rename to test/asm/cpudetect/65c02-cpudetect.ref diff --git a/test/asm/65sc02-cpudetect.ref b/test/asm/cpudetect/65sc02-cpudetect.ref similarity index 100% rename from test/asm/65sc02-cpudetect.ref rename to test/asm/cpudetect/65sc02-cpudetect.ref diff --git a/test/asm/cpudetect/Makefile b/test/asm/cpudetect/Makefile new file mode 100644 index 000000000..ffddb1ad8 --- /dev/null +++ b/test/asm/cpudetect/Makefile @@ -0,0 +1,61 @@ +# Makefile for the assembler regression tests + +ifneq ($(shell echo),) + CMD_EXE = 1 +endif + +ifdef CMD_EXE + EXE = .exe + MKDIR = mkdir $(subst /,\,$1) + RMDIR = -rmdir /q /s $(subst /,\,$1) +else + EXE = + MKDIR = mkdir -p $1 + RMDIR = $(RM) -r $1 +endif + +ifdef QUIET + .SILENT: +endif + +CA65 := $(if $(wildcard ../../../bin/ca65*),../../../bin/ca65,ca65) +LD65 := $(if $(wildcard ../../../bin/ld65*),../../../bin/ld65,ld65) + +WORKDIR = ../../../testwrk/asm/cpudetect + +ISEQUAL = ../../../testwrk/isequal$(EXE) + +CC = gcc +CFLAGS = -O2 + +.PHONY: all clean + +CPUDETECT_REFS := $(wildcard *-cpudetect.ref) +CPUDETECT_BINS = $(CPUDETECT_REFS:%.ref=$(WORKDIR)/%.bin) +CPUDETECT_CPUS = $(CPUDETECT_REFS:%-cpudetect.ref=%) + +all: $(CPUDETECT_BINS) + +$(WORKDIR): + $(call MKDIR,$(WORKDIR)) + +$(ISEQUAL): ../../isequal.c | $(WORKDIR) + $(CC) $(CFLAGS) -o $@ $< + +define CPUDETECT_template + +$(WORKDIR)/$1-cpudetect.bin: cpudetect.s $1-cpudetect.ref $(ISEQUAL) + $(if $(QUIET),echo asm/$1-cpudetect.bin) + $(CA65) -t none --cpu $1 -l $$(@:.bin=.lst) -o $$(@:.bin=.o) $$< + $(LD65) -t none -o $$@ $$(@:.bin=.o) none.lib + $(ISEQUAL) $1-cpudetect.ref $$@ + +endef # CPUDETECT_template + +$(foreach cpu,$(CPUDETECT_CPUS),$(eval $(call CPUDETECT_template,$(cpu)))) + +$(WORKDIR)/%.o: %.s | $(WORKDIR) + $(CA65) -l $(@:.o=.lst) -o $@ $< + +clean: + @$(call RMDIR,$(WORKDIR)) diff --git a/test/asm/cpudetect.s b/test/asm/cpudetect/cpudetect.s similarity index 100% rename from test/asm/cpudetect.s rename to test/asm/cpudetect/cpudetect.s diff --git a/test/asm/huc6280-cpudetect.ref b/test/asm/cpudetect/huc6280-cpudetect.ref similarity index 100% rename from test/asm/huc6280-cpudetect.ref rename to test/asm/cpudetect/huc6280-cpudetect.ref diff --git a/test/asm/listing/Makefile b/test/asm/listing/Makefile new file mode 100644 index 000000000..f4a7df81c --- /dev/null +++ b/test/asm/listing/Makefile @@ -0,0 +1,89 @@ +# Makefile for the assembler regression tests + +ifneq ($(shell echo),) + CMD_EXE = 1 +endif + +ifdef CMD_EXE + EXE = .exe + MKDIR = mkdir $(subst /,\,$1) + RMDIR = -rmdir /q /s $(subst /,\,$1) +else + EXE = + MKDIR = mkdir -p $1 + RMDIR = $(RM) -r $1 +endif + +ifdef QUIET + .SILENT: +endif + +CA65 := $(if $(wildcard ../../../bin/ca65*),../../../bin/ca65,ca65) +LD65 := $(if $(wildcard ../../../bin/ld65*),../../../bin/ld65,ld65) + +WORKDIR = ../../../testwrk/asm/listing + +ISEQUAL = ../../../testwrk/isequal$(EXE) + +CC = gcc +CFLAGS = -O2 + +.PHONY: all clean + +LISTING_SRC := $(wildcard *.s) +LISTING_TESTS = $(LISTING_SRC:%.s=%) +LISTING_BINS = $(LISTING_SRC:%.s=$(WORKDIR)/%.bin) + +all: $(LISTING_BINS) + +$(WORKDIR): + $(call MKDIR,$(WORKDIR)) + +$(ISEQUAL): ../../isequal.c | $(WORKDIR) + $(CC) $(CFLAGS) -o $@ $< + + +define LISTING_template + +$(WORKDIR)/$1.bin: $1.s $(ISEQUAL) + $(if $(QUIET),echo asm/$1.bin) + + # compile without generating listing + $(CA65) -t none -o $$(@:.bin=.o) $$< + $(LD65) -t none -o $$@ $$(@:.bin=.o) none.lib + +ifneq ($(wildcard $1.bin-ref),) + $(ISEQUAL) $1.bin-ref $$@ +endif + + $(CA65) -t none -l $$(@:.bin=.list.orig) -o $$(@:.bin=.list-o) $$< + $(LD65) -t none -o $$(@:.bin=.list-bin) $$(@:.bin=.list-o) none.lib + + # check if the result bin is the same as without listing file + $(ISEQUAL) $$@ $$(@:.bin=.list-bin) + +ifneq ($(wildcard $1.list-ref),) + # we have a reference file, compare that, too + + # remove first line which contains a version number + tail -n +2 $$(@:.bin=.lst.orig) > $$(@:.bin=.lst) + $(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 + + +$(foreach listing,$(LISTING_TESTS),$(eval $(call LISTING_template,$(listing)))) + + +$(WORKDIR)/%.o: %.s | $(WORKDIR) + $(CA65) -l $(@:.o=.lst) -o $@ $< + +clean: + @$(call RMDIR,$(WORKDIR)) diff --git a/test/asm/paramcount.s b/test/asm/listing/paramcount.s similarity index 100% rename from test/asm/paramcount.s rename to test/asm/listing/paramcount.s diff --git a/test/asm/4510-opcodes.ref b/test/asm/opcodes/4510-opcodes.ref similarity index 100% rename from test/asm/4510-opcodes.ref rename to test/asm/opcodes/4510-opcodes.ref diff --git a/test/asm/4510-opcodes.s b/test/asm/opcodes/4510-opcodes.s similarity index 100% rename from test/asm/4510-opcodes.s rename to test/asm/opcodes/4510-opcodes.s diff --git a/test/asm/6502-opcodes.ref b/test/asm/opcodes/6502-opcodes.ref similarity index 100% rename from test/asm/6502-opcodes.ref rename to test/asm/opcodes/6502-opcodes.ref diff --git a/test/asm/6502-opcodes.s b/test/asm/opcodes/6502-opcodes.s similarity index 100% rename from test/asm/6502-opcodes.s rename to test/asm/opcodes/6502-opcodes.s diff --git a/test/asm/6502dtv-opcodes.ref b/test/asm/opcodes/6502dtv-opcodes.ref similarity index 100% rename from test/asm/6502dtv-opcodes.ref rename to test/asm/opcodes/6502dtv-opcodes.ref diff --git a/test/asm/6502dtv-opcodes.s b/test/asm/opcodes/6502dtv-opcodes.s similarity index 100% rename from test/asm/6502dtv-opcodes.s rename to test/asm/opcodes/6502dtv-opcodes.s diff --git a/test/asm/6502x-opcodes.ref b/test/asm/opcodes/6502x-opcodes.ref similarity index 100% rename from test/asm/6502x-opcodes.ref rename to test/asm/opcodes/6502x-opcodes.ref diff --git a/test/asm/6502x-opcodes.s b/test/asm/opcodes/6502x-opcodes.s similarity index 100% rename from test/asm/6502x-opcodes.s rename to test/asm/opcodes/6502x-opcodes.s diff --git a/test/asm/65c02-opcodes.ref b/test/asm/opcodes/65c02-opcodes.ref similarity index 100% rename from test/asm/65c02-opcodes.ref rename to test/asm/opcodes/65c02-opcodes.ref diff --git a/test/asm/65c02-opcodes.s b/test/asm/opcodes/65c02-opcodes.s similarity index 100% rename from test/asm/65c02-opcodes.s rename to test/asm/opcodes/65c02-opcodes.s diff --git a/test/asm/65sc02-opcodes.ref b/test/asm/opcodes/65sc02-opcodes.ref similarity index 100% rename from test/asm/65sc02-opcodes.ref rename to test/asm/opcodes/65sc02-opcodes.ref diff --git a/test/asm/65sc02-opcodes.s b/test/asm/opcodes/65sc02-opcodes.s similarity index 100% rename from test/asm/65sc02-opcodes.s rename to test/asm/opcodes/65sc02-opcodes.s diff --git a/test/asm/opcodes/Makefile b/test/asm/opcodes/Makefile new file mode 100644 index 000000000..00be96d91 --- /dev/null +++ b/test/asm/opcodes/Makefile @@ -0,0 +1,61 @@ +# Makefile for the assembler regression tests + +ifneq ($(shell echo),) + CMD_EXE = 1 +endif + +ifdef CMD_EXE + EXE = .exe + MKDIR = mkdir $(subst /,\,$1) + RMDIR = -rmdir /q /s $(subst /,\,$1) +else + EXE = + MKDIR = mkdir -p $1 + RMDIR = $(RM) -r $1 +endif + +ifdef QUIET + .SILENT: +endif + +CA65 := $(if $(wildcard ../../../bin/ca65*),../../../bin/ca65,ca65) +LD65 := $(if $(wildcard ../../../bin/ld65*),../../../bin/ld65,ld65) + +WORKDIR = ../../../testwrk/asm/opcodes + +ISEQUAL = ../../../testwrk/isequal$(EXE) + +CC = gcc +CFLAGS = -O2 + +.PHONY: all clean + +OPCODE_REFS := $(wildcard *-opcodes.ref) +OPCODE_BINS = $(OPCODE_REFS:%.ref=$(WORKDIR)/%.bin) +OPCODE_CPUS = $(OPCODE_REFS:%-opcodes.ref=%) + +all: $(OPCODE_BINS) + +$(WORKDIR): + $(call MKDIR,$(WORKDIR)) + +$(ISEQUAL): ../../isequal.c | $(WORKDIR) + $(CC) $(CFLAGS) -o $@ $< + +define OPCODE_template + +$(WORKDIR)/$1-opcodes.bin: $1-opcodes.s $(ISEQUAL) + $(if $(QUIET),echo asm/$1-opcodes.bin) + $(CA65) -t none --cpu $1 -l $$(@:.bin=.lst) -o $$(@:.bin=.o) $$< + $(LD65) -t none -o $$@ $$(@:.bin=.o) none.lib + $(ISEQUAL) $1-opcodes.ref $$@ + +endef # OPCODE_template + +$(foreach cpu,$(OPCODE_CPUS),$(eval $(call OPCODE_template,$(cpu)))) + +$(WORKDIR)/%.o: %.s | $(WORKDIR) + $(CA65) -l $(@:.o=.lst) -o $@ $< + +clean: + @$(call RMDIR,$(WORKDIR)) diff --git a/test/asm/huc6280-opcodes.ref b/test/asm/opcodes/huc6280-opcodes.ref similarity index 100% rename from test/asm/huc6280-opcodes.ref rename to test/asm/opcodes/huc6280-opcodes.ref diff --git a/test/asm/huc6280-opcodes.s b/test/asm/opcodes/huc6280-opcodes.s similarity index 100% rename from test/asm/huc6280-opcodes.s rename to test/asm/opcodes/huc6280-opcodes.s diff --git a/test/asm/m740-opcodes.s b/test/asm/opcodes/m740-opcodes.s similarity index 100% rename from test/asm/m740-opcodes.s rename to test/asm/opcodes/m740-opcodes.s From 0e45976f9b0c07b1fbdb491fff4d8f95ed8f7493 Mon Sep 17 00:00:00 2001 From: Spiro Trikaliotis Date: Sat, 19 Feb 2022 12:52:02 +0100 Subject: [PATCH 2/3] Rename target test to asm --- test/asm/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/asm/Makefile b/test/asm/Makefile index d722c47db..b35c30c9f 100644 --- a/test/asm/Makefile +++ b/test/asm/Makefile @@ -14,9 +14,9 @@ WORKDIR = ../testwrk/asm SUBDIRS = cpudetect opcodes listing -.PHONY: test continue mostlyclean clean +.PHONY: all continue mostlyclean clean -test: mostlyclean continue +all: mostlyclean continue define CALL_template From 0f6cb5b114b0cfe6331dab38c4d19d499b712722 Mon Sep 17 00:00:00 2001 From: Spiro Trikaliotis Date: Sun, 20 Feb 2022 11:20:20 +0100 Subject: [PATCH 3/3] Add proper readmes --- test/asm/cpudetect/readme.txt | 15 ++++++++++++++ test/asm/listing/readme.txt | 27 +++++++++++++++++++++++++ test/asm/opcodes/readme.txt | 29 ++++++++++++++++++++++++++ test/asm/readme.txt | 38 +++++------------------------------ 4 files changed, 76 insertions(+), 33 deletions(-) create mode 100644 test/asm/cpudetect/readme.txt create mode 100644 test/asm/listing/readme.txt create mode 100644 test/asm/opcodes/readme.txt diff --git a/test/asm/cpudetect/readme.txt b/test/asm/cpudetect/readme.txt new file mode 100644 index 000000000..6a1adf480 --- /dev/null +++ b/test/asm/cpudetect/readme.txt @@ -0,0 +1,15 @@ +CPU Detect Tests +---------------- + +These tests all assemble the same file "cpudetect.s" which contains several +conditionals for several CPUs, only using every option known to the "--cpu" +command-line switch of ca65/cl65. + +Reference (".ref") Files +------------------------ + +Some hints about creating new files: +Make an empty file with the CPU's name prepended to "-cpudetect.ref". Run the +tests; one of them will fail due to a mismatch. Review the output of the +".lst" file pedantically, then copy the ".bin" over the empty ".ref" file. + diff --git a/test/asm/listing/readme.txt b/test/asm/listing/readme.txt new file mode 100644 index 000000000..e43f2008a --- /dev/null +++ b/test/asm/listing/readme.txt @@ -0,0 +1,27 @@ +Overall test: +------------- + +These testcases can be used to test different aspects of the assembler. +The name of a test is everything in the form .s. + +The following reference files can be added: + +- .bin-ref: + This is a reference for the resulting binary. + The binary as binary tested against this file. + If they are not equal, the test fails. + +- .list-ref + This is a reference for the resulting listing output + This file *must* have the first line of the listing removed, as that + contains a ca65 version string, and almost always this will be changed! + + +Note that the resulting .bin file is generated twice: Once with no listing +file, and once with listing file. This way, one can find out if the listing +file generation changes anything with the resulting binary output. + + +TODO: +- add the possibility to test for specific error output that are to be + expected diff --git a/test/asm/opcodes/readme.txt b/test/asm/opcodes/readme.txt new file mode 100644 index 000000000..098dd549a --- /dev/null +++ b/test/asm/opcodes/readme.txt @@ -0,0 +1,29 @@ +Opcode Tests: +------------- + +These testcases are inspired by the ones now removed from test/assembler. +The main purpose is to have each possible opcode generated at least once, +either by an Assembly instruction or a ".byte"-placeholder. Typically +generated by disassembling a binary dump that contains data in the form +of the pattern that each opcode is stated once in order followed by easy +to recognise: + +00 00 EA 00 +01 00 EA 00 +02 00 EA 00 +[...] +fe 00 EA 00 +ff 00 EA 00 + +The disassembly is then put in a better readable form by replacing the +leftover dummy opcode parameters with something more recognizable. + +The testcases for 6502, 6502x, 65sc02, 65c02, 4510, and huc6280 have been +put together by Sven Oliver ("SvOlli") Moll, as well as a template for the +m740 instructions set. Later 6502dtv support was also added. + +Still to do is to find a way to implement an opcode testcase for the 65816 +processor, since it's capable of executing instructions with an 8-bit and +a 16-bit operator alike, distinguished by only one processor flag. + + diff --git a/test/asm/readme.txt b/test/asm/readme.txt index 1d135c895..18354bb47 100644 --- a/test/asm/readme.txt +++ b/test/asm/readme.txt @@ -4,44 +4,16 @@ Assembler Testcases Opcode Tests: ------------- -These testcases are inspired by the ones now removed from test/assembler. -The main purpose is to have each possible opcode generated at least once, -either by an Assembly instruction or a ".byte"-placeholder. Typically -generated by disassembling a binary dump that contains data in the form -of the pattern that each opcode is stated once in order followed by easy -to recognise: - -00 00 EA 00 -01 00 EA 00 -02 00 EA 00 -[...] -fe 00 EA 00 -ff 00 EA 00 - -The disassembly is then put in a better readable form by replacing the -leftover dummy opcode parameters with something more recognizable. - -The testcases for 6502, 6502x, 65sc02, 65c02, 4510, and huc6280 have been -put together by Sven Oliver ("SvOlli") Moll, as well as a template for the -m740 instructions set. Later 6502dtv support was also added. - -Still to do is to find a way to implement an opcode testcase for the 65816 -processor, since it's capable of executing instructions with an 8-bit and -a 16-bit operator alike, distinguished by only one processor flag. +these go into opcodes/. Refer to opcodes/readme.txt CPU Detect Tests ---------------- -These tests all assemble the same file "cpudetect.s" which contains several -conditionals for several CPUs, only using every option known to the "--cpu" -command-line switch of ca65/cl65. +these go into cpudetect/. Refer to cpudetect/readme.txt -Reference (".ref") Files ------------------------- +Overall tests: +-------------- -Some hints about creating new files: -Make an empty file with the CPU's name prepended to "-cpudetect.ref". Run the -tests; one of them will fail due to a mismatch. Review the output of the -".lst" file pedantically, then copy the ".bin" over the empty ".ref" file. +These go into listing/. Refer to listing/readme.txt