File tree Expand file tree Collapse file tree 8 files changed +15
-33
lines changed
Expand file tree Collapse file tree 8 files changed +15
-33
lines changed Original file line number Diff line number Diff line change 99 * inst/tinytest/test_rcpp_package_skeleton.R: Idem
1010 * inst/tinytest/test_reference.R: Idem
1111
12+ * inst/tinytest/test_*.R: Streamlined initial test and sourceCpp call
13+
1214 * src/attributes.cpp: Remove dangling '#nocov end'
1315
14162019-12-07 Dirk Eddelbuettel <edd@debian.org>
Original file line number Diff line number Diff line change 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() {
2724fun <- ctor_sexp
Original file line number Diff line number Diff line change 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() {
2926x <- as.raw(0 : 9 )
Original file line number Diff line number Diff line change 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
2321library(Rcpp )
2422
Original file line number Diff line number Diff line change 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(){
2724e <- new.env( )
Original file line number Diff line number Diff line change 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_exceptions.R'" )
22-
23- library(Rcpp )
24- sourceCpp(" cpp/exceptions.cpp" )
21+ Rcpp :: sourceCpp(" cpp/exceptions.cpp" )
2522
2623# test.stdException <- function() {
2724# # Code works normally without an exception
Original file line number Diff line number Diff line change 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_exceptions_nocall.R'" )
22-
23- library(Rcpp )
24- sourceCpp(" cpp/Exceptions_nocall.cpp" )
21+ Rcpp :: sourceCpp(" cpp/Exceptions_nocall.cpp" )
2522
2623# test.Rcpp_exception <- function() {
2724tryCatch(Rcpp_exception(), error = function (e ){
Original file line number Diff line number Diff line change 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_function.R'" )
22-
23- library(Rcpp )
24- sourceCpp(" cpp/Function.cpp" )
21+ Rcpp :: sourceCpp(" cpp/Function.cpp" )
2522
2623# test.Function <- function(){
2724expect_equal( function_( rnorm ), rnorm , info = " Function( CLOSXP )" )
You can’t perform that action at this time.
0 commit comments