Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a utility for running all unit tests within a project #32

Open
cavediverchris opened this issue Jan 30, 2022 · 1 comment
Open

Comments

@cavediverchris
Copy link
Owner

As a developer, I want a utility to enable me to easily run all of the unit tests within my project. If I am developing simulink models that are coupled with a Simulink Test Manager this utility will need to use that. For MATLAB code it will need to use the MATLAB unit test framework

@cavediverchris
Copy link
Owner Author

For a project based on Simulink where a test manager will exist the following code made be useful:

function runAllTests()

%projObj = currentProject;

% TODO - Find the test case file
tc = 'TestFile.mldatx';
tfObj = sltest.testmanager.load(tc);
resultsObj = run(tfObj);

% Generate a report from the results data
filePath = 'test_report.pdf';
sltest.testmanager.report(resultsObj,filePath,...
'Author','Test Engineer',...
'IncludeSimulationSignalPlots',true,...
'IncludeComparisonSignalPlots',true);
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant