forked from MWSL-UnB/HERMES
-
Notifications
You must be signed in to change notification settings - Fork 0
/
executeDeployTests.m
60 lines (50 loc) · 1.82 KB
/
executeDeployTests.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
function isNotOk = executeDeployTests
%EXECUTEDEPLOYTESTS compile and execute hermes in deployed mode like in grid
% This script calls the others scripts to compile HERMES, create the
% scripts that run in the grid and execute hermesStart executable in
% deployed mode like a single job. This script should be run by the
% integration server (Jenkins) to ensure that the simulator can execute
% in deployed mode.
%
% Syntax: executeDeployTests
%
% Author: Renato Barbosa Abreu (RBA)
% Work Address: INDT Manaus
% E-mail: [email protected]
% History:
% v2.0 15 Jul 2015 (RBA) - created
%
% Copyright (c) 2015 INDT - Institute of Technology Development.
%
% The program may be used and/or copied only with the written
% permission of INDT, or in accordance with the terms and conditions
% stipulated in the agreement/contract under which the program has been
% supplied.
disp( 'Starting Hermes Deploy Test Suite' );
% Create script to jun jobs on grid
hermesGridScript;
deployDir = 'deployed';
isNotOk = true;
assert( isempty( dir( [ deployDir filesep 'runJMS*.sh' ] ) ) == false );
% Compile Hermes executable
compileHermes;
assert( isempty( dir( [ deployDir filesep 'hermesStart*' ] ) ) == false );
% Run hermesStart
% Here it does not run the grid script itself but a similiar way
cd( deployDir )
folders = dir();
folders( ~[ folders.isdir ] ) = [];
folders( ismember( { folders.name }, { '.', '..' } ) ) = [];
folderIdx = 1; % use first result folder
testFolder = [ pwd filesep folders(folderIdx).name ];
seed = 1;
command = [ fullfile( '.', 'hermesStart ' )...
testFolder ' ' ...
testFolder ' ' ...
num2str(seed) ];
system( command );
resultFiles = dir( [ testFolder filesep 'statistics_*.mat' ] );
assert( isempty( resultFiles ) == false );
% If all was ok return false
isNotOk = false;
end