x07-test
x07-test
This skill provides the single canonical way to run tests for an X07 project using the built-in test harness.
Canonical command
x07 test --manifest tests/tests.json
Notes
- By default,
x07 testprints JSON to stdout; use--report-out <path>to write a report file. - Filter selection:
x07 test --manifest tests/tests.json --filter <substr>x07 test --manifest tests/tests.json --filter <id> --exact- By default, filters that select 0 tests are an error; pass
--allow-emptyto treat this as success. - Use
--listto print selected tests without running them.
- Progress output:
x07 test --verboseprintstest: <id>lines to stderr while preserving the machine report on stdout.
- Fuel overrides:
- Set
solve_fuelon a test entry intests/tests.jsonto override the per-test fuel cap.
- Set
- Runner traps:
- When a runner traps, the report includes diagnostic
X07T_RUN_TRAPwithdetails.trapset to the decoded trap string.
- When a runner traps, the report includes diagnostic
- OS-world working directory:
- For
run-os/run-os-sandboxed, the runner processcwdis derived from the manifest directory when possible (sandboxed tests may choose a differentcwdto satisfy policy read roots), so relative filesystem paths resolve from thatcwd.
- For
- Property-based tests (PBT):
x07 test --pbt --manifest tests/tests.jsonruns PBT entries only.x07 test --all --manifest tests/tests.jsonruns unit + PBT.x07 test --pbt --pbt-repro <repro.json> --manifest tests/tests.jsonreplays exactly one counterexample.- If PBT finds a counterexample, use
x07 fix --from-pbt <repro.json> --writeto convert it into a deterministic regression test (wrapper module + manifest entry).
x07 testresolvesstdlib.lockby searching upward from the manifest directory, then upward from thex07executable location. Override with--stdlib-lock <path>.- New projects created with
x07 initincludetests/tests.jsonplus a minimaltests/smoke.x07.json. - Publishable package repos created with
x07 init --packageincludetests/tests.jsonand publishable modules undermodules/(notests/smoke.x07.json). - Tests under
tests/can import your project modules via project module-root discovery (typicallysrc/in projects, andmodules/in package repos). - World-gating is enforced at compile time. Keep unit tests small and pure (no filesystem/network I/O) unless you are explicitly writing OS-world integration tests and running them under the sandbox profile.
See also: https://x07lang.org/docs/toolchain/testing-by-example/
More from x07lang/x07-website
x07-os-run
Expert backend for run-os / run-os-sandboxed execution via x07-os-runner. Prefer `x07 run --profile os` / `x07 run --profile sandbox`.
10x07-package
Manage X07 project dependencies and lockfiles for reproducible builds (lock, publish). Designed for autonomous agents.
9x07-lint-repair
Lint X07 x07AST JSON and converge via quickfixes (`x07 fix`) or explicit JSON Patch (`x07 ast apply-patch`).
9x07-bundle
Produce distributable native executables (normal CLI ABI) via `x07 bundle`.
8x07-ffi-c
Emit C output and a C header for embedding X07 in C/C++ via `x07 build --emit-c-header`.
8x07-agent-playbook
Agent-first workflow and design rails for building X07 programs with the released toolchain (no repo-only dependencies). Canonical execution is via `x07 run`.
8