Skip to content

Commit

Permalink
use setup.R in testsuite
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenpawley committed Feb 6, 2025
1 parent 588639b commit 31b0026
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 42 deletions.
2 changes: 2 additions & 0 deletions tests/testthat/setup.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
testdata <- download_nc_basic()
gisBase <- get_gisbase()
7 changes: 0 additions & 7 deletions tests/testthat/test-execGRASS.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
library(testthat)
library(terra)
source("helper.R")

# setup
testdata <- download_nc_basic()
withr::defer(fs::dir_delete(testdata$gisDbase))

gisBase <- get_gisbase()

test_that("testing basic doGRASS, execGRASS, stringexecGRASS", {
skip_if_not(!is.null(gisBase), "GRASS GIS not found on PATH")
Expand Down
7 changes: 0 additions & 7 deletions tests/testthat/test-gmeta.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
library(testthat)
library(terra)
source("helper.R")

# setup
testdata <- download_nc_basic()
withr::defer(fs::dir_delete(testdata$gisDbase))

gisBase <- get_gisbase()

testthat::test_that("testing gmeta", {
skip_if_not(!is.null(gisBase), "GRASS GIS not found on PATH")
Expand Down
7 changes: 0 additions & 7 deletions tests/testthat/test-initGRASS.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
library(testthat)
library(terra)
source("helper.R")

# setup
testdata <- download_nc_basic()
withr::defer(fs::dir_delete(testdata$gisDbase))

gisBase <- get_gisbase()

test_that("testing basic initGRASS", {
skip_if_not(!is.null(gisBase), "GRASS GIS not found on PATH")
Expand Down
7 changes: 0 additions & 7 deletions tests/testthat/test-options.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
library(testthat)
library(terra)
source("helper.R")

# setup
testdata <- download_nc_basic()
withr::defer(fs::dir_delete(testdata$gisDbase))

gisBase <- get_gisbase()

test_that("testing ignore.stderrOption", {
skip_if_not(!is.null(gisBase), "GRASS GIS not found on PATH")
Expand Down
7 changes: 0 additions & 7 deletions tests/testthat/test-read_RAST.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
library(testthat)
library(terra)
library(sp)
source("helper.R")

# setup (share grass session across tests)
testdata <- download_nc_basic()
withr::defer(fs::dir_delete(testdata$gisDbase))

gisBase <- get_gisbase()

if (!is.null(gisBase)) {
loc <- initGRASS(
Expand Down
7 changes: 0 additions & 7 deletions tests/testthat/test-read_VECT.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
library(testthat)
library(terra)
source("helper.R")

# setup (share grass session across tests)
testdata <- download_nc_basic()
withr::defer(fs::dir_delete(testdata$gisDbase))

gisBase <- get_gisbase()

# test basic read_VECT operation
test_that("testing read_VECT", {
Expand Down

0 comments on commit 31b0026

Please sign in to comment.