From 3d2f4e3ed1df73ec5f0dd6c91ccc1ecc8507a3ef Mon Sep 17 00:00:00 2001 From: Julia Pineda Date: Fri, 29 Sep 2023 16:06:47 +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 6326d7b7..0f47128a 100644 --- a/test/runHWTests.m +++ b/test/runHWTests.m @@ -85,10 +85,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); @@ -99,5 +103,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