Commit 94de7770 authored by Stéphane Adjemian (Charybdis)'s avatar Stéphane Adjemian (Charybdis) Committed by Stéphane Adjemian (Hermes)

Added Makefile for running all the unit tests.

parent bf79dbce
OCTAVE=octave-cli
MATLAB=`which matlab`
all: check-octave check-matlab
check-octave:
@cd tests ;\
$(OCTAVE) --no-init-file --silent --no-history runalltests.m
check-matlab:
@$(MATLAB) -nosplash -nodisplay -r "cd tests; runalltests; quit"
#!/bin/sh
if [ -f ./tests/failed ]
then
exit 1
fi
opath = path();
system('rm -f failed');
% Check that the m-unit-tests module is available.
install_unit_test_toolbox = false;
......@@ -8,12 +10,12 @@ try
initialize_unit_tests_toolbox;
catch
urlwrite('https://github.com/DynareTeam/m-unit-tests/archive/master.zip','master.zip');
warning('off','MATLAB:MKDIR:DirectoryExists')
mkdir('../externals')
warning('on','MATLAB:MKDIR:DirectoryExists')
unzip('master.zip','../externals')
delete('master.zip')
addpath([pwd() '/../externals/m-unit-tests-master/src'])
warning('off','MATLAB:MKDIR:DirectoryExists');
mkdir('../externals');
warning('on','MATLAB:MKDIR:DirectoryExists');
unzip('master.zip','../externals');
delete('master.zip');
addpath([pwd() '/../externals/m-unit-tests-master/src']);
initialize_unit_tests_toolbox;
install_unit_test_toolbox = true;
end
......@@ -22,18 +24,26 @@ end
try
initialize_dseries_toolbox;
catch
unit_tests_root = strrep(which('runalldseriestests'),'runalldseriestests.m','');
unit_tests_root = strrep(which('runalltests'),'runalltests.m','');
addpath([unit_tests_root '../src']);
initialize_dseries_toolbox;
end
if isoctave
more off;
end
tmp = dseries_src_root;
tmp = tmp(1:end-1); % Remove trailing slash.
run_unitary_tests_in_directory(tmp);
report = run_unitary_tests_in_directory(tmp);
delete('*.log');
if install_unit_test_toolbox
rmdir('../externals/m-unit-tests-master','s');
end
path(opath);
\ No newline at end of file
path(opath);
if any(~[report{:,3}])
system('touch failed');
end
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment