comparison runtestsAll.m @ 138:344bde2f9d9b

Added a function to run all tests in a folder including all tests in subpackages.
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 23 Feb 2016 13:22:00 +0100
parents
children cd571e8ec1fd
comparison
equal deleted inserted replaced
137:2b133d833668 138:344bde2f9d9b
1 function res = runtestsAll()
2 l = dir();
3
4 dirNames = {l([l.isdir]).name};
5
6 packages = {};
7 for i = 1:length(dirNames)
8 if dirNames{i}(1) == '+'
9 packages{end+1} = dirNames{i}(2:end);
10 end
11 end
12
13 rootSuite = matlab.unittest.TestSuite.fromFolder(pwd);
14 packageSuites = {};
15 for i = 1:length(packages)
16 packageSuites{i} = matlab.unittest.TestSuite.fromPackage(packages{i});
17 end
18
19 ts = [rootSuite, packageSuites{:}];
20
21 res = ts.run();
22 end