Debian Codegraph @

test/private/execute_tikz_stage.m

raw
1 function [status] = execute_tikz_stage(status, ipp)
2 % test stage: TikZ file generation
3 testNumber = status.index;
4 datapath = fullfile(ipp.Results.output,'data','converted');
5 gen_tex = fullfile(datapath, sprintf('test%d-converted.tex', testNumber));
6 % the value below is for inclusion into LaTeX report! Use UNIX convention.
7 gen_pdf = sprintf('data/converted/test%d-converted.pdf', testNumber);
8 cleanfigure_time = NaN;
9 m2t_time = NaN;
10
11 % now, test matlab2tikz
12 try
13 %TODO: remove this once text removal has been removed
14 oldWarn = warning('off','cleanfigure:textRemoval');
15
16 cleanfigure_time = tic;
17 cleanfigure(status.extraCleanfigureOptions{:});
18 cleanfigure_time = toc(cleanfigure_time);
19
20 warning(oldWarn);
21
22 m2t_time = tic;
23 matlab2tikz('filename', gen_tex, ...
24 'showInfo', false, ...
25 'checkForUpdates', false, ...
26 'dataPath', datapath, ...
27 'standalone', true, ...
28 ipp.Results.extraOptions{:}, ...
29 status.extraOptions{:} ...
30 );
31 m2t_time = toc(m2t_time);
32 catch %#ok
33 e = lasterror('reset'); %#ok
34 % Remove (corrupted) output file. This is necessary to avoid that the
35 % Makefile tries to compile it and fails.
36 delete(gen_tex)
37 [status.tikzStage] = errorHandler(e);
38 end
39 status.tikzStage.texFile = gen_tex;
40 status.tikzStage.pdfFile = gen_pdf;
41 status.tikzStage.m2t_time = m2t_time;
42 status.tikzStage.cleanfigure_time = cleanfigure_time;
43 end