Try to decode the test corpus and make sure there were no decode regressions.

This commit is contained in:
dg
2023-05-07 11:37:50 +00:00
parent 2490f19a1a
commit 7f81b554fd
3 changed files with 37 additions and 2 deletions

View File

@@ -48,7 +48,7 @@ AR ?= $(CCPREFIX)ar
PKG_CONFIG ?= pkg-config
WX_CONFIG ?= wx-config
PROTOC ?= protoc
CFLAGS ?= -g -O0
CFLAGS ?= -g -Os
CXXFLAGS += -std=c++17
LDFLAGS ?=
PLATFORM ?= UNIX
@@ -77,6 +77,9 @@ define nl
endef
empty :=
space := $(empty) $(empty)
use-library = $(eval $(use-library-impl))
define use-library-impl
$1: $(call $3_LIB)
@@ -213,6 +216,38 @@ $(call do-encodedecodetest,tids990)
$(call do-encodedecodetest,victor9k,,--612)
$(call do-encodedecodetest,victor9k,,--1224)
do-corpustest = $(eval $(do-corpustest-impl))
define do-corpustest-impl
tests: $(OBJDIR)/corpustest/$2
$(OBJDIR)/corpustest/$2: $(FLUXENGINE_BIN) \
../fluxengine-testdata/data/$1 ../fluxengine-testdata/data/$2
@mkdir -p $(OBJDIR)/corpustest
@echo CORPUSTEST $1 $2 $3
@$(FLUXENGINE_BIN) read $3 -s ../fluxengine-testdata/data/$1 -o $$@ > $$@.log
@cmp $$@ ../fluxengine-testdata/data/$2
endef
ifneq ($(wildcard ../fluxengine-testdata/data),)
$(call do-corpustest,amiga.flux,amiga.adf,amiga)
$(call do-corpustest,atarist360.flux,atarist360.st,atarist --360)
$(call do-corpustest,atarist720.flux,atarist720.st,atarist --720)
$(call do-corpustest,brother120.flux,brother120.img,brother --120)
$(call do-corpustest,cmd-fd2000.flux,cmd-fd2000.img,cmd_fd2000)
$(call do-corpustest,ibm1232.flux,ibm1232.img,ibm --1232)
$(call do-corpustest,ibm1440.flux,ibm1440.img,ibm --1440)
$(call do-corpustest,mac800.flux,mac800.dsk,mac --800)
$(call do-corpustest,micropolis315.flux,micropolis315.img,micropolis --315)
$(call do-corpustest,northstar87-synthetic.flux,northstar87-synthetic.nsi,northstar --87 --drive.tpi=48)
$(call do-corpustest,northstar175-synthetic.flux,northstar175-synthetic.nsi,northstar --175 --drive.tpi=48)
$(call do-corpustest,northstar350-synthetic.flux,northstar350-synthetic.nsi,northstar --350 --drive.tpi=48)
$(call do-corpustest,victor9k_ss.flux,victor9k_ss.img,victor9k --612)
$(call do-corpustest,victor9k_ds.flux,victor9k_ds.img,victor9k --1224)
endif
$(OBJDIR)/%.a:
@mkdir -p $(dir $@)
@echo AR $@

View File

@@ -2,6 +2,7 @@ comment: ' Micropolis format family'
drive {
hard_sector_count: 16
tpi: 100
}
image_reader {

View File

@@ -47,7 +47,6 @@ $(call use-library, $(OBJDIR)/tests/agg.exe, $(OBJDIR)/tests/agg.o, AGG)
$(call use-library, $(OBJDIR)/tests/agg.exe, $(OBJDIR)/tests/agg.o, STB)
$(call use-library, $(OBJDIR)/tests/configs.exe, $(OBJDIR)/tests/configs.o, LIBFORMATS)
$(OBJDIR)/tests/proto.exe: $(OBJDIR)/tests/testproto.o
$(OBJDIR)/tests/testproto.cc: $(OBJDIR)/protoencode_TestProto.exe tests/testproto.textpb
@mkdir -p $(dir $@)