44
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1 % UTP_RUN Runs the UTP tests found in the 'utps' directory. If no output
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2 % argument is specified a results report is generated and printed to screen,
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3 % otherwise the results are returned.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5 % USAGE:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7 % >> % run all the tests in the 'utps' directory
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8 % >> utp_run();
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10 % >> % run the UTPs with the given names
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11 % >> utp_run('utp_classname_fcn1', 'utp_classname_fcn2', ...);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13 % >> % run a reduced set of UTPs operating on the listed classes
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14 % >> utp_run('classname1', 'classname2', ...);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
15 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16 % EXAMPLES:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
17 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18 % >> utp_run();
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
19 % >> utp_run('utp_ao_ao');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
20 % >> utp_run('utp_ao_ao', 'utp_ao_abs');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
21 % >> utp_run('ao', 'tsdata', 'fsdata');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
22 % >> utp_run('ao', 'tsdata', 'fsdata', pl);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
23 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
24 % pl keys
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
25 % 'tests' - cell array of strings above
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
26 % 'no repository' - true/false
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
27 % 'skip tests' - cell array of tests to skip
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
28 % 'skip classes' - cell array of classes to skip
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
29 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
30 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
31 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
32 % $Id: utp_run.m,v 1.20 2010/08/09 16:38:49 ingo Exp $
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
33
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
34 function varargout = utp_run(varargin)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
35
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
36 % save current path
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
37 oldpath = path();
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
38
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
39 [pl, dummy, rest] = utils.helper.collect_objects(varargin(:), 'plist');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
40
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
41 % Make sure that pl is a PLIST
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
42 pl = combine(plist(), pl);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
43
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
44 skipClasses = pl.find('skip classes', '');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
45 skipTests = pl.find('skip tests', '');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
46 tests = pl.find('tests', '');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
47 noRepository = pl.find('no repository', false);
|
51
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
48
|
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
49 hostname = pl.find('hostname', '130.75.117.67');
|
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
50 database = pl.find('database', 'ltpda_test');
|
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
51 username = pl.find('username', 'tester');
|
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
52 password = pl.find('password', 'a1b2c3d4');
|
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
53
|
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
54 setappdata(0, 'LTPDAUtpRepositoryHostname', hostname);
|
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
55 setappdata(0, 'LTPDAUtpRepositoryDatabase', database);
|
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
56 setappdata(0, 'LTPDAUtpRepositoryUsername', username);
|
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
57 setappdata(0, 'LTPDAUtpRepositoryPassword', password);
|
44
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
58
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
59 if ~isempty(rest) && ~isempty(tests)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
60 tests = [reshape(cellstr(tests), 1, []), reshape(rest, 1, [])];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
61 elseif ~isempty(tests)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
62 tests = cellstr(tests);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
63 elseif ~isempty(rest)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
64 tests = rest;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
65 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
66
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
67 try
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
68 % add support functions and UTPs folders to path
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
69 utppath = fileparts(which('utp_run'));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
70 addpath(genpath(utppath));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
71
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
72 % list of the classes for which we have UTPs
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
73 classes = {};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
74
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
75 % cell array to hold UTP function names to run
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
76 utps = {};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
77
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
78 % check for input arguments
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
79 if numel(tests) > 0
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
80
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
81 % check if input argument is a list of UTP function names
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
82 if all(strncmp(tests, 'utp_', 4))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
83 % add the given UTPs to the list of test functions to run
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
84 for kk = 1:numel(tests)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
85 uname = tests{kk};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
86 % check if the given UTPs exist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
87 if exist(uname, 'file') == 2
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
88 utps = addUtpTest(utps, tests(kk));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
89 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
90 error('### test ''%s'' not found\n', uname);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
91 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
92 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
93 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
94 % assume input argument is a list of classes
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
95 for kk = 1:numel(tests)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
96 cname = tests{kk};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
97 % check if it exists
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
98 if exist(fullfile(utppath, 'utps', cname), 'dir')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
99 classes = [classes {cname}];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
100 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
101 error('### test class ''%s'' not found\n', cname);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
102 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
103 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
104 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
105
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
106 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
107
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
108 % list of all the classes we have UTPs for
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
109 d = dir(fullfile(utppath, 'utps'));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
110 for kk = 1:numel(d)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
111 if ~d(kk).isdir
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
112 continue;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
113 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
114 if d(kk).name(1) == '.'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
115 continue;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
116 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
117 if strcmp(d(kk).name, 'CVS')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
118 continue;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
119 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
120
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
121 % Skip classes
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
122 if utils.helper.ismember(d(kk).name, skipClasses)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
123 continue;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
124 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
125 classes = [classes {d(kk).name}];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
126 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
127
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
128 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
129
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
130 % add to the UPTs function name list the UTPs for each class in the list
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
131 for kk = 1:numel(classes)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
132 mfiles = dir(fullfile(utppath, 'utps', classes{kk}));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
133 % identify all UTP functions
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
134 for jj=1:length(mfiles)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
135 [pathstr, name, ext] = fileparts(mfiles(jj).name);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
136 if ~strcmp(ext, '.m')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
137 continue;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
138 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
139 try
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
140 utps = addUtpTest(utps, name);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
141 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
142 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
143 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
144
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
145 % number of collected UTPs to run
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
146 fprintf('%d UTPs to run\n', numel(utps));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
147
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
148 % initialize timer to measure UTPs execution time
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
149 tic();
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
150
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
151 % call each UTP function and collect the results
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
152 results = [];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
153 for jj=1:length(utps)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
154 try
|
51
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
155 results = [results eval(utps{jj})]
|
44
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
156 catch ex
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
157 % report the error failure in running the UTP
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
158 stack.name = 'xx';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
159 message = ['exception: ' ex.message];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
160 results = [results utp_prepare_result(false, false, stack, utps{jj}, message)];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
161 % show error on console
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
162 fprintf(2, ['\n' ex.getReport()]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
163 fprintf(1, '\n');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
164 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
165 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
166
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
167 % set output
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
168 if nargout == 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
169 varargout{1} = results;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
170 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
171 display_utp_results(results)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
172 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
173
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
174 catch ex
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
175 % restore original path
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
176 path(oldpath);
|
51
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
177 % remove appdata
|
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
178 rmappdata(0, 'LTPDAUtpRepositoryHostname');
|
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
179 rmappdata(0, 'LTPDAUtpRepositoryDatabase');
|
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
180 rmappdata(0, 'LTPDAUtpRepositoryUsername');
|
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
181 rmappdata(0, 'LTPDAUtpRepositoryPassword');
|
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
182 % propagate exception
|
44
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
183 rethrow(ex);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
184 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
185
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
186 % restore original path
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
187 path(oldpath);
|
51
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
188 % remove appdata
|
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
189 rmappdata(0, 'LTPDAUtpRepositoryHostname');
|
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
190 rmappdata(0, 'LTPDAUtpRepositoryDatabase');
|
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
191 rmappdata(0, 'LTPDAUtpRepositoryUsername');
|
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
192 rmappdata(0, 'LTPDAUtpRepositoryPassword');
|
44
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
193
|
51
9d5c88356247
Make unit tests database connection parameters configurable
Daniele Nicolodi <nicolodi@science.unitn.it>
diff
changeset
|
194
|
44
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
195 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
196 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
197 % FUNCTION: addUtpTest
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
198 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
199 % DESCRIPTION: Local method which adds an UTP to the UTP list if it pass
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
200 % all conditions.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
201 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
202 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
203 function utpsLocal = addUtpTest(utpsLocal, utpIn)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
204
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
205 utpIn = cellstr(utpIn);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
206
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
207 % Check if the UTP name is a UTP
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
208 if feval(utpIn{1}, 'isutp')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
209
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
210 addUTP = true;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
211 % Skip the UTPs if it needs a repository.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
212 if noRepository && feval(utpIn{1}, 'needs repository') == 2
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
213 addUTP = false;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
214 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
215 % Skip the UTPs if it is in the skil list.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
216 if utils.helper.ismember(utpIn{1}, skipTests)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
217 addUTP = false;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
218 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
219
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
220 if addUTP
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
221 utpsLocal = [utpsLocal utpIn];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
222 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
223
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
224 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
225
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
226 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
227
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
228 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
229
|