From 43923e1fc9af223ae7f79ea6c4b73000e05143da Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Fri, 2 Oct 2020 16:45:19 +0300 Subject: [PATCH] Tools: Test: Audio: Add exist check for array configuration files The added check and print helps the user to generate the array configuration data and other beam pattern test related binary files to carry out this test for TDFB (beamformer) component. Signed-off-by: Seppo Ingalsuo --- tools/test/audio/tdfb_test.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/test/audio/tdfb_test.m b/tools/test/audio/tdfb_test.m index 51bae3aa6..f970b934f 100644 --- a/tools/test/audio/tdfb_test.m +++ b/tools/test/audio/tdfb_test.m @@ -88,7 +88,14 @@ end function test_beampattern(cfg, config_fn, simcap_fn); -load(fullfile(cfg.tunepath, config_fn)); +fn = fullfile(cfg.tunepath, config_fn); +if isfile(fn) + load(fn); +else + fprintf(1, 'Array configuration file %s does not exist.\n', config_fn); + fprintf(1, 'Please run the script example_line_array in tools/tune/tdfb directory.\n'); + error('Stopping.'); +end % Create input file test = test_defaults(bf);