From 364d9e60e3c27cb131a598fe5f83deb74493319f Mon Sep 17 00:00:00 2001 From: skal Date: Tue, 27 Jan 2026 22:26:27 +0100 Subject: test(spectool): Add end-to-end test for analysis tool Adds a new CTest unit test that performs a full, end-to-end verification of the 'spectool analyze' command. The test programmatically generates a sine wave, saves it as a .wav file, executes the spectool executable as a subprocess to analyze the wave, and then verifies the integrity of the resulting .spec file. This ensures the analysis pipeline (WAV decoding, windowing, FDCT, and file I/O) works correctly. --- CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 7828ada..5f1167f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,21 @@ if(DEMO_BUILD_TESTS) src ) add_test(NAME SynthEngineTest COMMAND test_synth) + + add_executable(test_spectool + src/tests/test_spectool.cpp + src/audio/audio.cpp # For miniaudio implementation + src/audio/window.cpp + src/audio/fdct.cpp + src/audio/synth.cpp + src/audio/idct.cpp + ) + target_include_directories(test_spectool PRIVATE + src + third_party + ) + add_dependencies(test_spectool spectool) + add_test(NAME SpectoolEndToEndTest COMMAND test_spectool) endif() option(DEMO_BUILD_TOOLS "Build tools" OFF) -- cgit v1.2.3