diff --git a/.regressionignore b/.regressionignore index f921ad27f0db707609d30474cc44955a79801a3d..0c4a490e1a6ce10707a8eba5952da37aa2f78a3c 100644 --- a/.regressionignore +++ b/.regressionignore @@ -4,10 +4,14 @@ # ignored variable : [Topic]<SPACE>[Variable] or *<SPACE>[Variable] for every variable whatever the topic # Example for ignoring OutputsModel variable produced by example("RunModel_GR2M"): RunModel_GR2M OutputsModel -* RunOptions +* RunOptions$Outputs_Sim +* RunOptions$FeatFUN_MOD +* RunOptions$FortranOutputs +RunModel_CemaNeige RunOptions$Outputs_Cal Param_Sets_GR4J RunOptions_Cal Param_Sets_GR4J RunOptions_Val -* OutputsModel +* OutputsModel$Param +* OutputsModel$WarmUpQsim Param_Sets_GR4J OutputsModel_Val RunModel_Lag OutputsModelDown SeriesAggreg SimulatedMonthlyRegime diff --git a/tests/testthat/regression.R b/tests/testthat/regression.R index 84924b3a0dd9ba0977aa87dcdb46aec6c9ce4566..147b73c500f537fa8ce0d7dba1c1983e1e9e5e05 100644 --- a/tests/testthat/regression.R +++ b/tests/testthat/regression.R @@ -13,6 +13,17 @@ CompareWithStable <- function(refVarFile, testDir, regIgnore) { if (file.exists(testVarFile)) { testVar <- readRDS(testVarFile) refVar <- readRDS(refVarFile) + if (!is.null(regIgnore)) { + regIgnore$mainVar <- gsub("\\$.*$", "", regIgnore[,2]) + varIgnore <- regIgnore[apply(regIgnore, 1, function(x) {v$var == x[3] && (x[1] == "*" || x[1] == v$topic)}), 2] + if (length(varIgnore) > 0) { + itemIgnore <- gsub("^.*\\$", "", varIgnore) + for(item in itemIgnore) { + testVar[[item]] <- NULL + refVar[[item]] <- NULL + } + } + } expect_equivalent(testVar, refVar) } })