Skip to content

Commit

Permalink
if(requireNamespace("ggplot2"))
Browse files Browse the repository at this point in the history
  • Loading branch information
tdhock committed Nov 8, 2024
1 parent 915bdb4 commit a2d5d24
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: atime
Type: Package
Title: Asymptotic Timing
Version: 2024.11.5
Version: 2024.11.8
Authors@R: c(
person("Toby", "Hocking",
email="toby.hocking@r-project.org",
Expand Down
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Changes in version 2024.11.8

- only run tests that involve plotting if ggplot2 is available, to fix CRAN noSuggests issue, https://github.com/tdhock/atime/issues/67

Changes in version 2024.11.5

- new feature: atime_grid() stores a data table of parameters that were specified as input, with corresponding new column names in
Expand Down
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ $RCMD INSTALL $PKG_TGZ

echo Checking $PKG_TGZ
$RCMD check --as-cran $PKG_TGZ

echo Checking without any Suggests
R -e "if('check_without_suggests' %in% ls())check_without_suggests('$PKG_TGZ')"
2 changes: 1 addition & 1 deletion tests/testthat/test-CRAN.R
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ if(requireNamespace("nc")){
})
}

test_that("references for non-NA unit, with NA unit",{
if(requireNamespace("ggplot2"))test_that("references for non-NA unit, with NA unit",{
atime.list <- atime::atime(
missing=data.frame(my_unit=NA),
constant=data.frame(my_unit=1),
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-versions.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ test_that("atime_versions_exprs error when expr does not contain pkg:", {
}, "expr should contain at least one instance of binsegRcpp:: to replace with binsegRcpp.be2f72e6f5c90622fe72e1c315ca05769a9dc854:", fixed=TRUE)
})

test_that("atime_pkg produces tests_all_facet.png not tests_preview_facet.png", {
if(requireNamespace("ggplot2"))test_that("atime_pkg produces tests_all_facet.png not tests_preview_facet.png", {
repo <- git2r::repository(tdir)
## https://github.com/tdhock/binsegRcpp/tree/atime-test-funs
git2r::checkout(repo, branch="atime-test-funs")
Expand Down Expand Up @@ -60,7 +60,7 @@ test_that("atime_pkg produces tests_all_facet.png not tests_preview_facet.png",
expect_false(file.exists(tests_preview_facet.png))
})

test_that("atime_pkg produces tests_all_facet.png and tests_preview_facet.png", {
if(requireNamespace("ggplot2"))test_that("atime_pkg produces tests_all_facet.png and tests_preview_facet.png", {
repo <- git2r::repository(tdir)
## https://github.com/tdhock/binsegRcpp/tree/another-branch
git2r::checkout(repo, branch="another-branch")
Expand Down

0 comments on commit a2d5d24

Please sign in to comment.