[Lme4-commits] r1813 - pkgtests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Apr 25 15:27:40 CEST 2013


Author: bbolker
Date: 2013-04-25 15:27:40 +0200 (Thu, 25 Apr 2013)
New Revision: 1813

Modified:
   pkgtests/lme4depfuns.R
   pkgtests/lme4deptests.R
   pkgtests/runtests
Log:
further tweaking



Modified: pkgtests/lme4depfuns.R
===================================================================
--- pkgtests/lme4depfuns.R	2013-04-24 21:26:57 UTC (rev 1812)
+++ pkgtests/lme4depfuns.R	2013-04-25 13:27:40 UTC (rev 1813)
@@ -66,7 +66,7 @@
         download.file(file.path(basepath,tn),
                       destfile=tdn)
         ## install suggested packages that aren't already installed
-        depList <-lapply(c("Suggests","Depends"),
+        depList <- lapply(c("Suggests","Depends"),
                          tools:::package.dependencies,
                          x=pkginfo,
                          check=FALSE)

Modified: pkgtests/lme4deptests.R
===================================================================
--- pkgtests/lme4deptests.R	2013-04-24 21:26:57 UTC (rev 1812)
+++ pkgtests/lme4deptests.R	2013-04-25 13:27:40 UTC (rev 1813)
@@ -3,15 +3,36 @@
 ## include all downstream packages from CRAN, r-forge:
 ## packages to check, loaded from package-dependency scan
 
+
 ## these should eventually be default arguments
 verbose <- TRUE
 ## need this because R can't handle '@CRAN@' magic default
 ## in non-interactive mode ...
 options(repos=c(CRAN="http://probability.ca/cran"))
+pkg <- "lme4"
+do_parallel <- TRUE
+testdir <- getwd()
+tarballdir <- file.path(testdir,"tarballs")
+libdir <-     file.path(testdir,"library")
+checkdir <-     file.path(testdir,"check")
+reinstall_pkg <- FALSE
+locpkg <- "lme4_0.99999911-2.tar.gz"
 
+## FIXME: should get these straight from DESCRIPTION file
+pkgdep <- c("Rcpp","RcppEigen","minqa")
+instPkgs <- installed.packages(lib.loc=libdir,noCache=TRUE)
+pkgdepMiss <- setdiff(lme4dep,c("R",rownames(instPkgs)))
+install.packages(pkgdepMiss,lib=libdir)
+
+if (reinstall_pkg) {
+    install.packages(locpkg,repos=NULL,lib=libdir)
+}
+                 
 if (verbose) cat("retrieving dependency information\n")
 source("http://developer.r-project.org/CRAN/Scripts/depends.R")
-rr <- reverse_dependencies_with_maintainers("lme4")
+## FIXME: should download a local copy of this, for future-proofing
+
+rr <- reverse_dependencies_with_maintainers(pkg)
 source("lme4depfuns.R")  ## component/utility functions
 ## packages to skip (because dependencies don't install etc.
 ## skippkgs <- "polytomous"
@@ -34,15 +55,9 @@
 
 ## FIXME: why are R2admb, RLRsim, sdtalt, Zelig not getting checked?
 
-if (verbose) cat("setting up infrastructure\n")
-testdir <- getwd()
 
-## FIXME: should tarballdir="tarballs" etc. be arguments to a driver function?
-## directory for tarballs to check
-tarballdir <- file.path(testdir,"tarballs")
-## directory for ?? (at least current lme4 version ...)
-libdir <-     file.path(testdir,"library")
 
+
 suppressWarnings(rm(list=c("availCRAN","availRforge"))) ## clean up
 
 ## require(tools)
@@ -66,24 +81,26 @@
 }
 
 
-require(parallel)
+if (do_parallel) {
+    require(parallel)
+    Apply <- mclapply
+} else Apply <- lapply
 ## FIXME (maybe): mclapply doesn't work on Windows ?
 ##  and might hang Ubuntu VM?
 
 ## FIXME: not sure this is necessary/functional
-Sys.setenv(R_LIBS_SITE="./library")
-testresults <- mclapply(pkgnames,function(x) {
+testresults <- Apply(pkgnames,function(x) {
     if (verbose) cat("checking package",x,"\n")
     try(checkPkg(x,verbose=TRUE))
 })
-skipresults <- mclapply(skippkgs,function(x) try(checkPkg(x,skip=TRUE,verbose=TRUE)))
+skipresults <- Apply(skippkgs,function(x) try(checkPkg(x,skip=TRUE,verbose=TRUE)))
 testresults <- c(testresults,skipresults)
 
-save("testresults",file="lme4tests_out.RData")
+save("testresults",file="pkgtests_out.RData")
 
 if (FALSE) {
     ## playing with results
-    load("lme4tests_out.RData")
+    load("pkgtests_out.RData")
     checkPkg("HSAUR2")
 }
 ## names(testresults) <- X$X  ## should be obsolete after next run

Modified: pkgtests/runtests
===================================================================
--- pkgtests/runtests	2013-04-24 21:26:57 UTC (rev 1812)
+++ pkgtests/runtests	2013-04-25 13:27:40 UTC (rev 1813)
@@ -1,13 +1,16 @@
 #! /bin/bash
 ## install latest version of lme4 *into* the test package directory (-l flag)
-R CMD INSTALL -l ./library ../pkg/lme4
+## R CMD INSTALL -l ./library ../pkg/lme4
 ## set up proper testing environment;
 ## putting the appropriate library path into ~/.R/check.Renviron
 ## (should I try to preserve an existing check.Renviron file???)
 echo "R_LIBS_SITE=`pwd`/library" > ~/.R/check.Renviron
-echo "R_USER_SITE=`pwd`/library" >> ~/.R/check.Renviron
-## make sure this applies for the following R CMD BATCH ...
-export R_LIBS_SITE=./library  ## seems redundant but not really?
+##echo "R_USER_SITE=`pwd`/library" >> ~/.R/check.Renviron
+echo "R_LIBS_USER=`pwd`/library" >> ~/.R/check.Renviron
+## also need to set these for the batch file run
+## (so that package dependencies are properly checked)
+export R_LIBS_SITE=`pwd`/library
+export R_LIBS_USER=`pwd`/library
 ## run tests
 R CMD BATCH --vanilla lme4deptests.R
 ## tear down testing environment



More information about the Lme4-commits mailing list