Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tests/testthat/perf_tests/perf_rate.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ perf.reference.save <- function(perf.ref.name, rate, tolerance.lower, tolerance.
.perf.reference <<- .perf.reference
}

# Obtain performance test duration from PERF_DURATION_SEC environment variable, otherwise default.duration argument, otherwise "30".
perf.testduration <- function(default.duration = 30) {
base::as.integer(base::Sys.getenv("PERF_DURATION_SEC", unset = base::as.character(default.duration)))
}

perf.reference.rate <- function(perf.ref.name) {
if (is.null(.perf.reference))
.load.pref()
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-perf-meanDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test_that("numeric meanDS - performance", {

input <- c(0.0, 1.0, 2.0, 3.0, 4.0)

.durationSec <- 30 # seconds
.durationSec <- perf.testduration(30)
.count <- 0
.start.time <- Sys.time()
.current.time <- .start.time
Expand Down Expand Up @@ -65,7 +65,7 @@ test_that("numeric meanDS, with NA - performance", {

input <- c(0.0, NA, 2.0, NA, 4.0)

.durationSec <- 30 # seconds
.durationSec <- perf.testduration(30)
.count <- 0
.start.time <- Sys.time()
.current.time <- .start.time
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-perf-varDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test_that("numeric varDS - performance", {

input <- c(0.0, 1.0, 2.0, 3.0, 4.0)

.durationSec <- 30 # seconds
.durationSec <- perf.testduration(30)
.count <- 0
.start.time <- Sys.time()
.current.time <- .start.time
Expand Down Expand Up @@ -65,7 +65,7 @@ test_that("numeric varDS, with NA - performance", {

input <- c(0.0, NA, 2.0, NA, 4.0)

.durationSec <- 30 # seconds
.durationSec <- perf.testduration(30)
.count <- 0
.start.time <- Sys.time()
.current.time <- .start.time
Expand Down
Loading