Skip to content

Commit

Permalink
more updates to tests PecanProject#158
Browse files Browse the repository at this point in the history
  • Loading branch information
robkooper committed Jul 30, 2014
1 parent 1b26e05 commit 421af2a
Show file tree
Hide file tree
Showing 65 changed files with 178 additions and 128 deletions.
4 changes: 2 additions & 2 deletions all/tests/run.all.R → all/tests/testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# http://opensource.ncsa.illinois.edu/license.html
#-------------------------------------------------------------------------------
library(testthat)
library(PEcAn.all)
library(PEcAn.utils)

logger.setQuitOnSevere(FALSE)
test_package("PEcAn.all")
test_check("PEcAn.all")
File renamed without changes.
Binary file removed models/biocro/inst/extdata/result.RData
Binary file not shown.
13 changes: 0 additions & 13 deletions models/biocro/tests/run.all.R

This file was deleted.

13 changes: 13 additions & 0 deletions models/biocro/tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#-------------------------------------------------------------------------------
# Copyright (c) 2012 University of Illinois, NCSA.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the
# University of Illinois/NCSA Open Source License
# which accompanies this distribution, and is available at
# http://opensource.ncsa.illinois.edu/license.html
#-------------------------------------------------------------------------------
library(testthat)
library(PEcAn.utils)

logger.setQuitOnSevere(FALSE)
# test_check("PEcAn.BIOCRO")
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<password>bety</password>
<dbname>bety</dbname>
<host>localhost</host>
<dbfiles>$HOME/.pecan/dbfiles</dbfiles>
<dbfiles>/tmp/dbfiles</dbfiles>
</bety>
</database>
<meta.analysis>
Expand All @@ -33,7 +33,7 @@
<name>Sapelo Island</name>
<lat>31.40</lat>
<lon>-81.28</lon>
<met>$HOME/.pecan/dbfiles/met/31.397Nx81.28W/weather.csv</met>
<met>data/weather.csv</met>
</site>
<start.date>2004-01-01 06:00:00</start.date>
<end.date>2005-12-31 05:59:00</end.date>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@ context("check output from model2netcdf.BIOCRO")
outdir <- file.path(tempdir(), "biocro")
dir.create(outdir, showWarnings = FALSE, recursive = TRUE)

settings.file <- system.file("extdata/pecan.biocro.xml", package = "PEcAn.BIOCRO")
settings <- read.settings(settings.file)
file.copy(from = "data/result.RData", to = outdir)

result.file <- system.file("data/result.RData", package = "PEcAn.BIOCRO")

file.copy(from = result.file, to = outdir)
settings <- read.settings("data/pecan.biocro.xml")

start_date <- settings$run$start.date
model2netcdf.BIOCRO(outdir = outdir, sitelat=1, sitelon=2,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

extdir <- system.file("extdata", package = "PEcAn.BIOCRO")
settings.xml <- file.path(extdir, "pecan.biocro.xml")
settings <- read.settings(settings.xml)
settings$site$met <- file.path(extdir, "weather.csv")
settings.xml <- file.path(data, )
settings <- read.settings("data/pecan.biocro.xml")

samples <- list(
biocro.saof = (data.frame(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# http://opensource.ncsa.illinois.edu/license.html
#-------------------------------------------------------------------------------
library(testthat)
library(PEcAn.DB)
library(PEcAn.utils)

logger.setQuitOnSevere(FALSE)
#test_package("foo")
test_check("PEcAn.ED2")
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
context("check output from model2netcdf.BIOCRO")
context("check output from model2netcdf.ED2")


extdata.dir <- system.file("extdata", package = "PEcAn.ED2")
outdir <- file.path(tempdir(), "ed")
dir.create(outdir, showWarnings = FALSE, recursive = TRUE)
file.copy(dir(extdata.dir, pattern = "*.h5$", full.names = TRUE), outdir)
file.copy(dir("data", pattern = "*.h5$", full.names = TRUE), outdir)

model2netcdf.ED2(outdir, 40, -88.5, "2010-01-01", "2010-12-31")

Expand Down
13 changes: 13 additions & 0 deletions models/sipnet/tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#-------------------------------------------------------------------------------
# Copyright (c) 2012 University of Illinois, NCSA.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the
# University of Illinois/NCSA Open Source License
# which accompanies this distribution, and is available at
# http://opensource.ncsa.illinois.edu/license.html
#-------------------------------------------------------------------------------
library(testthat)
library(PEcAn.utils)

logger.setQuitOnSevere(FALSE)
test_check("PEcAn.SIPNET")
13 changes: 13 additions & 0 deletions models/template/tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#-------------------------------------------------------------------------------
# Copyright (c) 2012 University of Illinois, NCSA.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the
# University of Illinois/NCSA Open Source License
# which accompanies this distribution, and is available at
# http://opensource.ncsa.illinois.edu/license.html
#-------------------------------------------------------------------------------
library(testthat)
library(PEcAn.utils)

logger.setQuitOnSevere(FALSE)
test_check("PEcAn.SIPNET")
3 changes: 3 additions & 0 deletions models/template/tests/testthat/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Place your tests here. They will be executed in this folder, so you
can place any data you need in this folder as well (or in a subfolder
called data).
13 changes: 13 additions & 0 deletions modules/allometry/tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#-------------------------------------------------------------------------------
# Copyright (c) 2012 University of Illinois, NCSA.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the
# University of Illinois/NCSA Open Source License
# which accompanies this distribution, and is available at
# http://opensource.ncsa.illinois.edu/license.html
#-------------------------------------------------------------------------------
library(testthat)
library(PEcAn.utils)

logger.setQuitOnSevere(FALSE)
test_check("PEcAn.allometry")
12 changes: 0 additions & 12 deletions modules/benchmark/tests/run.all.R

This file was deleted.

13 changes: 13 additions & 0 deletions modules/benchmark/tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#-------------------------------------------------------------------------------
# Copyright (c) 2012 University of Illinois, NCSA.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the
# University of Illinois/NCSA Open Source License
# which accompanies this distribution, and is available at
# http://opensource.ncsa.illinois.edu/license.html
#-------------------------------------------------------------------------------
library(testthat)
library(PEcAn.utils)

logger.setQuitOnSevere(FALSE)
test_check("PEcAn.benchmark")
13 changes: 13 additions & 0 deletions modules/data.atmosphere/tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#-------------------------------------------------------------------------------
# Copyright (c) 2012 University of Illinois, NCSA.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the
# University of Illinois/NCSA Open Source License
# which accompanies this distribution, and is available at
# http://opensource.ncsa.illinois.edu/license.html
#-------------------------------------------------------------------------------
library(testthat)
library(PEcAn.utils)

logger.setQuitOnSevere(FALSE)
test_check("PEcAn.data.atmosphere")
2 changes: 1 addition & 1 deletion modules/data.hydrology/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Package: PEcAn.DB
Package: PEcAn.data.hydrology
Type: Package
Title: PEcAn functions used for ecological forecasts and reanalysis
Version: 1.3.3
Expand Down
13 changes: 13 additions & 0 deletions modules/data.hydrology/tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#-------------------------------------------------------------------------------
# Copyright (c) 2012 University of Illinois, NCSA.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the
# University of Illinois/NCSA Open Source License
# which accompanies this distribution, and is available at
# http://opensource.ncsa.illinois.edu/license.html
#-------------------------------------------------------------------------------
library(testthat)
library(PEcAn.utils)

logger.setQuitOnSevere(FALSE)
test_check("PEcAn.data.hydrology")
12 changes: 0 additions & 12 deletions modules/data.land/tests/run.all.R

This file was deleted.

13 changes: 13 additions & 0 deletions modules/data.land/tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#-------------------------------------------------------------------------------
# Copyright (c) 2012 University of Illinois, NCSA.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the
# University of Illinois/NCSA Open Source License
# which accompanies this distribution, and is available at
# http://opensource.ncsa.illinois.edu/license.html
#-------------------------------------------------------------------------------
library(testthat)
library(PEcAn.utils)

logger.setQuitOnSevere(FALSE)
test_check("PEcAn.data.land")
File renamed without changes.
11 changes: 0 additions & 11 deletions modules/data.mining/tests/run.all.R

This file was deleted.

13 changes: 13 additions & 0 deletions modules/data.mining/tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#-------------------------------------------------------------------------------
# Copyright (c) 2012 University of Illinois, NCSA.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the
# University of Illinois/NCSA Open Source License
# which accompanies this distribution, and is available at
# http://opensource.ncsa.illinois.edu/license.html
#-------------------------------------------------------------------------------
library(testthat)
library(PEcAn.utils)

logger.setQuitOnSevere(FALSE)
test_check("PEcAn.data.mining")
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# http://opensource.ncsa.illinois.edu/license.html
#-------------------------------------------------------------------------------
library(testthat)
library(PEcAn.MA)
library(PEcAn.utils)

logger.setQuitOnSevere(FALSE)
test_package("PEcAn.MA")
test_check("PEcAn.MA")
13 changes: 0 additions & 13 deletions modules/priors/tests/run.all.R

This file was deleted.

13 changes: 13 additions & 0 deletions modules/priors/tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#-------------------------------------------------------------------------------
# Copyright (c) 2012 University of Illinois, NCSA.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the
# University of Illinois/NCSA Open Source License
# which accompanies this distribution, and is available at
# http://opensource.ncsa.illinois.edu/license.html
#-------------------------------------------------------------------------------
library(testthat)
library(PEcAn.utils)

logger.setQuitOnSevere(FALSE)
test_check("PEcAn.priors")
File renamed without changes.
13 changes: 0 additions & 13 deletions modules/rtm/tests/run.all.R

This file was deleted.

4 changes: 2 additions & 2 deletions models/ed/tests/run.all.R → modules/rtm/tests/testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# http://opensource.ncsa.illinois.edu/license.html
#-------------------------------------------------------------------------------
library(testthat)
library(PEcAn.ED2)
library(PEcAn.utils)

logger.setQuitOnSevere(FALSE)
test_package("PEcAn.ED2")
test_check("PEcAn.rtm")
13 changes: 0 additions & 13 deletions modules/uncertainty/tests/run.all.R

This file was deleted.

13 changes: 13 additions & 0 deletions modules/uncertainty/tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#-------------------------------------------------------------------------------
# Copyright (c) 2012 University of Illinois, NCSA.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the
# University of Illinois/NCSA Open Source License
# which accompanies this distribution, and is available at
# http://opensource.ncsa.illinois.edu/license.html
#-------------------------------------------------------------------------------
library(testthat)
library(PEcAn.utils)

logger.setQuitOnSevere(FALSE)
test_check("PEcAn.uncertainty")
15 changes: 0 additions & 15 deletions qaqc/tests/run.all.R

This file was deleted.

13 changes: 13 additions & 0 deletions qaqc/tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#-------------------------------------------------------------------------------
# Copyright (c) 2012 University of Illinois, NCSA.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the
# University of Illinois/NCSA Open Source License
# which accompanies this distribution, and is available at
# http://opensource.ncsa.illinois.edu/license.html
#-------------------------------------------------------------------------------
library(testthat)
library(PEcAn.utils)

logger.setQuitOnSevere(FALSE)
#test_check("PEcAn.qaqc")
File renamed without changes.
3 changes: 2 additions & 1 deletion settings/tests/testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
# which accompanies this distribution, and is available at
# http://opensource.ncsa.illinois.edu/license.html
#-------------------------------------------------------------------------------

library(testthat)
library(PEcAn.utils)

logger.setQuitOnSevere(FALSE)
test_check("PEcAn.settings")
Loading

0 comments on commit 421af2a

Please sign in to comment.