regenerate-parse

command
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 11 Imported by: 0

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:

  1. Extract literal SQL cases from test/<name>.test (TCL) with internal/tclextract.
  2. 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.
  3. 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL