feat(test): doctests, sharding, coverage gates, rerun/flaky and fuzzing (G8)
VoidBuildSystem CI / 1 · Requirements (push) Successful in 3s
VoidBuildSystem CI / 2A · Linux build (debug) (push) Successful in 2m1s
VoidBuildSystem CI / 2A · Linux build (coverage) (push) Successful in 2m25s
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Successful in 4m9s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Successful in 2m6s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Successful in 4m47s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Successful in 3m58s
VoidBuildSystem CI / 3A · Linux test (coverage) (push) Failing after 1m23s
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Successful in 24s
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Successful in 30s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Successful in 1m24s
VoidBuildSystem CI / 3A · Linux test (debug) (push) Failing after 6m27s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Failing after 6m39s
VoidBuildSystem CI / 4A2 · VBS installers (linux target) (push) Skipped
VoidBuildSystem CI / 4A2 · VBS installers (windows target) (push) Skipped
VoidBuildSystem CI / 5 · Release (push) Skipped

- vbs doctest extracts fenced C++ blocks from ///, //! and Doxygen comments,
  compiles each as main() with #line diagnostics mapped to the header,
  links optional --source files and reports per-block pass/fail.
- vbs test --shard I/N clusters tests with their fixture prerequisites and
  greedily balances clusters using the previous run's timings
  (<build>/.vbs/test_timings.json, written after every run).
- --rerun-failed re-runs only the previously failed closure
  (<build>/.vbs/last_failed_tests.json); --known-flaky FILE reports flaky
  failures without failing the run.
- --coverage-min PCT and --coverage-diff BASE enforce coverage gates from
  the lcov report (summary comparison via Report::read_lcov_summary).
- vbs fuzz compiles a libFuzzer target with clang
  (-fsanitize=fuzzer,address,undefined), runs it over a corpus and reports
  crash artifacts.

Verified: doctest_extracts_compiles_and_runs_blocks,
test_sharding_partitions_tests_and_records_timings,
test_rerun_failed_and_known_flaky,
coverage_gates_enforce_minimum_and_baseline and
fuzz_builds_targets_and_reports_crashes pass; CLI contracts pass;
clang-format clean.
This commit is contained in:
faumaray committed 2026-12-06 20:21:51 +03:00
1 parent 3b5d28d7b0
commit 455a403429
13 files changed
+1238 -7

No files matched your search

+2
View File
@@ -401,6 +401,8 @@ Stage: VERIFIED — Plans 01–19 + Plan 20 Slices 1–2C + Track A + Track B (B
## Remaining future scope
- **Wave 152 (Test depth and fuzzing, G8)**: `vbs doctest` extracts fenced C++ blocks from `///`, `//!` and Doxygen comment blocks, compiles each as the body of `main()` with `#line` mapping (so errors point at the header), links optional `--source` files and reports block pass/fail. The test runner gained `--shard I/N` (fixture-aware clustering, greedy balancing by the previous run's recorded timings in `<build>/.vbs/test_timings.json`), `--rerun-failed` (reads `<build>/.vbs/last_failed_tests.json` and re-runs only the failed closure), `--known-flaky FILE` (flaky failures are reported but do not fail the run) and coverage gates `--coverage-min PCT` / `--coverage-diff BASE` (lcov summary comparison). `vbs fuzz` builds a libFuzzer target with clang (`-fsanitize=fuzzer,address,undefined`), runs it over a corpus and reports crash artifacts. Verified by `doctest_extracts_compiles_and_runs_blocks`, `test_sharding_partitions_tests_and_records_timings`, `test_rerun_failed_and_known_flaky`, `coverage_gates_enforce_minimum_and_baseline` and `fuzz_builds_targets_and_reports_crashes`.
- **Wave 151 (Profiles and toolchain pinning, G3)**: `Dependency::profile(name, DependencyProfileOptions)` stores per-profile compile/link options, defines, LTO and sanitizers; the native provider applies the matching override to the dependency's own `ProfileContext` and includes the overrides in the provider input hash, so changing them invalidates cached dependency builds. `vbs-toolchain.toml` pins compiler, minimum version, C/C++ standards and sysroot (with a `strict` field); it is loaded once per build and checked after every toolchain probe, warning on drift or failing with `--locked-toolchain` (or `strict = true`). `vbs profile list|show|diff` lists declared profiles with parents, prints one resolved profile, or reports the fields that differ between two. Verified by `FullV1Tests.dependency_profile_overrides_apply_to_native_builds`, `toolchain_pin_detects_and_enforces_drift` and `profile_commands_list_show_and_diff`.
- **Wave 150 (Real feature flags, G2)**: `Project::feature(name, default_on)` (or `FeatureDescription`), `Target::require_feature(name)` (renamed because `requires` is a C++20 keyword), and `Dependency::when(feature)` for optional dependencies. `--features a,b` / `--no-default-features` on build/test/run/explain/deps (or `VBS_FEATURE`-style CLI only) perform additive unification: defaults (unless disabled) + features required by targets + requested features; enabled features add `VBS_FEATURE_<NAME>` compile definitions to every target (so action keys and the cache are feature-aware) and the descriptor JSON/`vbs metadata` expose declared features with their enabled state. Optional dependencies are filtered before resolution, so the lock contains only active ones; `vbs explain --show-features` prints the unified set with reasons (default/requested/required by target). Verified by `FullV1Tests.features_unify_defines_and_invalidate_action_keys` and `FullV1Tests.optional_dependencies_follow_feature_selection`.