Function to generally execute a Test Case collection

RTest.execute(testcase.directory = list.dirs(find.package("RTest"),
  recursive = T) %>% grep(pattern = "xml-templates", value = T),
  f.pattern = "*.xml", project.name = "RTest Execution",
  project.details = "Example test exectuion",
  project.tester = "Example tester", report.file = tempfile(fileext =
  ".html"), ...)

Arguments

testcase.directory

(character) Location of the Test Case XML files

f.pattern

(character) An additional pattern to just search for specific files with certain names

project.name

(character) Name of the project mentioned in all cover pages

project.details

(character) Description of the project

project.tester

(character) Name of the Test executer

report.file

(character) Output file where to store the report

...

Additional arguments handed over to the exec,RTestCollection-method method

Value

No return value, but the command line output will show where to fund the report. Using the additional argument open=TRUE will open the report directly after execution

Examples

directory_with_tests <- list.dirs(find.package('RTest'),recursive=TRUE) %>% grep(pattern="xml-templates",value=TRUE) RTest::RTest.execute( testcase.directory = directory_with_tests[1], open=FALSE, f.pattern = "RTest_TC-generic.xml" )
#> 1 files found in input directory: #> [1] "RTest_TC-generic.xml" #> #> Import TC file '/tmp/RtmpSMomZh/temp_libpath6c0625f3fa09/RTest/xml-templates/RTest_TC-generic.xml' #> #> Create new TC using adapter definition 'RTestCase'.Test Case #> Object of class ' RTestCase ' #> @ID : RTest_TC-generic #> @tc.type : RTestCase #> @synopsis : #> $version : 01 #> $author : Sebastian Wolf #> $short-description : RTest Template TC for generic test-adapter #> $description : A test case without a test adapter #> $label : #> $creation-date : 2018-12-11 #> $change-history : #> 2018-12-11 , Sebastian Wolf : #> Initial Version #> #> @xml.fPath : /tmp/RtmpSMomZh/temp_libpath6c0625f3fa09/RTest/xml-templates/RTest_TC-generic.xml #> @xml.root : XMLNode #> #> @input.data : #> test01 : 'data.frame': 2 obs. of 2 variables: #> $ x: num 1 1 #> $ y: num 2 2 #> #> @test.for : NA #> @test.result : NA #> #> @tests : #> RTest : List of 5 #> $ :List of 1 #> ..$ example_data_frame:List of 1 #> .. ..$ :List of 16 #> .. .. ..$ pkg : chr "RTest" #> .. .. ..$ pgk-iter : num 1 #> .. .. ..$ func : chr "example_data_frame" #> .. .. ..$ func-iter : num 1 #> .. .. ..$ test-code : chr "RTest::example_data_frame" #> .. .. ..$ test-adapter: chr "RTestCase" #> .. .. ..$ test-func : chr "test.RTest.example_data_frame" #> .. .. ..$ pkg-desc : chr "" #> .. .. ..$ func-desc : chr "Test data.frame" #> .. .. ..$ xpath : chr "//RTestCase/tests/RTest[1]/example_data_frame[1]" #> .. .. ..$ reporter : logi NA #> .. .. ..$ result : logi NA #> .. .. ..$ cache : logi NA #> .. .. ..$ execresid : logi NA #> .. .. ..$ specid : chr "01" #> .. .. ..$ riskid : chr "01" #> $ :List of 1 #> ..$ example_image:List of 1 #> .. ..$ :List of 16 #> .. .. ..$ pkg : chr "RTest" #> .. .. ..$ pgk-iter : num 2 #> .. .. ..$ func : chr "example_image" #> .. .. ..$ func-iter : num 1 #> .. .. ..$ test-code : chr "RTest::example_image" #> .. .. ..$ test-adapter: chr "RTestCase" #> .. .. ..$ test-func : chr "test.RTest.example_image" #> .. .. ..$ pkg-desc : chr "" #> .. .. ..$ func-desc : chr "Compare an image" #> .. .. ..$ xpath : chr "//RTestCase/tests/RTest[2]/example_image[1]" #> .. .. ..$ reporter : logi NA #> .. .. ..$ result : logi NA #> .. .. ..$ cache : logi NA #> .. .. ..$ execresid : logi NA #> .. .. ..$ specid : chr "02" #> .. .. ..$ riskid : chr "01" #> $ :List of 1 #> ..$ example_list:List of 1 #> .. ..$ :List of 16 #> .. .. ..$ pkg : chr "RTest" #> .. .. ..$ pgk-iter : num 3 #> .. .. ..$ func : chr "example_list" #> .. .. ..$ func-iter : num 1 #> .. .. ..$ test-code : chr "RTest::example_list" #> .. .. ..$ test-adapter: chr "RTestCase" #> .. .. ..$ test-func : chr "test.RTest.example_list" #> .. .. ..$ pkg-desc : chr "" #> .. .. ..$ func-desc : chr "" #> .. .. ..$ xpath : chr "//RTestCase/tests/RTest[3]/example_list[1]" #> .. .. ..$ reporter : logi NA #> .. .. ..$ result : logi NA #> .. .. ..$ cache : logi NA #> .. .. ..$ execresid : logi NA #> .. .. ..$ specid : chr "03" #> .. .. ..$ riskid : chr "01" #> $ :List of 1 #> ..$ example_vector:List of 1 #> .. ..$ :List of 16 #> .. .. ..$ pkg : chr "RTest" #> .. .. ..$ pgk-iter : num 4 #> .. .. ..$ func : chr "example_vector" #> .. .. ..$ func-iter : num 1 #> .. .. ..$ test-code : chr "RTest::example_vector" #> .. .. ..$ test-adapter: chr "RTestCase" #> .. .. ..$ test-func : chr "test.RTest.example_vector" #> .. .. ..$ pkg-desc : chr "" #> .. .. ..$ func-desc : chr "Test vector example" #> .. .. ..$ xpath : chr "//RTestCase/tests/RTest[4]/example_vector[1]" #> .. .. ..$ reporter : logi NA #> .. .. ..$ result : logi NA #> .. .. ..$ cache : logi NA #> .. .. ..$ execresid : logi NA #> .. .. ..$ specid : chr "04" #> .. .. ..$ riskid : chr "01" #> $ :List of 1 #> ..$ example_variable:List of 1 #> .. ..$ :List of 16 #> .. .. ..$ pkg : chr "RTest" #> .. .. ..$ pgk-iter : num 5 #> .. .. ..$ func : chr "example_variable" #> .. .. ..$ func-iter : num 1 #> .. .. ..$ test-code : chr "RTest::example_variable" #> .. .. ..$ test-adapter: chr "RTestCase" #> .. .. ..$ test-func : chr "test.RTest.example_variable" #> .. .. ..$ pkg-desc : chr "" #> .. .. ..$ func-desc : chr "Test relative difference" #> .. .. ..$ xpath : chr "//RTestCase/tests/RTest[5]/example_variable[1]" #> .. .. ..$ reporter : logi NA #> .. .. ..$ result : logi NA #> .. .. ..$ cache : logi NA #> .. .. ..$ execresid : logi NA #> .. .. ..$ specid : chr "05" #> .. .. ..$ riskid : chr "01" #> #> #> Execute following test cases: #> [1] "RTest_TC-generic" #> #> ##### TEST CASE 'RTest_TC-generic' #> #> Test for: 'RTest', 'RTest', 'RTest', 'RTest', 'RTest' #> #> Run test(s) for 'RTest' #> Test 'RTest::example_data_frame' ...
#> Using generic test interpreter function
#> Warning: the condition has length > 1 and only the first element will be used
#> data.frame: 2 x 3 ...
#> Warning: Calling 'structure(NULL, *)' is deprecated, as NULL cannot have attributes. #> Consider 'structure(list(), *)' instead.
#> success #> Test 'RTest::example_image' ...
#> Using generic test interpreter function
#> Warning: Calling 'structure(NULL, *)' is deprecated, as NULL cannot have attributes. #> Consider 'structure(list(), *)' instead.
#> success #> Test 'RTest::example_list' ...
#> Using generic test interpreter function
#> Warning: Calling 'structure(NULL, *)' is deprecated, as NULL cannot have attributes. #> Consider 'structure(list(), *)' instead.
#> Warning: Calling 'structure(NULL, *)' is deprecated, as NULL cannot have attributes. #> Consider 'structure(list(), *)' instead.
#> data.frame: 2 x 2 ... success #> Test 'RTest::example_vector' ...
#> Using generic test interpreter function
#> success #> Test 'RTest::example_variable' ...
#> Using generic test interpreter function
#> Warning: Calling 'structure(NULL, *)' is deprecated, as NULL cannot have attributes. #> Consider 'structure(list(), *)' instead.
#> success #> #> Write HTML summary for following test cases: #> [1] "RTest_TC-generic" #> #> Write details for 'RTest::example_data_frame' #> Execute function silently. (example_data_frame) #> 0% #> Checking output class and reference class. Check return value (variable). #> 0% #> Check return value (data.frame). #> 0% #> Write details for 'RTest::example_image' #> Execute function silently. (example_image) #> 0% #> Check return image. #> 0% #> Write details for 'RTest::example_list' #> Execute function silently. (example_list) #> 0% #> Checking output class and reference class. Check return value (variable). #> 0% #> Check return value (list). #> 0% #> -- List entry 'myname' (variable): Check return value (variable). #> 0% #> -- List entry 'NAME2' (variable): Check return value (variable). #> 0% #> -- List entry 'data.frame' (data.frame): Check return value (data.frame). #> 0% #> Write details for 'RTest::example_vector' #> Execute function silently. (example_vector) #> 0% #> Checking output class and reference class. Check return value (variable). #> 0% #> Check return value (variable). #> 0% #> Write details for 'RTest::example_variable' #> Execute function silently. (example_variable) #> 0% #> Checking output class and reference class. Check return value (variable). #> 0% #> Check return value (variable). #> 0% #> #> HTML summary written to file '/tmp/Rtmpq5S1Sv/file6c3d5571d87c.html'. #>