Skip to content

Commit

Permalink
Add the corpus tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgiven committed Oct 27, 2023
1 parent 6038a11 commit 5af0b68
Show file tree
Hide file tree
Showing 6 changed files with 155 additions and 62 deletions.
78 changes: 39 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,45 +103,45 @@ particular filesystem and can read (and sometimes write, support varies) files
directly from disks, flux files or disk images. Some formats have multiple
choices because they can store multiple types of file system.

<!-- FORMATSSTART -->
<!-- This section is automatically generated. Do not edit. -->

| Profile | Format | Read? | Write? | Filesystem? |
|:--------|:-------|:-----:|:------:|:------------|
| [`acornadfs`](doc/disk-acornadfs.md) | Acorn ADFS: BBC Micro, Archimedes | 🦖 | | |
| [`acorndfs`](doc/disk-acorndfs.md) | Acorn DFS: Acorn Atom, BBC Micro series | 🦄 | | ACORNDFS |
| [`aeslanier`](doc/disk-aeslanier.md) | AES Lanier "No Problem": 616kB 5.25" 77-track SSDD hard sectored | 🦖 | | |
| [`agat`](doc/disk-agat.md) | Agat: 840kB 5.25" 80-track DS | 🦖 | 🦖 | |
| [`amiga`](doc/disk-amiga.md) | Amiga: 880kB 3.5" DSDD | 🦄 | 🦄 | AMIGAFFS |
| [`ampro`](doc/disk-ampro.md) | Ampro Little Board: CP/M | 🦖 | | CPMFS |
| [`apple2`](doc/disk-apple2.md) | Apple II: Prodos, Appledos, and CP/M | 🦄 | 🦄 | APPLEDOS CPMFS PRODOS |
| [`atarist`](doc/disk-atarist.md) | Atari ST: Almost PC compatible | 🦄 | 🦄 | |
| [`bk`](doc/disk-bk.md) | BK: 800kB 5.25"/3.5" 80-track 10-sector DSDD | 🦖 | 🦖 | |
| [`brother`](doc/disk-brother.md) | Brother word processors: GCR family | 🦄 | 🦄 | BROTHER120 FATFS |
| [`commodore`](doc/disk-commodore.md) | Commodore: 1541, 1581, 8050 and variations | 🦄 | 🦄 | CBMFS |
| [`eco1`](doc/disk-eco1.md) | VDS Eco1: CP/M; 1210kB 77-track mixed format DSHD | 🦖 | | CPMFS |
| [`epsonpf10`](doc/disk-epsonpf10.md) | Epson PF-10: CP/M; 3.5" 40-track DSDD | 🦖 | | CPMFS |
| [`f85`](doc/disk-f85.md) | Durango F85: 461kB 5.25" 77-track SS | 🦖 | | |
| [`fb100`](doc/disk-fb100.md) | Brother FB-100: 100kB 3.5" 40-track SSSD | 🦖 | | |
| [`hplif`](doc/disk-hplif.md) | Hewlett-Packard LIF: a variety of disk formats used by HP | 🦄 | 🦄 | LIF |
| [`ibm`](doc/disk-ibm.md) | IBM PC: Generic PC 3.5"/5.25" disks | 🦄 | 🦄 | FATFS |
| [`icl30`](doc/disk-icl30.md) | ICL Model 30: CP/M; 263kB 35-track DSSD | 🦖 | | CPMFS |
| [`mac`](doc/disk-mac.md) | Macintosh: 400kB/800kB 3.5" GCR | 🦄 | 🦄 | MACHFS |
| [`micropolis`](doc/disk-micropolis.md) | Micropolis: 100tpi MetaFloppy disks | 🦄 | 🦄 | |
| [`ms2000`](doc/disk-ms2000.md) | : MS2000 Microdisk Development System | | | MICRODOS |
| [`mx`](doc/disk-mx.md) | DVK MX: Soviet-era PDP-11 clone | 🦖 | | |
| [`n88basic`](doc/disk-n88basic.md) | N88-BASIC: PC8800/PC98 5.25" 77-track 26-sector DSHD | 🦄 | 🦄 | |
| [`northstar`](doc/disk-northstar.md) | Northstar: 5.25" hard sectored | 🦄 | 🦄 | |
| [`psos`](doc/disk-psos.md) | pSOS: 800kB DSDD with PHILE | 🦄 | 🦄 | PHILE |
| [`rolandd20`](doc/disk-rolandd20.md) | Roland D20: 3.5" electronic synthesiser disks | 🦄 | 🦖 | ROLAND |
| [`rx50`](doc/disk-rx50.md) | Digital RX50: 400kB 5.25" 80-track 10-sector SSDD | 🦖 | 🦖 | |
| [`smaky6`](doc/disk-smaky6.md) | Smaky 6: 308kB 5.25" 77-track 16-sector SSDD, hard sectored | 🦖 | | SMAKY6 |
| [`tids990`](doc/disk-tids990.md) | Texas Instruments DS990: 1126kB 8" DSSD | 🦖 | 🦖 | |
| [`tiki`](doc/disk-tiki.md) | Tiki 100: CP/M | | | CPMFS |
| [`victor9k`](doc/disk-victor9k.md) | Victor 9000 / Sirius One: 1224kB 5.25" DSDD GCR | 🦖 | 🦖 | |
| [`zilogmcz`](doc/disk-zilogmcz.md) | Zilog MCZ: 320kB 8" 77-track SSSD hard-sectored | 🦖 | | ZDOS |
{: .datatable }

<!-- FORMATSSTART -->
<!-- This section is automatically generated. Do not edit. -->

| Profile | Format | Read? | Write? | Filesystem? |
|:--------|:-------|:-----:|:------:|:------------|
| [`acornadfs`](doc/disk-acornadfs.md) | Acorn ADFS: BBC Micro, Archimedes | 🦖 | | |
| [`acorndfs`](doc/disk-acorndfs.md) | Acorn DFS: Acorn Atom, BBC Micro series | 🦄 | | ACORNDFS |
| [`aeslanier`](doc/disk-aeslanier.md) | AES Lanier "No Problem": 616kB 5.25" 77-track SSDD hard sectored | 🦖 | | |
| [`agat`](doc/disk-agat.md) | Agat: 840kB 5.25" 80-track DS | 🦖 | 🦖 | |
| [`amiga`](doc/disk-amiga.md) | Amiga: 880kB 3.5" DSDD | 🦄 | 🦄 | AMIGAFFS |
| [`ampro`](doc/disk-ampro.md) | Ampro Little Board: CP/M | 🦖 | | CPMFS |
| [`apple2`](doc/disk-apple2.md) | Apple II: Prodos, Appledos, and CP/M | 🦄 | 🦄 | APPLEDOS CPMFS PRODOS |
| [`atarist`](doc/disk-atarist.md) | Atari ST: Almost PC compatible | 🦄 | 🦄 | |
| [`bk`](doc/disk-bk.md) | BK: 800kB 5.25"/3.5" 80-track 10-sector DSDD | 🦖 | 🦖 | |
| [`brother`](doc/disk-brother.md) | Brother word processors: GCR family | 🦄 | 🦄 | BROTHER120 FATFS |
| [`commodore`](doc/disk-commodore.md) | Commodore: 1541, 1581, 8050 and variations | 🦄 | 🦄 | CBMFS |
| [`eco1`](doc/disk-eco1.md) | VDS Eco1: CP/M; 1210kB 77-track mixed format DSHD | 🦖 | | CPMFS |
| [`epsonpf10`](doc/disk-epsonpf10.md) | Epson PF-10: CP/M; 3.5" 40-track DSDD | 🦖 | | CPMFS |
| [`f85`](doc/disk-f85.md) | Durango F85: 461kB 5.25" 77-track SS | 🦖 | | |
| [`fb100`](doc/disk-fb100.md) | Brother FB-100: 100kB 3.5" 40-track SSSD | 🦖 | | |
| [`hplif`](doc/disk-hplif.md) | Hewlett-Packard LIF: a variety of disk formats used by HP | 🦄 | 🦄 | LIF |
| [`ibm`](doc/disk-ibm.md) | IBM PC: Generic PC 3.5"/5.25" disks | 🦄 | 🦄 | FATFS |
| [`icl30`](doc/disk-icl30.md) | ICL Model 30: CP/M; 263kB 35-track DSSD | 🦖 | | CPMFS |
| [`mac`](doc/disk-mac.md) | Macintosh: 400kB/800kB 3.5" GCR | 🦄 | 🦄 | MACHFS |
| [`micropolis`](doc/disk-micropolis.md) | Micropolis: 100tpi MetaFloppy disks | 🦄 | 🦄 | |
| [`ms2000`](doc/disk-ms2000.md) | : MS2000 Microdisk Development System | | | MICRODOS |
| [`mx`](doc/disk-mx.md) | DVK MX: Soviet-era PDP-11 clone | 🦖 | | |
| [`n88basic`](doc/disk-n88basic.md) | N88-BASIC: PC8800/PC98 5.25" 77-track 26-sector DSHD | 🦄 | 🦄 | |
| [`northstar`](doc/disk-northstar.md) | Northstar: 5.25" hard sectored | 🦄 | 🦄 | |
| [`psos`](doc/disk-psos.md) | pSOS: 800kB DSDD with PHILE | 🦄 | 🦄 | PHILE |
| [`rolandd20`](doc/disk-rolandd20.md) | Roland D20: 3.5" electronic synthesiser disks | 🦄 | 🦖 | ROLAND |
| [`rx50`](doc/disk-rx50.md) | Digital RX50: 400kB 5.25" 80-track 10-sector SSDD | 🦖 | 🦖 | |
| [`smaky6`](doc/disk-smaky6.md) | Smaky 6: 308kB 5.25" 77-track 16-sector SSDD, hard sectored | 🦖 | | SMAKY6 |
| [`tids990`](doc/disk-tids990.md) | Texas Instruments DS990: 1126kB 8" DSSD | 🦖 | 🦖 | |
| [`tiki`](doc/disk-tiki.md) | Tiki 100: CP/M | | | CPMFS |
| [`victor9k`](doc/disk-victor9k.md) | Victor 9000 / Sirius One: 1224kB 5.25" DSDD GCR | 🦖 | 🦖 | |
| [`zilogmcz`](doc/disk-zilogmcz.md) | Zilog MCZ: 320kB 8" 77-track SSSD hard-sectored | 🦖 | | ZDOS |
{: .datatable }

<!-- FORMATSEND -->

### Notes
Expand Down
86 changes: 82 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
from build.c import clibrary, cxxlibrary
from build.protobuf import proto, protocc
from build.pkg import package
from build.utils import test
from glob import glob
import config
import re

package(name="protobuf_lib", package="protobuf")
package(name="z_lib", package="zlib")
Expand Down Expand Up @@ -216,6 +219,83 @@
],
)

corpustests = []
if not glob("../fluxengine-testdata/data"):
print("fluxengine-testdata not found; skipping corpus tests")
else:
corpus = [
("agat", "", "--drive.tpi=96"),
("amiga", "", "--drive.tpi=135"),
("apple2", "", "--140 --drive.tpi=96"),
("atarist", "", "--360 --drive.tpi=135"),
("atarist", "", "--370 --drive.tpi=135"),
("atarist", "", "--400 --drive.tpi=135"),
("atarist", "", "--410 --drive.tpi=135"),
("atarist", "", "--720 --drive.tpi=135"),
("atarist", "", "--740 --drive.tpi=135"),
("atarist", "", "--800 --drive.tpi=135"),
("atarist", "", "--820 --drive.tpi=135"),
("bk", "", ""),
("brother", "", "--120 --drive.tpi=135"),
("brother", "", "--240 --drive.tpi=135"),
(
"commodore",
"scripts/commodore1541_test.textpb",
"--171 --drive.tpi=96",
),
(
"commodore",
"scripts/commodore1541_test.textpb",
"--192 --drive.tpi=96",
),
("commodore", "", "--800 --drive.tpi=135"),
("commodore", "", "--1620 --drive.tpi=135"),
("hplif", "", "--264 --drive.tpi=135"),
("hplif", "", "--608 --drive.tpi=135"),
("hplif", "", "--616 --drive.tpi=135"),
("hplif", "", "--770 --drive.tpi=135"),
("ibm", "", "--1200 --drive.tpi=96"),
("ibm", "", "--1232 --drive.tpi=96"),
("ibm", "", "--1440 --drive.tpi=135"),
("ibm", "", "--1680 --drive.tpi=135"),
("ibm", "", "--180 --drive.tpi=96"),
("ibm", "", "--160 --drive.tpi=96"),
("ibm", "", "--320 --drive.tpi=96"),
("ibm", "", "--360 --drive.tpi=96"),
("ibm", "", "--720_96 --drive.tpi=96"),
("ibm", "", "--720_135 --drive.tpi=135"),
("mac", "scripts/mac400_test.textpb", "--400 --drive.tpi=135"),
("mac", "scripts/mac800_test.textpb", "--800 --drive.tpi=135"),
("n88basic", "", "--drive.tpi=96"),
("rx50", "", "--drive.tpi=96"),
("tids990", "", "--drive.tpi=48"),
("victor9k", "", "--612 --drive.tpi=96"),
("victor9k", "", "--1224 --drive.tpi=96"),
]

for c in corpus:
name = re.sub(r"[^a-zA-Z0-9]", "_", "".join(c), 0)
corpustests += [
test(
name=f"corpustest_{name}_{format}",
ins=["src+fluxengine"],
deps=["scripts/encodedecodetest.sh"],
commands=[
"{deps[0]} "
+ c[0]
+ " "
+ format
+ " {ins[0]} "
+ c[1]
+ " "
+ c[2]
+ ">/dev/null"
],
label="CORPUSTEST",
)
for format in ["scp", "flux"]
]

export(
name="all",
items={
Expand All @@ -225,8 +305,6 @@
"brother240tool$(EXT)": "tools+brother240tool",
"upgrade-flux-file$(EXT)": "tools+upgrade-flux-file",
}
| ({"FluxEngine.pkg": "src/gui+fluxengine_pkg"}
if config.osx
else {}),
deps=["tests", "src/formats+docs", "scripts+mkdocindex"],
| ({"FluxEngine.pkg": "src/gui+fluxengine_pkg"} if config.osx else {}),
deps=["tests", "src/formats+docs", "scripts+mkdocindex"] + corpustests,
)
6 changes: 4 additions & 2 deletions build/c.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ def findsources(name, srcs, deps, cflags, filerule):
return objs


def libraryimpl(self, name, srcs, deps, hdrs, cflags, ldflags, commands, label, kind):
def libraryimpl(
self, name, srcs, deps, hdrs, cflags, ldflags, commands, label, kind
):
if not srcs and not hdrs:
raise ABException(
"clibrary contains no sources and no exported headers"
Expand Down Expand Up @@ -203,7 +205,7 @@ def programimpl(
normalrule(
replaces=self,
ins=(findsources(name, srcs, deps, cflags, filerule) + ars + ars),
outs=[basename(name)+"$(EXT)"],
outs=[basename(name) + "$(EXT)"],
deps=deps,
label=label,
commands=commands,
Expand Down
37 changes: 28 additions & 9 deletions build/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from build.ab import Rule, normalrule, Target, filenameof
from build.ab import Rule, normalrule, Target, filenameof, Targets
from os.path import basename


Expand All @@ -14,11 +14,30 @@ def objectify(self, name, src: Target, symbol):


@Rule
def test(self, name, command: Target):
normalrule(
replaces=self,
ins=[command],
outs=["sentinel"],
commands=["{ins[0]}", "touch {outs}"],
label="TEST",
)
def test(
self,
name,
command: Target = None,
commands=None,
ins: Targets = [],
deps: Targets = [],
label="TEST",
):
if command:
normalrule(
replaces=self,
ins=[command],
outs=["sentinel"],
commands=["{ins[0]}", "touch {outs}"],
deps=deps,
label=label,
)
else:
normalrule(
replaces=self,
ins=ins,
outs=["sentinel"],
commands=commands + ["touch {outs}"],
deps=deps,
label=label,
)
8 changes: 1 addition & 7 deletions dep/emu/build.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
from build.c import clibrary

clibrary(
name="emu",
srcs=["./fnmatch.c"],
hdrs={
"fnmatch.h": "./fnmatch.h"
}
)
clibrary(name="emu", srcs=["./fnmatch.c"], hdrs={"fnmatch.h": "./fnmatch.h"})
2 changes: 1 addition & 1 deletion dep/libusbp/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
clibrary(
name="libusbp",
srcs=srcs,
cflags =["-Idep/libusbp/include", "-Idep/libusbp/src"],
cflags=["-Idep/libusbp/include", "-Idep/libusbp/src"],
ldflags=ldflags,
deps=deps,
hdrs={
Expand Down

0 comments on commit 5af0b68

Please sign in to comment.