You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MAINTENANCE.md
+37-15Lines changed: 37 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,16 @@ The state of cpp11 is pretty stable, it seems to have the features we need for m
7
7
### Running the cpp11test tests
8
8
9
9
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
+
```
11
20
12
21
If tests failures occur the output from Catch isn't always easy to interpret.
13
22
I have a branch of testthat https://github.com/jimhester/testthat/tree/catch-detailed-output that should make things easier to understand.
@@ -17,28 +26,41 @@ In addition getting a debugger to catch when errors happen can be fiddly when ru
17
26
18
27
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.
19
28
20
-
### False positive URL checks for git repositories in the vignettes
29
+
## Ensure you use `Sys.setenv("CPP11_EVAL" = "true"); devtools::submit_cran()` when submitting.
30
+
31
+
If you forget to set `CPP_EVAL = "true"` then the vignette chunks will not run properly and the vignettes will not be rendered properly.
32
+
33
+
## Regenerating benchmark objects used in `motivations.Rmd`
21
34
22
-
If you run `urlchecker::url_check()` on the repo you will see the following false positives.
35
+
If you need to regenerate the benchmark objects (RDS objects) utilized in `motivations.Rmd`, then you should set `Sys.setenv("CPP11TEST_SHOULD_RUN_BENCHMARKS" = "TRUE")` before running the Rmd. You'll also need to make sure that cpp11test is actually installed. See `cpp11test:::should_run_benchmarks()` for more.
36
+
37
+
## Usage with clangd
38
+
39
+
Since cpp11 is header only, if you use clangd you'll have a bit of an issue because tools like bear and pkgload won't know how to generate the `compile_commands.json` file. Instead, you can create it manually with something like this, which seems to work well. Note that the paths are specific to your computer.
These only happen with the urlchecker package, they can be safely ignored and the real CRAN checks will not show them.
51
+
Key notes:
37
52
53
+
- Only doing this for `R.hpp` seems to be enough. I imagine this could be any of the header files, but it is reasonable to pick the "root" one that pretty much all others include.
54
+
- Using `-std=gnu++11` to keep us honest about only C++11 features.
55
+
- Using `-I\"/Library/Frameworks/R.framework/Resources/include\"` for access to the R headers.
56
+
- Using `-I\"/Users/davis/files/r/packages/cpp11/inst/include\"` as a "self include", which seems to be the key to the whole thing.
38
57
39
-
### Ensure you use `Sys.setenv("CPP11_EVAL" = "true"); devtools::submit_cran()` when submitting.
58
+
If you are modifying any tests or benchmarks, you also need:
40
59
41
-
If you forget to set `CPP_EVAL = "true"` then the vignette chunks will not run properly and the vignettes will not be rendered properly.
60
+
-`-I\"/Users/davis/Library/R/arm64/4.4/library/Rcpp/include\"` for Rcpp headers.
61
+
-`-I\"/Users/davis/Library/R/arm64/4.4/library/testthat/include\"` for testthat headers related to Catch tests.
62
+
63
+
Note that this is specific to a path on your machine and the R version you are currently working with.
0 commit comments