@@ -734,7 +734,7 @@ add_dummies <- function(dir, Log)
734734
735735 # # Run the demos if requested (traditionally part of tests, as in base)
736736 if (dir.exists(file.path(pkgdir , " demo" )))
737- run_tests(" demo" )
737+ run_tests(" demo" , do_demo )
738738
739739 # # Run the package-specific tests.
740740 tests_dir <- file.path(pkgdir , test_dir )
@@ -744,7 +744,7 @@ add_dummies <- function(dir, Log)
744744 }
745745 if (dir.exists(tests_dir ) && # trackObjs has only *.Rin
746746 length(dir(tests_dir , pattern = " \\ .(R|r|Rin)$" )))
747- run_tests(test_dir )
747+ run_tests(test_dir , do_tests )
748748
749749 # # Check package vignettes.
750750 setwd(pkgoutdir )
@@ -4642,11 +4642,11 @@ add_dummies <- function(dir, Log)
46424642 }
46434643
46444644 # # this is also used for --run-demo
4645- run_tests <- function (test_dir = " tests" )
4645+ run_tests <- function (test_dir = " tests" , run = TRUE )
46464646 {
46474647 is_demo <- test_dir == " demo"
46484648 check_packages_used <- ! is_demo ||
4649- config_val_to_logical(Sys.getenv(" _R_CHECK_PACKAGES_USED_IN_DEMO_" , do_demo ))
4649+ config_val_to_logical(Sys.getenv(" _R_CHECK_PACKAGES_USED_IN_DEMO_" , run ))
46504650 if (check_packages_used && ! extra_arch && ! is_base_pkg ) {
46514651 checkingLog(Log , " for unstated dependencies in " , sQuote(test_dir ))
46524652 Rcmd <- paste(opW_shE_F_str ,
@@ -4661,9 +4661,8 @@ add_dummies <- function(dir, Log)
46614661 }
46624662
46634663 if (is_demo ) {
4664- if (do_demo ) {
4664+ if (run ) {
46654665 checkingLog(Log , " demos" )
4666- do_tests <- TRUE
46674666 } else return ()
46684667 } else {
46694668 if (test_dir == " tests" )
@@ -4783,7 +4782,7 @@ add_dummies <- function(dir, Log)
47834782 setwd(pkgoutdir )
47844783 TRUE
47854784 }
4786- if (do_install && do_tests ) {
4785+ if (do_install && run ) {
47874786 if (! this_multiarch ) {
47884787 res <- run_one_arch()
47894788 } else {
0 commit comments