writeonce/compiler/test/dune
shoney.arickathil 012562290d feat(compiler): Tasks 1-4 — scaffold, diagnostics, lexer, declaration parser
- Task 1: OCaml/dune scaffold with woc CLI (exit codes 0/1/2), just woc-build/woc-test
- Task 2: Diagnostics module — WO-E coded diagnostics with excerpts, related sites, ordered dedup collector, exit-code decision
- Task 3: Newline-significant lexer mirroring rt conventions (self/me/subscribe/insert stay idents), --dump-tokens, golden test framework with bless mode
- Task 4: Declaration parser — class/type/interface/fn signatures, @gc/@table annotations, brace-depth skip-on-block (service/policy/on), decl-level recovery, --dump-ast goldens
- 13 golden fixtures (tokens + AST) with WOC_BLESS=1 support
- just woc-test green (14 diag + 93 runner checks)
2026-08-10 09:00:08 +02:00

31 lines
1.3 KiB
Text

; Task 2 seam: a plain assert-and-print test executable wired into
; `dune runtest`, just enough to TDD compiler/src/diag.ml. Task 3 adds
; the golden-file runner (runner.ml + test/golden/ fixtures) alongside
; this file — keep this stanza minimal so that addition is additive,
; not a rewrite.
(test
(name test_diag)
(modules test_diag)
(libraries woc_lib))
; Task 3: golden-file runner. (deps (source_tree golden)) does two
; jobs at once: it keeps the build-directory copy of golden/ that this
; test reads from fresh on every run, and it is *why* dune notices a
; fixture edit at all -- without a declared dependency on that
; directory, dune has nothing to digest to decide this test's cached
; PASS is stale, and a changed .wo/.expected file would go unnoticed.
; WOC_BLESS=1 rewrites the real compiler/test/golden files on disk
; directly (see runner.ml's module doc for why a bare relative write
; from inside a dune test would not do that). The ../bin/woc dep is for
; the CLI smoke section: it forces the woc binary to be built before
; this test runs, and (because dune places a directory dependency's
; target at the same relative path inside the sandbox) guarantees
; "../bin/woc" resolves from this test's cwd exactly the way runner.ml
; assumes.
(test
(name runner)
(modules runner)
(libraries woc_lib)
(deps
(source_tree golden)
../bin/woc))