tests : use CMake definitions for model/sample paths (#3406)

This commit modifies the test-vad and test-vad-full tests to use CMake
definitions for the model and sample paths.

The motivation for this is that currently the tests use relative paths
which might not always be correct depending on the working directory.
With the changes in this commit the tests can be run usins ctest:
```console
$ ctest -R ^test-vad$ --test-dir build
```
Or directly (which is not currently possible without this fix):
```
./build/bin/test-vad
```

Resolves: https://github.com/ggml-org/whisper.cpp/issues/3404
This commit is contained in:
Daniel Bevenius
2025-09-04 15:08:30 +02:00
committed by GitHub
parent 7745fcf328
commit 9bfc535130
3 changed files with 13 additions and 6 deletions
+2 -2
View File
@@ -48,8 +48,8 @@ struct whisper_vad_segments * test_detect_timestamps(
}
int main() {
std::string vad_model_path = "../../models/for-tests-silero-v5.1.2-ggml.bin";
std::string sample_path = "../../samples/jfk.wav";
std::string vad_model_path = VAD_MODEL_PATH;
std::string sample_path = SAMPLE_PATH;
// Load the sample audio file
std::vector<float> pcmf32;