Documentation
¶
Overview ¶
Command regenerate-parse builds meyer's test corpus from the SQLite source tree, using a real SQLite build as the oracle.
Pipeline, per requested test script:
- Extract literal SQL cases from test/<name>.test (TCL) with internal/tclextract.
- Run every case through the oracle: a small C program (oracle.c, embedded here) compiled against the pinned SQLite amalgamation. It splits the case into statements exactly like the sqlite3 shell and prepares each one independently against an empty :memory: database — nothing is executed, so statements are order-independent.
- Write parser/testdata/<name>.test with the raw per-statement results, and merge parser/testdata/<name>.metadata.json (new cases start as todo; existing entries are preserved).
The SQLite release is pinned in internal/sqlitesrc, which downloads the artifacts into the cache directory (default .sqlite/, gitignored) and reuses them on later runs.
Usage:
go run ./cmd/regenerate-parse [-files select1,expr,...] [flags]
With no -files, every test script in the pinned source tree is regenerated. Scripts that yield no literal-SQL cases (the tokenizer tests written in C, the VFS and WAL harnesses, and so on) produce no corpus file, and a stale one left over from an earlier run is removed.
Click to show internal directories.
Click to hide internal directories.