Commit 55d67f12 authored by Dóra Kocsis's avatar Dóra Kocsis

fix test suite, reorganize folder structure

parent 2dbbf501
......@@ -14,6 +14,5 @@
src/subroutines/git.info
src/subroutines/git.last-commit-hash
/tests
/missing_dbnomics
/utils
\ No newline at end of file
OCTAVE ?= octave-cli
MATLAB ?= $(shell which matlab)
all: check-octave check-matlab
m-unit-tests/src/mtest.m:
git clone https://git.dynare.org/Dynare/m-unit-tests
check-octave: m-unit-tests/src/mtest.m
@cd src/subroutines;\
$(OCTAVE) --no-init-file --silent --no-history --eval "addpath([pwd() '/../../m-unit-tests/src']); runalltests" && [ ! -f ./failed ] && [ -f ./pass ]
@cd tests ;\
$(OCTAVE) --no-init-file --silent --no-history --eval "addpath([pwd() '/../m-unit-tests/src']); runalltests" && [ ! -f ./failed ] && [ -f ./pass ]
check-matlab: m-unit-tests/src/mtest.m
@$(MATLAB) -nosplash -nodisplay -r "addpath([pwd '/m-unit-tests/src']); cd src/subroutines; runalltests; quit" && [ ! -f ./tests/failed ] && [ -f ./tests/pass ]
@$(MATLAB) -nosplash -nodisplay -r "addpath([pwd '/m-unit-tests/src']); cd tests; runalltests; quit" && [ ! -f ./tests/failed ] && [ -f ./tests/pass ]
check-clean:
rm -f tests/*_test_*.m tests/*.csv tests/*.xls tests/*.xlsx tests/*.mat tests/failed tests/datafile_for_test
......
% fetch series by provider code and dataset code
df = fetch_series('provider_code', 'AMECO', 'dataset_code', 'UVGD', 'max_nb_series', 500);
test = fetch_series('provider_code', 'AMECO', 'dataset_code', 'UVGD', 'max_nb_series', 500);
ds = to_dseries(df);
% fetch one series by ID
......
......@@ -166,7 +166,7 @@ else
end
end
series_length=series_length+length(flat_series.value);
end
end
end
end
......
......@@ -21,10 +21,10 @@ function initialize_mdbnomics()
mdbnomics_src_root = strrep(which('initialize_mdbnomics'), 'initialize_mdbnomics.m', '');
% Set the subfolders to be added in the path.
p = {'subroutines'};
p = {'utils'};
% Add missing routines if dynare is not in the path
if ~exist('contains','builtin')
if ~exist('OCTAVE_VERSION', 'builtin') || ~exist('contains','builtin')
p{end+1} = 'missing/contains';
end
......
......@@ -14,6 +14,7 @@ function runalltests()
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
mdbnomics_src_root = []; % Will be updated by calling initialize_dseries_class().
opath = path();
......@@ -34,7 +35,7 @@ unit_tests_root = strrep(which('runalltests'),'runalltests.m','');
try
initialize_mdbnomics();
catch
addpath([unit_tests_root '../']);
addpath([unit_tests_root '../src']);
initialize_mdbnomics();
end
......@@ -47,7 +48,7 @@ if isoctave()
more off;
end
r = run_unitary_tests_in_directory(unit_tests_root(1:end-1));
r = run_unitary_tests_in_directory(mdbnomics_src_root(1:end-1));
delete('*.log');
......
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