Skip to content

Commit 1e6bf21

Browse files
authored
Merge pull request #1033 from RcppCore/feature/better_test_messages
Feature/better test messages
2 parents 74f6ef4 + b1ea5d4 commit 1e6bf21

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+103
-222
lines changed

ChangeLog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
2019-12-08 Dirk Eddelbuettel <[email protected]>
22

3+
* tests/tinytest.R: Turn verbose tests on in dev and on Travis
4+
35
* inst/tinytest/test_client_package.R: Finer-grained skip messages
6+
* inst/tinytest/test_module_client_package.R: Idem
7+
* inst/tinytest/test_expose_class.R: Idem
8+
* inst/tinytest/test_interface.R: Idem
9+
* inst/tinytest/test_rcpp_package_skeleton.R: Idem
10+
* inst/tinytest/test_reference.R: Idem
11+
12+
* inst/tinytest/test_*.R: Streamlined initial test and sourceCpp call
413

514
* src/attributes.cpp: Remove dangling '#nocov end'
615

inst/tinytest/test_algorithm.R

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@
1616
## You should have received a copy of the GNU General Public License
1717
## along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
1818

19-
.runThisTest <- Sys.getenv("RunAllRcppTests") == "yes"
19+
if (Sys.getenv("RunAllRcppTests") != "yes") exit_file("Set 'RunAllRcppTests' to 'yes' to run.")
2020

21-
if (!.runThisTest) exit_file("Skipping 'test_algorithm.R'")
22-
23-
library(Rcpp)
24-
sourceCpp("cpp/algorithm.cpp")
21+
Rcpp::sourceCpp("cpp/algorithm.cpp")
2522

2623
# test.sum <- function() {
2724
v <- c(1.0, 2.0, 3.0, 4.0, 5.0)

inst/tinytest/test_as.R

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@
1616
## You should have received a copy of the GNU General Public License
1717
## along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
1818

19-
.runThisTest <- Sys.getenv("RunAllRcppTests") == "yes"
19+
if (Sys.getenv("RunAllRcppTests") != "yes") exit_file("Set 'RunAllRcppTests' to 'yes' to run.")
2020

21-
if (!.runThisTest) exit_file("Skipping 'test_as.R'")
22-
23-
library(Rcpp)
24-
sourceCpp("cpp/as.cpp")
21+
Rcpp::sourceCpp("cpp/as.cpp")
2522

2623
# test.as.int <- function(){
2724
expect_equal( as_int(10), 10L, info = "as<int>( REALSXP ) " )

inst/tinytest/test_attributes.R

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@
1616
## You should have received a copy of the GNU General Public License
1717
## along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
1818

19-
.runThisTest <- Sys.getenv("RunAllRcppTests") == "yes"
19+
if (Sys.getenv("RunAllRcppTests") != "yes") exit_file("Set 'RunAllRcppTests' to 'yes' to run.")
2020

21-
if (!.runThisTest) exit_file("Skipping 'test_attributes.R'")
22-
23-
library(Rcpp)
24-
sourceCpp("cpp/attributes.cpp")
21+
Rcpp::sourceCpp("cpp/attributes.cpp")
2522

2623
#test.attributes <- function() {
2724
expect_equal(comments_test(),

inst/tinytest/test_client_package.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
.runThisTest <- Sys.getenv("RunAllRcppTests") == "yes" && Sys.getenv("RunVerboseRcppTests") == "yes"
2323

2424
if (! .runThisTest) exit_file("Set 'RunVerboseRcppTests' and 'RunAllRcppTests' to 'yes' to run.")
25-
if (.onWindow) exit_file("Skipping on Windows.'")
25+
if (.onWindows) exit_file("Skipping on Windows.'")
2626

2727
#.client.package <- function(pkg = "testRcppPackage") {
2828
td <- tempfile()

inst/tinytest/test_dataframe.R

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@
1616
## You should have received a copy of the GNU General Public License
1717
## along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
1818

19-
.runThisTest <- Sys.getenv("RunAllRcppTests") == "yes"
19+
if (Sys.getenv("RunAllRcppTests") != "yes") exit_file("Set 'RunAllRcppTests' to 'yes' to run.")
2020

21-
if (!.runThisTest) exit_file("Skipping 'test_dataframe.R'")
22-
23-
library(Rcpp)
24-
sourceCpp("cpp/DataFrame.cpp")
21+
Rcpp::sourceCpp("cpp/DataFrame.cpp")
2522

2623
#test.DataFrame.FromSEXP <- function() {
2724
DF <- data.frame(a=1:3, b=c("a","b","c"))

inst/tinytest/test_date.R

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@
1616
## You should have received a copy of the GNU General Public License
1717
## along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
1818

19-
.runThisTest <- Sys.getenv("RunAllRcppTests") == "yes"
19+
if (Sys.getenv("RunAllRcppTests") != "yes") exit_file("Set 'RunAllRcppTests' to 'yes' to run.")
2020

21-
if (!.runThisTest) exit_file("Skipping 'test_date.R'")
22-
23-
library(Rcpp)
24-
sourceCpp("cpp/dates.cpp")
21+
Rcpp::sourceCpp("cpp/dates.cpp")
2522

2623
# test.Date.ctor.sexp <- function() {
2724
fun <- ctor_sexp

inst/tinytest/test_dispatch.R

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,9 @@
1818
# You should have received a copy of the GNU General Public License
1919
# along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
2020

21-
.runThisTest <- Sys.getenv("RunAllRcppTests") == "yes"
21+
if (Sys.getenv("RunAllRcppTests") != "yes") exit_file("Set 'RunAllRcppTests' to 'yes' to run.")
2222

23-
if (!.runThisTest) exit_file("Skipping 'test_dispatch.R'")
24-
25-
library(Rcpp)
26-
sourceCpp("cpp/dispatch.cpp")
23+
Rcpp::sourceCpp("cpp/dispatch.cpp")
2724

2825
# test.RawVector <- function() {
2926
x <- as.raw(0:9)

inst/tinytest/test_embedded_r.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
## You should have received a copy of the GNU General Public License
1717
## along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
1818

19-
.runThisTest <- Sys.getenv("RunAllRcppTests") == "yes"
20-
21-
if (!.runThisTest) exit_file("Skipping, set 'RunAllRcppTests=yes' to run.")
19+
if (Sys.getenv("RunAllRcppTests") != "yes") exit_file("Set 'RunAllRcppTests' to 'yes' to run.")
2220

2321
library(Rcpp)
2422

inst/tinytest/test_environments.R

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@
1616
## You should have received a copy of the GNU General Public License
1717
## along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
1818

19-
.runThisTest <- Sys.getenv("RunAllRcppTests") == "yes"
19+
if (Sys.getenv("RunAllRcppTests") != "yes") exit_file("Set 'RunAllRcppTests' to 'yes' to run.")
2020

21-
if (!.runThisTest) exit_file("Skipping 'test_environment.R'")
22-
23-
library(Rcpp)
24-
sourceCpp("cpp/Environment.cpp")
21+
Rcpp::sourceCpp("cpp/Environment.cpp")
2522

2623
# test.environment.ls <- function(){
2724
e <- new.env( )

0 commit comments

Comments
 (0)