From cc9a31bc70ad71b31ecce9ce83061d4a77de8ecb Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Wed, 31 May 2023 19:01:05 +0300 Subject: [PATCH 1/2] Tools: Test: Audio: Valgrind run related fixes The changes to scripts/host-testbench.sh and earlier to process_test.m have unintentionally dropped valgrind run from test. This patch enables valgrind for process_test.m runs and fixes issue in test run octave side function to silently ignore error about failed shell command. Normally test fail when there is no data or incorrect data, but a valgrind failure with correct test output was passed. Valgrind output becomes visible if testbench run trace stderr redirection to file is disabled. If not done valgrind error would stop the test but the analysis would not be printed to console. Fixes: 6b744bcc63 ("host-testbench.sh: use process_test.m for 8 components") Signed-off-by: Seppo Ingalsuo --- tools/test/audio/process_test.m | 3 +++ tools/test/audio/test_utils/test_run.m | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/test/audio/process_test.m b/tools/test/audio/process_test.m index 493abdb8ec92..63b5a1b3faeb 100644 --- a/tools/test/audio/process_test.m +++ b/tools/test/audio/process_test.m @@ -409,6 +409,9 @@ test.thdnf_max = []; % Set per component test.dr_db_min = 80; % Min. DR test.fr_rp_max_db = 0.5; % Allow 0.5 dB frequency response ripple + + % No need to collect trace + test.trace = ''; end function test = test_run_process(test) diff --git a/tools/test/audio/test_utils/test_run.m b/tools/test/audio/test_utils/test_run.m index d4e78ce9127a..d578bdee9567 100644 --- a/tools/test/audio/test_utils/test_run.m +++ b/tools/test/audio/test_utils/test_run.m @@ -92,14 +92,16 @@ fprintf(fh, 'XTRUN=\n'); end -% Override defaults in comp_run.sh -fprintf(fh, 'VALGRIND=false\n'); fclose(fh); arg = sprintf('-t %s', fn_config); rcmd = sprintf('%s %s', ex, arg); fprintf('Running ''%s''...\n', rcmd); -system(rcmd); +ret = system(rcmd); +if ret + error('''%s'' returned status %d\n', rcmd, ret); +end + delete(fn_config); end From 127e98f438ac78afcc963dded04fa3b6c4e1341e Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Tue, 6 Jun 2023 11:28:45 +0300 Subject: [PATCH 2/2] Tools: Test: Audio: Fix syntax error in test_run.m The fprintf() command prints only "#!/bin/sh". For some reason this has been ignored by interpreter but as clear error it is better to fix. Signed-off-by: Seppo Ingalsuo --- tools/test/audio/test_utils/test_run.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/audio/test_utils/test_run.m b/tools/test/audio/test_utils/test_run.m index d578bdee9567..0456bc0af2ad 100644 --- a/tools/test/audio/test_utils/test_run.m +++ b/tools/test/audio/test_utils/test_run.m @@ -55,7 +55,7 @@ test.nch_in = test.nch; end -fprintf(fh, '#!/bin/sh\n', test.comp); +fprintf(fh, '#!/bin/sh\n'); fprintf(fh, 'COMP=\"%s\"\n', test.comp); fprintf(fh, 'DIRECTION=playback\n'); fprintf(fh, 'BITS_IN=%d\n', test.bits_in);