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 61 62 63 64
|
%% Copyright (C) 2013-2022 Alexander Barth
%%
%% This program is free software; you can redistribute it and/or modify
%% it under the terms of the GNU General Public License as published by
%% the Free Software Foundation; either version 3 of the License, or
%% (at your option) any later version.
%%
%% This program is distributed in the hope that it will be useful,
%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
%% GNU General Public License for more details.
%%
%% You should have received a copy of the GNU General Public License
%% along with this program; If not, see <http://www.gnu.org/licenses/>.
## -*- texinfo -*-
## @deftypefn {} {} test_netcdf
## Function to do a basic test of the netcdf interface
## @end deftypefn
function test_netcdf()
import_netcdf
tests = {'test_netcdf_constant',...
'test_netcdf_create'...
'test_netcdf_low_level_interface'...
'test_netcdf_unlim',...
'test_netcdf_datatypes',...
'test_netcdf_scalar_variable',...
'test_netcdf_attributes',...
'test_netcdf_high_level_interface',...
'test_netcdf_ncwriteschema',...
'test_netcdf_ncwriteschema_unlim',...
'test_netcdf_ncwriteschema_chunking',...
'test_netcdf_ncwriteschema_group',...
'test_netcdf_user_types',...
'bug_47014'...
};
maxlen = max(cellfun(@(s) length(s),tests));
libver = netcdf.inqLibVers();
fprintf('Using NetCDF library version "%s"\n',libver)
for iindex=1:length(tests);
dots = repmat('.',1,maxlen - length(tests{iindex}));
fprintf('run %s%s ',tests{iindex},dots);
try
eval(tests{iindex});
disp(' OK ');
catch
disp(' FAIL ');
disp(lasterr)
end_try_catch
endfor
endfunction
%!test
%! fprintf ("\n");
%! test_netcdf ();
|