diff --git a/tests/runalltests.m b/tests/runalltests.m
index db142da603a8277dd672c9596a8af42d6372ad36..b82d9c6e2a1788fbf278d0d5528cbcdb843ab3ff 100644
--- a/tests/runalltests.m
+++ b/tests/runalltests.m
@@ -1,6 +1,6 @@
 function runalltests()
 
-% Copyright (C) 2015-2018 Dynare Team
+% Copyright (C) 2015-2019 Dynare Team
 %
 % This code is free software: you can redistribute it and/or modify
 % it under the terms of the GNU General Public License as published by
@@ -15,8 +15,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/>.
 
-dseries_src_root = []; % Initialize path as an array to be updated
-                       % when calling initialize_dseries_toolbox() script.
+dseries_src_root = strrep(which('runalltests'),'tests/runalltests.m','');
 
 opath = path();