ddtRun: Run tests under given location

Description Usage Arguments See Also Examples

View source: R/ddtRun.R

Description

Run tests under given location

Usage

1
2
ddtRun(ddtsDir, preload, compare, expectedFileName = "actual.csv",
  readSaveObj = NULL)

Arguments

ddtsDir

(characters) path where tests inputs and outputs should be stored

preload

(function) loading function

compare

(function) compared of actual and expected objects

expectedFileName

(character) generated file

readSaveObj

(list of functions )

See Also

ddtRunSingle getReadSaveObj

Other ddtRun: ddtRunSingle

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
ddtsDir <- './tests/example_in_doc/testCase_1'  #location where single DDT is
x <- 1:20
y <- x*2 + rnorm(20)
preload <- function(){ return(lm(y~x)) }
compare <- function(expected, actual){
 if(all(abs(expected$coefficients - actual$coefficients) < 0.001) ){
   print("Same")
 } else {
   stop("wrong coefficents. Expected ", expected$coefficients , " but is ",  actual$coefficients)
 }}
# ddtRun(ddtsDir, preload, compare) # run all test

bnbsystems/ddt documentation built on May 24, 2019, 3:04 a.m.