From 533664d28b8bd28fbfdea3a7f7c0b1edae007140 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Tue, 21 Sep 2021 16:21:45 +0200
Subject: [PATCH] tests/ep/rbcii.mod: use supported mechanism for user-provided
 steady state file

Incidentally, this should fix random crashes under Octave (where the manually
copied steady state file was not correctly detected by the interpreter).

(cherry picked from commit d62a09cdefde1e94cf7dc475f7bbfa12d2cc601e)
---
 tests/.gitignore                                       | 2 +-
 tests/ep/rbcii.mod                                     | 4 ----
 tests/ep/{rbcii_steady_state.m => rbcii_steadystate.m} | 6 ++++--
 3 files changed, 5 insertions(+), 7 deletions(-)
 rename tests/ep/{rbcii_steady_state.m => rbcii_steadystate.m} (96%)

diff --git a/tests/.gitignore b/tests/.gitignore
index 7f26c7b226..0ba4080d91 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -48,7 +48,7 @@ wsOct
 !/ep/ar_steadystate.m
 !/ep/exact_solution.m
 !/ep/mean_preserving_spread.m
-!/ep/rbcii_steady_state.m
+!/ep/rbcii_steadystate.m
 !/estimation/fsdat_simul.m
 !/estimation/method_of_moments/AnScho/AnScho_MoM_data_2.mat
 !/estimation/method_of_moments/RBC/RBC_MoM_steady_helper.m
diff --git a/tests/ep/rbcii.mod b/tests/ep/rbcii.mod
index c7832e4681..6e53839497 100644
--- a/tests/ep/rbcii.mod
+++ b/tests/ep/rbcii.mod
@@ -54,10 +54,6 @@ model(use_dll);
 
 end;
 
-// Write analytical steady state file (without globals)
-options_.steadystate_flag = 2;
-copyfile('rbcii_steady_state.m','+rbcii/steadystate.m');
-
 @#if extended_path_version
 
     shocks;
diff --git a/tests/ep/rbcii_steady_state.m b/tests/ep/rbcii_steadystate.m
similarity index 96%
rename from tests/ep/rbcii_steady_state.m
rename to tests/ep/rbcii_steadystate.m
index 5fc2dcb1ae..8ef6c6ffd0 100644
--- a/tests/ep/rbcii_steady_state.m
+++ b/tests/ep/rbcii_steadystate.m
@@ -1,5 +1,7 @@
-function [ys_, params, info] = rbcii_steadystate2(ys_, exo_, params)
+function [ys_, params, info] = rbcii_steadystate(ys_, exo_, M_, options_)
      
+    params = M_.params;
+
     % Flag initialization (equal to zero if the deterministic steady state exists) 
     info = 0;
     
@@ -85,4 +87,4 @@ function [labour,info] = l_solver(labour,alpha,psi,theta,effstar,kstar,maxiter)
         condition = abs(r)>1e-9;
         iteration = iteration + 1; 
     end
-end
\ No newline at end of file
+end
-- 
GitLab