Skip to content

Commit 0886391

Browse files
not testing within vignette when on travis
1 parent a37de68 commit 0886391

File tree

1 file changed

+27
-22
lines changed

1 file changed

+27
-22
lines changed

vignettes/Rcpp-unitTests.Rnw

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,28 +30,33 @@ library(RUnit)
3030
<<unitTesting,echo=FALSE,print=FALSE>>=
3131
pkg <- "Rcpp"
3232
33-
## Check the environemnt variable to see if all tests should be run
34-
if (Sys.getenv("RunAllRcppTests") != "yes") {
35-
writeLines("The environment variable 'RunAllRcppTests' was not set to 'yes', so skipping some tests.")
36-
}
37-
38-
if (file.exists("unitTests-results")) unlink("unitTests-results", recursive = TRUE)
39-
dir.create("unitTests-results")
40-
pathRcppTests <<- system.file("unitTests", package = pkg)
41-
path <- system.file("unitTests", package=pkg)
42-
testSuite <- defineTestSuite(name=paste(pkg, "unit testing"), dirs=path)
43-
tests <- runTestSuite(testSuite)
44-
err <- getErrors(tests)
45-
if (err$nFail > 0) stop(sprintf("unit test problems: %d failures", err$nFail))
46-
if (err$nErr > 0) stop( sprintf("unit test problems: %d errors", err$nErr))
47-
printHTMLProtocol(tests, fileName=sprintf("unitTests-results/%s-unitTests.html", pkg))
48-
printTextProtocol(tests, fileName=sprintf("unitTests-results/%s-unitTests.txt" , pkg))
49-
50-
if (file.exists("/tmp")) {
51-
invisible(sapply(c("txt", "html"), function(ext) {
52-
fname <- sprintf("unitTests-results/%s-unitTests.%s", pkg, ext)
53-
file.copy(fname, "/tmp", overwrite=TRUE)
54-
}))
33+
if( Sys.getenv( "TRAVIS" ) == "true" ){
34+
writeLines( "not running any tests as part of checking the vignette when doing continuous integration with travis" )
35+
} else {
36+
37+
## Check the environemnt variable to see if all tests should be run
38+
if (Sys.getenv("RunAllRcppTests") != "yes") {
39+
writeLines("The environment variable 'RunAllRcppTests' was not set to 'yes', so skipping some tests.")
40+
}
41+
42+
if (file.exists("unitTests-results")) unlink("unitTests-results", recursive = TRUE)
43+
dir.create("unitTests-results")
44+
pathRcppTests <<- system.file("unitTests", package = pkg)
45+
path <- system.file("unitTests", package=pkg)
46+
testSuite <- defineTestSuite(name=paste(pkg, "unit testing"), dirs=path)
47+
tests <- runTestSuite(testSuite)
48+
err <- getErrors(tests)
49+
if (err$nFail > 0) stop(sprintf("unit test problems: %d failures", err$nFail))
50+
if (err$nErr > 0) stop( sprintf("unit test problems: %d errors", err$nErr))
51+
printHTMLProtocol(tests, fileName=sprintf("unitTests-results/%s-unitTests.html", pkg))
52+
printTextProtocol(tests, fileName=sprintf("unitTests-results/%s-unitTests.txt" , pkg))
53+
54+
if (file.exists("/tmp")) {
55+
invisible(sapply(c("txt", "html"), function(ext) {
56+
fname <- sprintf("unitTests-results/%s-unitTests.%s", pkg, ext)
57+
file.copy(fname, "/tmp", overwrite=TRUE)
58+
}))
59+
}
5560
}
5661
@
5762

0 commit comments

Comments
 (0)