Add CTest-based CLI smoke tests and fix CLI WAV sample-rate handling#1350
Add CTest-based CLI smoke tests and fix CLI WAV sample-rate handling#1350olilarkin wants to merge 1 commit into
Conversation
Code ReviewOverviewThis PR adds a CTest-based smoke test suite for the CLI target and fixes a real bug: Bug Fix (
|
| Area | Verdict |
|---|---|
| Bug fix | Correct and well-tested |
| CMake integration | Mostly sound; standalone-vs-subdirectory mode is slightly inconsistent |
| Python smoke tests | Good coverage of the happy path; minor style issues; no error-path or audio-content tests |
| Conventions (2-space indent, C++17, etc.) | Python file follows PEP 8; C++ change is one line and matches surrounding style |
The core fix and test infrastructure are solid. The items above are mostly polish — the most actionable ones are the enable_testing() guard and adding at least one negative-path test.
Motivation
--sris provided.Description
include(CTest)toCMakeLists.txtso tests can be discovered and run.Tests/CLIwithCMakeLists.txtthat buildsIPlugCLITest-cliand registers two tests: a build fixture and a Python smoke test run of the executable.Tests/CLI/cli_smoke_test.pythat exercises--info,--params/--param,--set/--set-name/--set-norm,--save-params/--load-params, generated text/WAV output (--sine+--output-txt/--output),--process-file, and MIDI render flows with--midi/--render.Tests/CLIinto the existing test list by addingadd_subdirectory(CLI)toTests/CMakeLists.txt.outputSampleRatewhen--sris parsed inIPlug/CLI/IPlugCLI_main.cppso generated WAV headers reflect the requested sample rate.Testing
cmake -S Examples/IPlugCLITest -B build-cli-testandcmake --build build-cli-test --target IPlugCLITest-cli, then exercised commands like--info,--set,--sine --output-txtand--sine --outputwhich returned expected outputs (exit code 0 and correct files written).cmake -S Tests/CLI -B build-cli-suite -DCMAKE_BUILD_TYPE=Debugand ranctest --test-dir build-cli-suite --output-on-failure, and all registered tests passed.Codex Task