From f5f71ca8387f9e7d98b171a8112ddbc4f8abeac8 Mon Sep 17 00:00:00 2001 From: Houtan Bastani Date: Fri, 21 Oct 2016 17:14:46 +0200 Subject: [PATCH] test suite: load Octave packages potentially needed when running test suite --- tests/load_octave_packages.m | 21 +++++++++++++++++++++ tests/run_all_unitary_tests.m | 4 ++++ tests/run_o_script.m | 2 ++ tests/run_reporting_test_octave.m | 4 +++- tests/run_test_octave.m | 4 +++- 5 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 tests/load_octave_packages.m diff --git a/tests/load_octave_packages.m b/tests/load_octave_packages.m new file mode 100644 index 000000000..886bf644b --- /dev/null +++ b/tests/load_octave_packages.m @@ -0,0 +1,21 @@ +## Copyright (C) 2016 Dynare Team +## +## This file is part of Dynare. +## +## Dynare 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. +## +## Dynare 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 Dynare. If not, see . + +pkg load io +pkg load optim +pkg load control +pkg load statistics \ No newline at end of file diff --git a/tests/run_all_unitary_tests.m b/tests/run_all_unitary_tests.m index 2643b906d..c48e9df2c 100644 --- a/tests/run_all_unitary_tests.m +++ b/tests/run_all_unitary_tests.m @@ -15,6 +15,10 @@ % You should have received a copy of the GNU General Public License % along with Dynare. If not, see . +if isoctave + load_octave_packages +end + top_test_dir = getenv('TOP_TEST_DIR'); addpath(top_test_dir); addpath([top_test_dir filesep '..' filesep 'matlab']); diff --git a/tests/run_o_script.m b/tests/run_o_script.m index 1f62d2d00..3edba0582 100644 --- a/tests/run_o_script.m +++ b/tests/run_o_script.m @@ -15,6 +15,8 @@ ## You should have received a copy of the GNU General Public License ## along with Dynare. If not, see . +load_octave_packages + top_test_dir = getenv('TOP_TEST_DIR'); [mfile, name] = strtok(getenv('FILESTEM')); diff --git a/tests/run_reporting_test_octave.m b/tests/run_reporting_test_octave.m index 0f10f5eb6..c2dd3c207 100644 --- a/tests/run_reporting_test_octave.m +++ b/tests/run_reporting_test_octave.m @@ -1,4 +1,4 @@ -## Copyright (C) 2013 Dynare Team +## Copyright (C) 2013-2016 Dynare Team ## ## This file is part of Dynare. ## @@ -15,6 +15,8 @@ ## You should have received a copy of the GNU General Public License ## along with Dynare. If not, see . +load_octave_packages + top_test_dir = getenv('TOP_TEST_DIR'); addpath(top_test_dir); addpath([top_test_dir filesep '..' filesep 'matlab']); diff --git a/tests/run_test_octave.m b/tests/run_test_octave.m index b82c84b85..cc834e31c 100644 --- a/tests/run_test_octave.m +++ b/tests/run_test_octave.m @@ -1,4 +1,4 @@ -## Copyright (C) 2009-2014 Dynare Team +## Copyright (C) 2009-2016 Dynare Team ## ## This file is part of Dynare. ## @@ -21,6 +21,8 @@ ## 'wsOct', and reloaded after Dynare has finished (this is necessary since ## Dynare does a 'clear -all'). +load_octave_packages + top_test_dir = getenv('TOP_TEST_DIR'); addpath(top_test_dir); addpath('.'); % workaround for bug in Octave 4.2.0-rc2: https://savannah.gnu.org/bugs/?49334