mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2026-05-14 02:38:10 -04:00
| .. | ||
| cpp | ||
| rust | ||
| DEBUGGING.md | ||
| README.md | ||
PEG Spec Test Harness
Language-specific test runners for the language-independent test suite in spec/tests/.
harness/
cpp/ C++ harness (reference, uses cpp-peglib)
rust/ Rust harness (future)
Build and run (C++)
cd harness/cpp && cmake -B build && cmake --build build
./build/spec-harness
All dependencies (googletest, nlohmann/json) are fetched automatically by CMake.
Documents
- DEBUGGING.md — diagnosing test failures, DSL quirks, layer triage
spec/schema/test-case.schema.json— canonical definition of JSON test-case fieldscpp/harness.cc— reference interpreter for the JSON spec
Adding a new language harness
Create harness/<lang>/ and implement a runner that:
- Loads each
spec/tests/**/*.jsonfile - For each group, creates a parser from
grammarand configures it per the group's fields - Binds
actions,vars,handlers,traceas defined in the schema - Runs each
caseand verifies against theexpected_*fields
Field semantics: see the JSON schema. Reference implementation: cpp/harness.cc.