Browse Source

add more instructions for test refactoring

test-refactor
cinnaboot 2 months ago
parent
commit
7fb2e7e5fa
  1. 17
      continue.md

17
continue.md

@ -26,10 +26,21 @@
- Replace qualitative checks (`a > b`) with quantitative (`WithinAbs(expected, tol)`)
- `INFO("label: " << value)` for debugging context
## 4. Process per file
## 4. Precalc scripts
- For each test file, create `scripts/precalc_<test_name>.py` that computes expected values.
- Use `scripts/sim_engine.py` for physics (orbital_to_cartesian, propagate, etc.).
- Output C++-style comments with precalculated constants for embedding in the test.
- Run with: `python3 scripts/precalc_<test_name>.py`
- If sim_engine.py lacks a feature (e.g., spacecraft, OrbitTracker), use analytical formulas instead (**but notify the user what feature was missing**)
## 5. Process per file
- Process **one test file at a time**.
- For each file, **discuss with the user** how to precompute `REQUIRE` values — analytical formulas, Python scripts, or simulation runs.
- Copy from `old_tests/` to `tests/`, rewrite, rebuild, verify.
- Create `scripts/precalc_<test_name>.py` and run it to get expected values.
- Copy from `old_tests/` to `tests/`, rewrite using the pattern from `test_true_anomaly_roundtrip.cpp`.
- Rewrite TOML configs to TOML 1.0 inline table syntax (single-line `{}`).
- Build and verify: `make test-build` then `./build/orbit_test '[tag]' -s`.
- Run full suite: `make test`.
- Replace broken tests (e.g., OrbitTracker bugs) with working alternatives using propagation checks.
- **Always ask for review** before moving to the next file.
- **Only commit when asked.**

Loading…
Cancel
Save