From 54dac9ed39993803c27165cfad15075f409eddca Mon Sep 17 00:00:00 2001 From: thorek1 Date: Tue, 12 Sep 2023 00:19:26 +0200 Subject: [PATCH] test case with >2 shocks and more GC --- test/functionality_tests.jl | 4 +++ test/runtests.jl | 60 +++++++++++-------------------------- 2 files changed, 22 insertions(+), 42 deletions(-) diff --git a/test/functionality_tests.jl b/test/functionality_tests.jl index c7e66aef..7a23f24e 100644 --- a/test/functionality_tests.jl +++ b/test/functionality_tests.jl @@ -123,6 +123,8 @@ function functionality_test(m; algorithm = :first_order, plots = true, verbose = new_moms4 = get_mean(m, algorithm = algorithm, verbose = true, parameters = (string.(m.parameters[1:2]) .=> m.parameter_values[1:2] * 1.000)) end + GC.gc() + if algorithm == :first_order irfs_nv = get_irf(m, m.parameter_values) irfs = get_irf(m, m.parameter_values, verbose = true) @@ -391,6 +393,7 @@ function functionality_test(m; algorithm = :first_order, plots = true, verbose = new_sols4 = get_solution(m, algorithm = algorithm, verbose = true, parameters = (string.(m.parameters[1:2]) .=> m.parameter_values[1:2] / 1.0001)) old_sols = get_solution(m, algorithm = algorithm, verbose = true, parameters = old_par_vals) + GC.gc() # irfs irfs_nv = get_irf(m, algorithm = algorithm) irfs = get_irf(m, verbose = true, algorithm = algorithm) @@ -465,6 +468,7 @@ function functionality_test(m; algorithm = :first_order, plots = true, verbose = sims = simulate(m, algorithm = algorithm) + GC.gc() # Inspect Model get_equations(m) get_steady_state_equations(m) diff --git a/test/runtests.jl b/test/runtests.jl index 5b1e17da..a2494101 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -116,12 +116,30 @@ GC.gc() functionality_test(m) end m = nothing +GC.gc() + + +@testset verbose = true "RBC_CME with calibration equations, parameter definitions, special functions, variables in steady state, and leads/lag > 1 on endogenous and exogenous variables pruned second order" begin + include("models/RBC_CME_calibration_equations_and_parameter_definitions_lead_lags.jl") + functionality_test(m, algorithm = :pruned_second_order, plots = false) +end +m = nothing +GC.gc() + +@testset verbose = true "RBC_CME with calibration equations, parameter definitions, special functions, variables in steady state, and leads/lag > 1 on endogenous and exogenous variables pruned third order" begin + include("models/RBC_CME_calibration_equations_and_parameter_definitions_lead_lags.jl") + functionality_test(m, algorithm = :pruned_third_order, plots = false) +end +m = nothing +GC.gc() + @testset verbose = true "RBC_CME with calibration equations, parameter definitions, special functions, variables in steady state, and leads/lag > 1 on endogenous and exogenous variables numerical SS" begin include("models/RBC_CME_calibration_equations_and_parameter_definitions_lead_lags_numsolve.jl") functionality_test(m) end m = nothing +GC.gc() @testset verbose = true "RBC_CME with calibration equations, parameter definitions, and special functions" begin include("models/RBC_CME_calibration_equations_and_parameter_definitions_and_specfuns.jl") @@ -144,13 +162,6 @@ end m = nothing GC.gc() -@testset verbose = true "RBC_CME with calibration equations and parameter definitions pruned second order" begin - include("models/RBC_CME_calibration_equations_and_parameter_definitions.jl") - functionality_test(m, algorithm = :pruned_second_order, plots = false) -end -m = nothing -GC.gc() - @testset verbose = true "RBC_CME with calibration equations and parameter definitions third order" begin include("models/RBC_CME_calibration_equations_and_parameter_definitions.jl") functionality_test(m, algorithm = :third_order, plots = false) @@ -158,13 +169,6 @@ end m = nothing GC.gc() -@testset verbose = true "RBC_CME with calibration equations and parameter definitions pruned third order" begin - include("models/RBC_CME_calibration_equations_and_parameter_definitions.jl") - functionality_test(m, algorithm = :pruned_third_order, plots = false) -end -m = nothing -GC.gc() - @testset verbose = true "RBC_CME with calibration equations" begin @@ -181,13 +185,6 @@ end m = nothing GC.gc() -@testset verbose = true "RBC_CME with calibration equations pruned second order" begin - include("models/RBC_CME_calibration_equations.jl") - functionality_test(m, algorithm = :pruned_second_order, plots = false) -end -m = nothing -GC.gc() - @testset verbose = true "RBC_CME with calibration equations third order" begin include("models/RBC_CME_calibration_equations.jl") functionality_test(m, algorithm = :third_order, plots = false) @@ -195,13 +192,6 @@ end m = nothing GC.gc() -@testset verbose = true "RBC_CME with calibration equations pruned third order" begin - include("models/RBC_CME_calibration_equations.jl") - functionality_test(m, algorithm = :pruned_third_order, plots = false) -end -m = nothing -GC.gc() - @testset verbose = true "RBC_CME" begin include("models/RBC_CME.jl") @@ -218,14 +208,6 @@ m = nothing GC.gc() -@testset verbose = true "RBC_CME pruned second order" begin - include("models/RBC_CME.jl") - functionality_test(m, algorithm = :pruned_second_order, plots = false) -end -m = nothing -GC.gc() - - @testset verbose = true "RBC_CME third order" begin include("models/RBC_CME.jl") functionality_test(m, algorithm = :third_order, plots = false) @@ -234,12 +216,6 @@ m = nothing GC.gc() -@testset verbose = true "RBC_CME pruned third order" begin - include("models/RBC_CME.jl") - functionality_test(m, algorithm = :pruned_third_order, plots = false) -end -m = nothing -GC.gc() @testset verbose = true "Model without shocks" begin