File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
inst/include/Rcpp/internal Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 1515# You should have received a copy of the GNU General Public License
1616# along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
1717
18- test <- function ( output = if ( file.exists( " /tmp" ) ) " /tmp" else getwd() ){
19- if ( ! file.exists( output ) ){ stop( " output directory does not exist" ) }
18+ run_unit_tests <- function ( output = if ( file.exists( " /tmp" ) ) " /tmp" else getwd(), package = " Rcpp" ){
19+ if ( ! file.exists( output ) ){
20+ stop( " output directory does not exist" )
21+ }
2022
2123 Rscript <- file.path( R.home( component = " bin" ), " Rscript" )
2224 if ( .Platform $ OS.type == " windows" ){
2325 Rscript <- sprintf( " %s.exe" , Rscript )
2426 }
25- test.script <- system.file( " unitTests" , " runTests.R" , package = " Rcpp " )
27+ test.script <- system.file( " unitTests" , " runTests.R" , package = package )
2628 cmd <- sprintf( ' "%s" "%s" --output=%s' , Rscript , test.script , output )
2729 system( cmd )
2830}
2931
32+ test <- function ( output = if ( file.exists( " /tmp" ) ) " /tmp" else getwd() ){
33+ message( " test is deprecated, use `run_unit_test` instead" )
34+ run_unit_tests( output , " Rcpp" )
35+ }
36+
3037unit_test_setup <- function (file , packages = NULL ) {
3138 function (){
3239 if ( ! is.null(packages ) ){
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ namespace Rcpp{
7878
7979 T get () {
8080 Shield<SEXP> dims ( ::Rf_getAttrib ( object, R_DimSymbol ) ) ;
81- if ( dims == R_NilValue || ::Rf_length (dims) != 2 ){
81+ if ( Rf_isNull ( dims) || ::Rf_length (dims) != 2 ){
8282 throw ::Rcpp::not_a_matrix () ;
8383 }
8484 int * dims_ = INTEGER (dims) ;
You can’t perform that action at this time.
0 commit comments