From ce02386f888da9f76abe2cf023da5b87c2af3b33 Mon Sep 17 00:00:00 2001 From: Julia Pineda Date: Fri, 13 Oct 2023 10:41:24 +0800 Subject: [PATCH] Return exit code based on test result Signed-off-by: Julia Pineda --- test/runHWTests.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/runHWTests.m b/test/runHWTests.m index da75375..d55034c 100644 --- a/test/runHWTests.m +++ b/test/runHWTests.m @@ -56,10 +56,14 @@ function runHWTests(board) disp(t); disp(repmat('#',1,80)); fid = fopen('failures.txt','a+'); + exitcode = 0; for test = results if test.Failed disp(test.Name); fprintf(fid,string(test.Name)+'\n'); + exitcode = 2; + elseif test.Incomplete + exitcode = 3; end end fclose(fid); @@ -70,5 +74,5 @@ function runHWTests(board) end save(['BSPTest_',datestr(now,'dd_mm_yyyy-HH_MM_SS'),'.mat'],'t'); bdclose('all'); -exit(any([results.Failed])); +exit(exitcode); end