Add root AGENT.md with project conventions, build verification steps, source layout, style rules, and real-time/concurrency requirements. Add per-module AGENT.md files for each existing and proposed source subdirectory. Add AUDIT_REPORT.md as a historical Phase 1 snapshot documenting memory management, error handling, concurrency model, naming conventions, and anti-pattern catalog.
41 lines
1.4 KiB
Markdown
41 lines
1.4 KiB
Markdown
# tests module
|
|
|
|
## Owned files
|
|
|
|
- TestMain.cpp
|
|
|
|
## Rules
|
|
|
|
- Keep this a headless console harness that drives the real SerumAltAudioProcessor.
|
|
- Check rendered blocks for NaN and inf. Check non-silence over the full preset render, not each block, because note release can legitimately produce silent blocks.
|
|
- Print PASS or FAIL per preset to `std::cout`.
|
|
- Return a non-zero exit code when any check fails.
|
|
- Never show a JUCE alert window.
|
|
- Do not add GUI interaction beyond `juce::ScopedJuceInitialiser_GUI`.
|
|
|
|
## IF-THEN
|
|
|
|
- IF a check fails THEN increment the failure count and print the preset name.
|
|
- Build and run natively from the repository root with `./build_harness.sh --run`. Building the `SerumAltTest` target alone does not run checks.
|
|
- The harness-only configuration sets `SERUMALT_BUILD_PLUGIN=OFF` and `SERUMALT_BUILD_TESTS=ON`. Production scripts disable the harness.
|
|
- The harness links the real processor and editor sources but creates no plugin bundles. Keep that build separation when adding checks.
|
|
|
|
## Examples
|
|
|
|
```cpp
|
|
// BAD: a failing check does not fail the run
|
|
bool ok = ! hasNaN (buffer) && peak (buffer) > 0.001f; // result ignored
|
|
return 0;
|
|
```
|
|
|
|
```cpp
|
|
// GOOD: accumulate failures and exit non-zero
|
|
int failures = 0;
|
|
const bool ok = ! hasNaN (buffer) && peak (buffer) > 0.001f;
|
|
if (! ok) ++failures;
|
|
...
|
|
return failures == 0 ? 0 : 1;
|
|
```
|
|
|
|
This file overrides /AGENT.md where they conflict.
|