Skip to content

Commit a2b0ce5

Browse files
authored
Ad-hoc fix for testthat's C entrypoint (#1274)
* fix argument type for run_testthat_tests entrypoint * update Changelog
1 parent ba19cde commit a2b0ce5

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2023-08-29 Iñaki Ucar <[email protected]>
2+
3+
* R/Attributes.R: Ad-hoc fix for testthat's C entrypoint in RcppExports.cpp
4+
15
2023-08-03 Dirk Eddelbuettel <[email protected]>
26

37
* DESCRIPTION (Version, Date): Roll micro version

R/Attributes.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,6 +1260,10 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) {
12601260
if (!routine %in% routines) {
12611261
declaration <- grep(sprintf("^extern .* %s\\(.*$", routine), code,
12621262
value = TRUE)
1263+
# FIXME: maybe we should extend this to *any* routine?
1264+
# or is there any case in which `void *` is not SEXP for a .Call?
1265+
if (routine == "run_testthat_tests")
1266+
declaration <- gsub("void *", "SEXP", declaration, fixed=TRUE)
12631267
declarations <- c(declarations, sub("^extern", "RcppExport", declaration))
12641268
call_entries <- c(call_entries, match[[1]]) # #nocov end
12651269
}

0 commit comments

Comments
 (0)