Skip to content

Commit

Permalink
enhance matlab build and test
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Jul 24, 2020
1 parent 37f9835 commit dcbd0a0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
5 changes: 4 additions & 1 deletion matlab/build.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ function build(srcdir)

assert(is_folder(srcdir), 'source directory not found: %s', srcdir)

[ret, msg] = system('ctest -S ', srcdir, ' setup.cmake -VV');
setup_file = fullfile(srcdir, '/setup.cmake');
assert(is_file(setup_file), 'could not find setup.cmake %', setup_file)

[ret, msg] = system(sprintf('ctest -S %s -VV', setup_file));
assert(ret==0, 'cmake failed to build %s', msg)

end
16 changes: 13 additions & 3 deletions tests/test_iri2016.m
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
% setup
cwd = fileparts(mfilename('fullpath'));
addpath(fullfile(cwd, '/../matlab'))

%% simple
time = datenum(2015,12,13,10,0,0);
glat = 65.1;
glon = -147.5;
altkmrange = [100,1000,10];

cwd = fileparts(mfilename('fullpath'));
addpath(fullfile(cwd, '/../matlab'))

iono = iri2016(time, glat, glon, altkmrange);

assert(abs(iono.Ne(11) - 3.986688e9) < 1e5, 'Ne error excessive')
Expand All @@ -16,3 +17,12 @@
else
disp('OK: IRI2016 Matlab')
end

%% build
srcdir = fullfile(cwd, '/../src/iri2016');
build(srcdir)
name = 'iri2016_driver';
if ispc
name = [name, '.exe'];
end
assert(is_file(fullfile(srcdir, name)))

0 comments on commit dcbd0a0

Please sign in to comment.