diff --git a/tests/Makefile.am b/tests/Makefile.am index c5481c18e..020749ca7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -924,6 +924,7 @@ M_OLS_TRS_FILES = $(patsubst %.mod, %.m.trs, $(OLS_MODFILES)) # Matlab TRS Files M_TRS_FILES = $(patsubst %.mod, %.m.trs, $(MODFILES)) M_TRS_FILES += run_block_byte_tests_matlab.m.trs run_reporting_test_matlab.m.trs run_all_unitary_tests.m.trs +M_TRS_FILES += test_aggregate_routine_1_2.m.trs test_aggregate_routine_1_2_3.m.trs M_XFAIL_TRS_FILES = $(patsubst %.mod, %.m.trs, $(XFAIL_MODFILES)) # Octave TRS Files @@ -1048,8 +1049,24 @@ EXTRA_DIST = \ deterministic_simulations/lola_data.mat \ estimation/univariate/data.csv \ estimation/univariate/ols/mc-ols.inc \ - ecb/SURGibbs/fishdata.csv - + ecb/SURGibbs/fishdata.csv \ + test_aggregate_routine_1_2.m \ + test_aggregate_routine_1_2_3.m \ + ecb/aggregate/1/endogenous.inc \ + ecb/aggregate/1/exogenous.inc \ + ecb/aggregate/1/parameters.inc \ + ecb/aggregate/1/parameter-values.inc \ + ecb/aggregate/1/model.inc \ + ecb/aggregate/2/endogenous.inc \ + ecb/aggregate/2/exogenous.inc \ + ecb/aggregate/2/parameters.inc \ + ecb/aggregate/2/parameter-values.inc \ + ecb/aggregate/2/model.inc \ + ecb/aggregate/3/endogenous.inc \ + ecb/aggregate/3/exogenous.inc \ + ecb/aggregate/3/parameters.inc \ + ecb/aggregate/3/parameter-values.inc \ + ecb/aggregate/3/model.inc if HAVE_MATLAB check-local: check-matlab diff --git a/tests/ecb/aggregate/3/endogenous.inc b/tests/ecb/aggregate/3/endogenous.inc new file mode 100644 index 000000000..6bc2845be --- /dev/null +++ b/tests/ecb/aggregate/3/endogenous.inc @@ -0,0 +1,5 @@ +var + x3 + y3 + z3 + nu3; \ No newline at end of file diff --git a/tests/ecb/aggregate/3/exogenous.inc b/tests/ecb/aggregate/3/exogenous.inc new file mode 100644 index 000000000..78b0c6b3c --- /dev/null +++ b/tests/ecb/aggregate/3/exogenous.inc @@ -0,0 +1,4 @@ +varexo + ex3 + ey3 + ez3; \ No newline at end of file diff --git a/tests/ecb/aggregate/3/model.inc b/tests/ecb/aggregate/3/model.inc new file mode 100644 index 000000000..aa95e840b --- /dev/null +++ b/tests/ecb/aggregate/3/model.inc @@ -0,0 +1,8 @@ +[name='eq:x3'] +x3 = a2*x3(-1)+b3*nu3+c3*y3(-2)+ex3; + +[name='eq:y3'] +diff(-diff(y3)) = d3*diff(x3(-1))+e3*nu3(-1)+f3*z3(-1)+ey3; + +[name='eq:z3'] +diff(log(-z3)) = g3*log(-z3(-1))+ez3; \ No newline at end of file diff --git a/tests/ecb/aggregate/3/parameter-values.inc b/tests/ecb/aggregate/3/parameter-values.inc new file mode 100644 index 000000000..5650b370d --- /dev/null +++ b/tests/ecb/aggregate/3/parameter-values.inc @@ -0,0 +1,7 @@ +a3 = -.1; +b3 = -.2; +c3 = -.3; +d3 = -.4; +e3 = -.5; +f3 = -.6; +g3 = -.7; \ No newline at end of file diff --git a/tests/ecb/aggregate/3/parameters.inc b/tests/ecb/aggregate/3/parameters.inc new file mode 100644 index 000000000..f64aed1e0 --- /dev/null +++ b/tests/ecb/aggregate/3/parameters.inc @@ -0,0 +1 @@ +parameters a3 b3 c3 d3 e3 f3 g3; \ No newline at end of file diff --git a/tests/ecb/aggregate/test_aggregate_routine.m b/tests/ecb/aggregate/test_aggregate_routine.m deleted file mode 100644 index fbfd4862b..000000000 --- a/tests/ecb/aggregate/test_aggregate_routine.m +++ /dev/null @@ -1,4 +0,0 @@ -addpath ../../../matlab -dynare_config(); - -aggregate('toto.mod', '1', '2'); \ No newline at end of file diff --git a/tests/test_aggregate_routine_1_2.m b/tests/test_aggregate_routine_1_2.m new file mode 100644 index 000000000..795d7d4d0 --- /dev/null +++ b/tests/test_aggregate_routine_1_2.m @@ -0,0 +1,36 @@ +top_test_dir = getenv('TOP_TEST_DIR'); +addpath([top_test_dir filesep() '..' filesep() 'matlab']); + +% Test Dynare Version +if ~strcmp(dynare_version(), getenv('DYNARE_VERSION')) + error('Incorrect version of Dynare is being tested') +end + +% To add default directories, empty dseries objects +dynare_config(); + +disp(''); +disp(['*** TESTING: test_aggregate_routine_1_2.m.trs ***']); +try + aggregate('toto2.mod', {}, 'ecb/aggregate/1', 'ecb/aggregate/2'); + testFailed = false; +catch + testFailed = true; +end + +cd(getenv('TOP_TEST_DIR')); +fid = fopen('test_aggregate_routine_1_2.m.trs', 'w+'); +if testFailed + fprintf(fid,':test-result: FAIL\n'); + fprintf(fid,':number-tests: 1\n'); + fprintf(fid,':number-failed-tests: 1\n'); + fprintf(fid,':list-of-failed-tests: test_aggregate_routine_1_2.m\n'); +else + fprintf(fid,':test-result: PASS\n'); + fprintf(fid,':number-tests: 1\n'); + fprintf(fid,':number-failed-tests: 0\n'); + fprintf(fid,':list-of-passed-tests: test_aggregate_routine_1_2.m\n'); +end +fprintf(fid,':elapsed-time: %f\n',0.0); +fclose(fid); +exit; \ No newline at end of file diff --git a/tests/test_aggregate_routine_1_2_3.m b/tests/test_aggregate_routine_1_2_3.m new file mode 100644 index 000000000..91b44134f --- /dev/null +++ b/tests/test_aggregate_routine_1_2_3.m @@ -0,0 +1,36 @@ +top_test_dir = getenv('TOP_TEST_DIR'); +addpath([top_test_dir filesep() '..' filesep() 'matlab']); + +% Test Dynare Version +if ~strcmp(dynare_version(), getenv('DYNARE_VERSION')) + error('Incorrect version of Dynare is being tested') +end + +% To add default directories, empty dseries objects +dynare_config(); + +disp(''); +disp(['*** TESTING: test_aggregate_routine_1_2_3.m.trs ***']); +try + aggregate('toto3.mod', {}, 'ecb/aggregate/1', 'ecb/aggregate/2', 'ecb/aggregate/3'); + testFailed = false; +catch + testFailed = true; +end + +cd(getenv('TOP_TEST_DIR')); +fid = fopen('test_aggregate_routine_1_2_3.m.trs', 'w+'); +if testFailed + fprintf(fid,':test-result: FAIL\n'); + fprintf(fid,':number-tests: 1\n'); + fprintf(fid,':number-failed-tests: 1\n'); + fprintf(fid,':list-of-failed-tests: test_aggregate_routine_1_2_3.m\n'); +else + fprintf(fid,':test-result: PASS\n'); + fprintf(fid,':number-tests: 1\n'); + fprintf(fid,':number-failed-tests: 0\n'); + fprintf(fid,':list-of-passed-tests: test_aggregate_routine_1_2_3.m\n'); +end +fprintf(fid,':elapsed-time: %f\n',0.0); +fclose(fid); +exit; \ No newline at end of file