Skip to content

Commit cb192a7

Browse files
committed
250906.231637.CST matlab tests: revise verify.m and profile.m to not uninstall the solvers after the tests
1 parent 29a8d37 commit cb192a7

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

matlab/tests/profile.m

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -186,23 +186,21 @@
186186

187187
end
188188

189-
% Uninstall the solvers installed by the test
190-
cd(fullfile(test_dir, 'prima'));
191-
setup('uninstall');
192-
if strcmpi(options.competitor, 'archiva') || strcmpi(options.competitor, 'norma')
193-
cd(fullfile(test_dir, options.competitor));
194-
setup('uninstall');
195-
end
196-
197-
setpath(oldpath); % Restore the path to oldpath.
198-
cd(olddir); % Go back to olddir.
189+
% Restore the path to oldpath.
190+
% N.B.: Do NOT try uninstalling the solvers, because we may call `verify` again with 'ncp', which
191+
% means not to compile the solvers and reuse the existing MEX files, which would fail if we
192+
% uninstall the solvers here.
193+
setpath(oldpath);
194+
195+
% Go back to olddir.
196+
cd(olddir);
199197
fprintf('\nCurrently in %s\n\n', pwd());
200198

199+
% `dev_arch` a subdirectory of fullfile(s_root_dir, 'archiva'). It contains the "archiva" version of
200+
% solvers used as a benchmark for the development of the current version of the solvers.
201+
% It may not be the latest archiva version. To make sure that it is the one desired, we print the
202+
% path of `dev_arch` here if the competitor is 'archiva'
201203
if strcmpi(options.competitor, 'archiva')
202-
% `dev_arch` a subdirectory of fullfile(s_root_dir, 'archiva'). It contains the "archiva" version of
203-
% solvers used as a benchmark for the development of the current version of the solvers.
204-
% It may not be the latest archiva version. To make sure that it is the one desired, we print the
205-
% path of `dev_arch` here if the competitor is 'archiva'
206204
archiva_dir_name = 'dev_arch';
207205
mfilepath = fileparts(mfilename('fullpath')); % Directory where this .m file resides.
208206
root_dir = fileparts(fileparts(mfilepath)); % root directory of the project

matlab/tests/verify.m

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,17 @@ function verify(varargin)
108108

109109
end
110110

111-
% Uninstall the solvers installed by the test
112-
cd(fullfile(test_dir, 'prima'));
113-
setup('uninstall');
114-
cd(fullfile(test_dir, 'norma'));
115-
setup('uninstall');
116-
117-
setpath(oldpath); % Restore the path to oldpath.
118-
cd(olddir); % Go back to olddir.
111+
% Restore the path to oldpath.
112+
% N.B.: Do NOT try uninstalling the solvers, because we may call `verify` again with 'ncp', which
113+
% means not to compile the solvers and reuse the existing MEX files, which would fail if we
114+
% uninstall the solvers here.
115+
setpath(oldpath);
116+
117+
% Go back to olddir.
118+
cd(olddir);
119119
fprintf('\nCurrently in %s\n\n', pwd());
120120

121-
if ~isempty(exception) % Rethrow any exception caught above.
121+
% Rethrow any exception caught above.
122+
if ~isempty(exception)
122123
rethrow(exception);
123124
end

0 commit comments

Comments
 (0)