Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
HYCAR-Hydro
airGR
Commits
4e33703e
Commit
4e33703e
authored
Jun 22, 2021
by
Dorchies David
Browse files
test(regression): add feature ignore specific items in compared variables
parent
c00db7b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
.regressionignore
View file @
4e33703e
...
...
@@ -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
tests/testthat/regression.R
View file @
4e33703e
...
...
@@ -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
)
}
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment