From 9ebcf417d5ff771f50a9131c5382b757c0cbeb04 Mon Sep 17 00:00:00 2001 From: Mauricio 'Pacha' Vargas Sepulveda Date: Fri, 3 Jan 2025 10:20:48 +0000 Subject: [PATCH] fix sum rcpp error on Unix systems (cpp11test) --- cpp11test/.Rbuildignore | 3 +++ cpp11test/DESCRIPTION | 8 +++++--- cpp11test/LICENSE | 2 ++ cpp11test/LICENSE.md | 21 +++++++++++++++++++++ cpp11test/NAMESPACE | 1 + cpp11test/R/cpp11test-package.R | 2 ++ cpp11test/R/test.R | 3 +-- cpp11test/man/cpp11test-package.Rd | 20 -------------------- cpp11test/tests/testthat.R | 10 +++++++++- 9 files changed, 44 insertions(+), 26 deletions(-) create mode 100644 cpp11test/.Rbuildignore create mode 100644 cpp11test/LICENSE create mode 100644 cpp11test/LICENSE.md delete mode 100644 cpp11test/man/cpp11test-package.Rd diff --git a/cpp11test/.Rbuildignore b/cpp11test/.Rbuildignore new file mode 100644 index 00000000..1fe2b254 --- /dev/null +++ b/cpp11test/.Rbuildignore @@ -0,0 +1,3 @@ +^\.here$ +^bench$ +^LICENSE\.md$ diff --git a/cpp11test/DESCRIPTION b/cpp11test/DESCRIPTION index d1d05665..07d0a547 100644 --- a/cpp11test/DESCRIPTION +++ b/cpp11test/DESCRIPTION @@ -12,12 +12,14 @@ Authors@R: Description: Provides a test suite and benchmarking code for the 'cpp11' package. License: MIT + file LICENSE Encoding: UTF-8 -LinkingTo: Rcpp, cpp11, testthat +LinkingTo: cpp11, Rcpp, testthat +Imports: cpp11, Rcpp Suggests: covr, - testthat, + testthat (>= 3.0.0), pkgload, xml2 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.1.1 +RoxygenNote: 7.3.2 +Config/testthat/edition: 3 diff --git a/cpp11test/LICENSE b/cpp11test/LICENSE new file mode 100644 index 00000000..13458bda --- /dev/null +++ b/cpp11test/LICENSE @@ -0,0 +1,2 @@ +YEAR: 2025 +COPYRIGHT HOLDER: cpp11test authors diff --git a/cpp11test/LICENSE.md b/cpp11test/LICENSE.md new file mode 100644 index 00000000..9350bfc6 --- /dev/null +++ b/cpp11test/LICENSE.md @@ -0,0 +1,21 @@ +# MIT License + +Copyright (c) 2025 cpp11test authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/cpp11test/NAMESPACE b/cpp11test/NAMESPACE index 0cb4a22d..31d989df 100644 --- a/cpp11test/NAMESPACE +++ b/cpp11test/NAMESPACE @@ -3,4 +3,5 @@ export(run_tests) exportPattern("_$") importFrom(Rcpp,sourceCpp) +importFrom(cpp11,cpp_source) useDynLib(cpp11test, .registration = TRUE) diff --git a/cpp11test/R/cpp11test-package.R b/cpp11test/R/cpp11test-package.R index 16700446..e606536b 100644 --- a/cpp11test/R/cpp11test-package.R +++ b/cpp11test/R/cpp11test-package.R @@ -1,6 +1,8 @@ #' @keywords internal #' @exportPattern "_$" +#' @importFrom cpp11 cpp_source #' @importFrom Rcpp sourceCpp +NULL "_PACKAGE" # The following block is used by usethis to automatically manage diff --git a/cpp11test/R/test.R b/cpp11test/R/test.R index 07c0ff4d..618bd726 100644 --- a/cpp11test/R/test.R +++ b/cpp11test/R/test.R @@ -22,6 +22,5 @@ run_tests <- function(reporter = testthat::default_reporter()) { on.exit(setwd(old)) setwd(system.file("tests", package = "cpp11test")) - library(testthat) - test_check("cpp11test", reporter = reporter) + testthat::test_check("cpp11test", reporter = reporter) } diff --git a/cpp11test/man/cpp11test-package.Rd b/cpp11test/man/cpp11test-package.Rd deleted file mode 100644 index b0d9e562..00000000 --- a/cpp11test/man/cpp11test-package.Rd +++ /dev/null @@ -1,20 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/cpp11test-package.R -\docType{package} -\name{cpp11test-package} -\alias{cpp11test} -\alias{cpp11test-package} -\title{cpp11test: A test suite and benchmark code for 'cpp11'} -\description{ -Provides a test suite and benchmarking code for the 'cpp11' package. -} -\author{ -\strong{Maintainer}: Jim Hester \email{james.f.hester@gmail.com} (\href{https://orcid.org/0000-0002-2739-7082}{ORCID}) - -Other contributors: -\itemize{ - \item RStudio [copyright holder, funder] -} - -} -\keyword{internal} diff --git a/cpp11test/tests/testthat.R b/cpp11test/tests/testthat.R index 366c334f..c9dc587d 100644 --- a/cpp11test/tests/testthat.R +++ b/cpp11test/tests/testthat.R @@ -1,4 +1,12 @@ +# This file is part of the standard setup for testthat. +# It is recommended that you do not modify it. +# +# Where should you do additional test configuration? +# Learn more about the roles of various files in: +# * https://r-pkgs.org/testing-design.html#sec-tests-files-overview +# * https://testthat.r-lib.org/articles/special-files.html + library(testthat) -library(cpp11) +library(cpp11test) test_check("cpp11test")