Skip to content

Commit 127e700

Browse files
authored
Merge branch 'main' into testthat3e
2 parents c90eea4 + aeb1895 commit 127e700

File tree

17 files changed

+59
-126
lines changed

17 files changed

+59
-126
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ jobs:
2727
- {os: macos-latest, r: 'release'}
2828

2929
- {os: windows-latest, r: 'release'}
30-
# Use 3.6 to trigger usage of RTools35
31-
- {os: windows-latest, r: '3.6'}
3230
# use 4.1 to check with rtools40's older compiler
3331
- {os: windows-latest, r: '4.1'}
3432

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: cpp11
22
Title: A C++11 Interface for R's C Interface
3-
Version: 0.5.1
3+
Version: 0.5.1.9000
44
Authors@R:
55
c(
66
person("Davis", "Vaughan", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-4777-038X")),
@@ -18,7 +18,7 @@ License: MIT + file LICENSE
1818
URL: https://cpp11.r-lib.org, https://github.com/r-lib/cpp11
1919
BugReports: https://github.com/r-lib/cpp11/issues
2020
Depends:
21-
R (>= 3.6.0)
21+
R (>= 4.0.0)
2222
Suggests:
2323
bench,
2424
brio,
@@ -54,4 +54,4 @@ Config/Needs/cpp11/cpp_register:
5454
vctrs
5555
Encoding: UTF-8
5656
Roxygen: list(markdown = TRUE)
57-
RoxygenNote: 7.3.1
57+
RoxygenNote: 7.3.2

MAINTENANCE.md

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@ The state of cpp11 is pretty stable, it seems to have the features we need for m
77
### Running the cpp11test tests
88

99
Most of the test suite is in a sub-package, cpp11test.
10-
Probably the best way to run these tests is to install the development version of cpp11 and then run `devtools::test()` to run the cpp11test test suite.
10+
The best way to run these tests is to install the development version of cpp11 after any change, and then run `devtools::test("./cpp11test")`.
11+
Precisely, this looks like:
12+
13+
```r
14+
# Install dev cpp11, clean the cpp11test dll manually since it thinks nothing
15+
# has changed, then recompile and run its tests.
16+
devtools::install()
17+
devtools::clean_dll("./cpp11test")
18+
devtools::test("./cpp11test")
19+
```
1120

1221
If tests failures occur the output from Catch isn't always easy to interpret.
1322
I have a branch of testthat https://github.com/jimhester/testthat/tree/catch-detailed-output that should make things easier to understand.
@@ -17,25 +26,6 @@ In addition getting a debugger to catch when errors happen can be fiddly when ru
1726

1827
The GitHub Actions workflow has some additional logic to handle running the cpp11 tests https://github.com/r-lib/cpp11/blob/fd8ef97d006db847f7f17166cf52e1e0383b2d35/.github/workflows/R-CMD-check.yaml#L95-L102, https://github.com/r-lib/cpp11/blob/fd8ef97d006db847f7f17166cf52e1e0383b2d35/.github/workflows/R-CMD-check.yaml#L117-L124.
1928

20-
### False positive URL checks for git repositories in the vignettes
21-
22-
If you run `urlchecker::url_check()` on the repo you will see the following false positives.
23-
24-
```
25-
! Warning: vignettes/motivations.Rmd:363:11 Moved
26-
git clone https://github.com/r-lib/cpp11.git
27-
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28-
https://github.com/r-lib/cpp11
29-
! Warning: vignettes/motivations.Rmd:354:11 Moved
30-
git clone https://github.com/RcppCore/Rcpp.git
31-
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32-
https://github.com/RcppCore/Rcpp
33-
>
34-
```
35-
36-
These only happen with the urlchecker package, they can be safely ignored and the real CRAN checks will not show them.
37-
38-
3929
## Ensure you use `Sys.setenv("CPP11_EVAL" = "true"); devtools::submit_cran()` when submitting.
4030

4131
If you forget to set `CPP_EVAL = "true"` then the vignette chunks will not run properly and the vignettes will not be rendered properly.

NEWS.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,34 @@
11
# cpp11 (development version)
22

3-
# cpp11 0.5.1
3+
# cpp11 0.5.1.9000
44

55
* Uses testthat 3e style tests (#402).
66
* Removes the mockery dependence.
77
* The vendoring function accepts a custom path (i.e., to use the GitHub version of the package)
8+
*
9+
# cpp11 0.5.1
10+
11+
* cpp11 now requires R >=4.0.0, in line with the
12+
[tidyverse version policy](https://www.tidyverse.org/blog/2019/04/r-version-support/) (#411).
13+
14+
* Because cpp11 now requires R >=4.0.0, a number of previously optional tools
15+
are now always available, allowing us to remove some dead code. In
16+
particular:
17+
18+
* `R_UnwindProtect()` is always available, so the defines `HAS_UNWIND_PROTECT`
19+
and `CPP11_UNWIND` are no longer useful.
20+
21+
* ALTREP is always available, so the file `cpp11/altrep.hpp` and the define
22+
`HAS_ALTREP` are no longer useful.
23+
24+
We would like to remove the dead code regarding these tools in the future, so
25+
we ask that you please remove usage of them from your own packages (#411).
26+
27+
* `R_NO_REMAP` and `STRICT_R_HEADERS` are now conditionally defined only if they
28+
have not already been defined elsewhere. This is motivated by the fact that
29+
`R_NO_REMAP` is becoming the default for C++ code in R 4.5.0 (#410).
30+
31+
* Fixed a small protection issue flagged by rchk (#408).
832

933
# cpp11 0.5.0
1034

cpp11test/src/safe.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626
if (buf[0] != '\0') {
2727
Rf_error("%s", buf);
2828
} else if (err != R_NilValue) {
29-
#ifdef HAS_UNWIND_PROTECT
3029
R_ContinueUnwind(err);
31-
#endif
3230
}
3331

3432
return R_NilValue;

cpp11test/src/test-as.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,9 @@ context("as_cpp-C++") {
4949
auto x5 = cpp11::as_cpp<unsigned long>(r);
5050
expect_true(x5 == 42UL);
5151

52-
#ifdef HAS_UNWIND_PROTECT
5352
/* throws a runtime exception if the value is not a integerish one */
5453
REAL(r)[0] = 42.5;
5554
expect_error(cpp11::as_cpp<int>(r));
56-
#endif
5755

5856
UNPROTECT(1);
5957
}

cpp11test/src/test-doubles.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ context("doubles-C++") {
233233
UNPROTECT(1);
234234
}
235235

236-
#if defined(__APPLE__) && defined(R_VERSION) && R_VERSION >= R_Version(3, 5, 0)
236+
#if defined(__APPLE__)
237237
test_that("writable::doubles(ALTREP_SEXP)") {
238238
// ALTREP compact-seq
239239
auto seq = cpp11::package("base")["seq"];

cpp11test/src/test-integers.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#include "Rversion.h"
21
#include "cpp11/R.hpp"
32
#include "cpp11/doubles.hpp"
43
#include "cpp11/function.hpp"
@@ -218,7 +217,7 @@ context("integers-C++") {
218217
expect_true(x[2] == 3);
219218
}
220219

221-
#if defined(__APPLE__) && defined(R_VERSION) && R_VERSION >= R_Version(3, 5, 0)
220+
#if defined(__APPLE__)
222221
test_that("writable::integers(ALTREP_SEXP)") {
223222
// ALTREP compact-seq
224223
auto seq = cpp11::package("base")["seq"];

cpp11test/src/test-protect-nested.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#include "cpp11/protect.hpp"
33
#include "testthat.h"
44

5-
#ifdef HAS_UNWIND_PROTECT
6-
75
/*
86
* See https://github.com/r-lib/cpp11/pull/327 for full details.
97
*
@@ -77,5 +75,3 @@ context("unwind_protect-nested-C++") {
7775
destructed = false;
7876
}
7977
}
80-
81-
#endif

cpp11test/src/test-protect.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include "cpp11/protect.hpp"
33
#include "testthat.h"
44

5-
#ifdef HAS_UNWIND_PROTECT
65
context("unwind_protect-C++") {
76
test_that("unwind_protect works if there is no error") {
87
SEXP out = PROTECT(cpp11::unwind_protect([&] {
@@ -49,5 +48,3 @@ context("unwind_protect-C++") {
4948
expect_error_as(cpp11::safe[Rf_allocVector](REALSXP, -1), cpp11::unwind_exception);
5049
}
5150
}
52-
53-
#endif

0 commit comments

Comments
 (0)