aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2017-05-24 15:46:44 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2017-05-24 15:46:44 +0200
commit4835e20d1d08203657ab616600286ad9dfd71344 (patch)
tree394e81771eaee8665358f00c9404465dcfc061e6 /tests
parent539ea37b45ddc41b36dd199f06ffe5936ab13f21 (diff)
Re-enable PELMO examples and tests
- Add .gitattributes to make sure CRLF line endings are kept for PELMO .psm files - Update static docs
Diffstat (limited to 'tests')
-rw-r--r--tests/testthat/test_PELMO.R26
1 files changed, 20 insertions, 6 deletions
diff --git a/tests/testthat/test_PELMO.R b/tests/testthat/test_PELMO.R
index e6d3a0f..be0b410 100644
--- a/tests/testthat/test_PELMO.R
+++ b/tests/testthat/test_PELMO.R
@@ -19,8 +19,13 @@ runs <- list(
psm = "Pesticide_D_1_May_every_other_year_mets",
win = names(FOCUS_GW_scenarios_2012$names)))
+# Check if we have wine on the path
+wine_installed <- system('wine --version', ignore.stdout = TRUE) == 0
+
test_that("PELMO paths are correctly created", {
- skip("A wine installation is needed for this test")
+ if (!wine_installed) {
+ skip("A wine installation is needed for this test")
+ }
psm_paths = c(
PELMO_path(runs[[1]]$psm, "fbe", "Por"),
PELMO_path(runs[[2]]$psm, "pot", "Ham"),
@@ -35,7 +40,9 @@ test_that("PELMO paths are correctly created", {
})
test_that("PELMO runs are correctly set up", {
- skip("A wine installation is needed for this test")
+ if (!wine_installed) {
+ skip("A wine installation is needed for this test")
+ }
# Prepare runs in analogy to the test archive
PELMO_runs(runs, psm_dir = PELMO_base, execute = FALSE, evaluate = FALSE, overwrite = TRUE)
@@ -59,7 +66,10 @@ test_that("PELMO runs are correctly set up", {
})
test_that("PELMO runs can be run and give the expected result files", {
- skip("A wine installation is needed for this test")
+ if (!wine_installed) {
+ skip("A wine installation is needed for this test")
+ }
+
run_PELMO(runs, cores = 7)
plm_files <- c("CHEM.PLM", "ECHO.PLM",
@@ -88,10 +98,12 @@ test_that("PELMO runs can be run and give the expected result files", {
}
})
-# pfm_PECgw <- evaluate_PELMO(runs)
+pfm_PECgw <- evaluate_PELMO(runs)
test_that("PELMO runs are correctly evaluated", {
- skip("A wine installation is needed for this test")
+ if (!wine_installed) {
+ skip("A wine installation is needed for this test")
+ }
# Check that if output is the same as in the test archive
for (run in runs) {
@@ -149,7 +161,9 @@ test_that("PELMO runs are correctly evaluated", {
})
test_that("PECgw from FOCUS summary files can be reproduced", {
- skip("A wine installation is needed for this test")
+ if (!wine_installed) {
+ skip("A wine installation is needed for this test")
+ }
focus_summary <- list()
for (run in runs) {

Contact - Imprint