diff --git a/DESCRIPTION b/DESCRIPTION index 05bee1a..51f5401 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: atime Type: Package Title: Asymptotic Timing -Version: 2024.3.5 +Version: 2024.4.12 Authors@R: c( person("Toby", "Hocking", email="toby.hocking@r-project.org", diff --git a/NEWS b/NEWS index 26036d0..873b757 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +Changes in version 2024.4.12 + +- atime_pkg gains tests.dir arg. + Changes in version 2024.3.5 - if(requireNamespace("nc")) in tests, thanks CRAN. diff --git a/R/versions.R b/R/versions.R index e7111e2..994a8ae 100644 --- a/R/versions.R +++ b/R/versions.R @@ -169,7 +169,7 @@ atime_versions_exprs <- function(pkg.path, expr, sha.vec=NULL, verbose=FALSE, pk a.args } -atime_pkg <- function(pkg.path="."){ +atime_pkg <- function(pkg.path=".", tests.dir="inst"){ ## For an example package see ## https://github.com/tdhock/binsegRcpp/blob/another-branch/inst/atime/tests.R each.sign.rank <- unit <- . <- N <- expr.name <- reference <- fun.name <- @@ -211,7 +211,7 @@ atime_pkg <- function(pkg.path="."){ mb.commit <- git2r::merge_base(HEAD.commit, base.commit) add_if_new("merge-base", mb.commit) } - tests.R <- file.path(pkg.path, "inst", "atime", "tests.R") + tests.R <- file.path(pkg.path, tests.dir, "atime", "tests.R") test.env <- new.env() tests.parsed <- parse(tests.R) eval(tests.parsed, test.env) diff --git a/man/atime_pkg.Rd b/man/atime_pkg.Rd index 76fde74..6de5590 100644 --- a/man/atime_pkg.Rd +++ b/man/atime_pkg.Rd @@ -4,12 +4,14 @@ \description{Computation time and memory for several R expressions of several different data sizes, for several package versions (base, HEAD, CRAN, merge-base, others specified by user).} -\usage{atime_pkg(pkg.path)} +\usage{atime_pkg(pkg.path=".", tests.dir="inst")} \arguments{ \item{pkg.path}{path to git repository containing R package.} + \item{tests.dir}{path to directory which contains atime/tests.R, + relative to \code{pkg.path} (default \code{"inst"}).} } \details{ - There should be a file named pkg.path/inst/atime/tests.R which + There should be a \code{tests.R} code file which defines \code{test.list}, a list with names corresponding to different tests. Each element should be a list with at least three named elements: \code{N}, @@ -22,12 +24,12 @@ CRAN is current published version (sha value \code{""}), merge-base is most recent common ancestor commit between base and HEAD. - The tests.R file can define \code{version.colors} which should be + The \code{tests.R} code file can define \code{version.colors} which should be a character vector (names for versions, values for colors). } \value{Named list, names come from names of \code{test.list}, and values come from results of \code{atime_versions}. Side effect is that - data/plot files are saved to the inst/atime directory.} + data/plot files are saved in \code{atime} directory.} \author{Toby Dylan Hocking}