Files
sunny360vfe_proj/test/Git_MATLAB_interface.m
2025-06-04 14:13:22 +08:00

30 lines
543 B
Matlab

% runtests.m
simulinkproject([pwd '/..']);
disp(MAV.MAV_AUTOPILOT_GENERIC);
disp(ENUM_GPS_FIXTYPE.FIX_3D);
cd test
% MATLAB runs the test
result = runtests(pwd);
ttt = table(result);
disp(ttt);
% check the result
if all(ttt.Passed) ~= 0 && any(ttt.Failed) == 0 && any(ttt.Incomplete) == 0
exit_code = 0;
else
exit_code = 1;
end
proj = slproject.getCurrentProject;
cd([proj.RootFolder '/test']);
fileID = fopen('result.txt','w');
fprintf(fileID,"%d",exit_code);
fclose(fileID);
% Ensure that we ALWAYS call exit
exit(exit_code);