Crafter.Build/interfaces
Jorijn van der Graaf dc27c5c204 test: introduce test.toml + target-derived runners alongside existing machinery
Vendors toml++ v3.4.0 as lib/toml.hpp and wires it into Crafter.Build-Test
to parse a declarative test.toml manifest (target/march/mtune/sysroot/
requires/timeout/args/defines). Test discovery now treats project.cpp and
test.toml as mutually exclusive: project.cpp stays the escape hatch for
outer-driver tests, test.toml gives downstream test authors a no-boilerplate
path.

Adds:
- TestRunner::Wine() and TestRunner::ForTarget(cfg) — runner is now derived
  from cfg.target (Local for host, Wine for Windows-on-Linux, wasmtime for
  WASI, qemu-<arch> with QEMU_LD_PREFIX for non-host Linux). The env-var
  override CRAFTER_BUILD_RUNNER_<target> still wins as a power-user escape
  hatch via FromEnv.
- Declarative preconditions: tool:<name>, file:<path>, env:<VAR> are
  evaluated before the build; missing preconditions Skip without paying
  the compile cost.
- Hard-fail-unless-declared: when a derived runner's tool is missing AND
  the test didn't declare 'tool:<that>' in requires, the missing runner
  is a Fail instead of a silent Skip. Surfaces broken cross-arch CI
  config that previously hid as "skipped".
- Multi-target sweep: bare `crafter-build test` (no --target=) now
  iterates every distinct test.toml-declared target plus the host, so
  cross-arch tests run by default without the user needing to know which
  targets exist. `--target=X` bypasses the sweep.

Test struct gains a `requires_` vector so project.cpp users can declare
preconditions too (matching what test.toml writes there).

Existing tests, factories (Ssh/SshWin/Wsl/Cmd), and CRAFTER_BUILD_RUNNER_*
machinery remain intact — this commit only adds; migration and deletion
follow in subsequent commits.

Refs issue #8.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 17:57:47 +02:00
..
Crafter.Build-Api.h test runner, cross-target runners, lib/exe split 2026-04-27 22:32:19 +02:00
Crafter.Build-Asset.cppm asset changes 2026-05-19 00:50:06 +02:00
Crafter.Build-Clang.cppm test: introduce test.toml + target-derived runners alongside existing machinery 2026-05-27 17:57:47 +02:00
Crafter.Build-External.cppm asset changes 2026-05-19 00:50:06 +02:00
Crafter.Build-Implementation.cppm test runner, cross-target runners, lib/exe split 2026-04-27 22:32:19 +02:00
Crafter.Build-Interface.cppm test runner, cross-target runners, lib/exe split 2026-04-27 22:32:19 +02:00
Crafter.Build-Platform.cppm V2: WASI, -r flag, CI pipeline, examples & tests cleanup 2026-04-28 23:24:46 +02:00
Crafter.Build-Progress.cppm loading bar 2026-04-29 03:27:11 +02:00
Crafter.Build-Shader.cppm fixes 2026-05-02 21:08:51 +02:00
Crafter.Build-Test.cppm test: introduce test.toml + target-derived runners alongside existing machinery 2026-05-27 17:57:47 +02:00
Crafter.Build.cppm asset compression 2026-05-12 01:16:40 +02:00