Skip to content

Commit 0362a37

Browse files
committed
Add a native gcov_flush function
To flush coverage informmation.
1 parent bb1fa3d commit 0362a37

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

src/init.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,23 @@ SEXP processx__echo_on(void);
1313
SEXP processx__echo_off(void);
1414
SEXP processx__set_boot_time(SEXP);
1515

16+
#ifdef GCOV_COMPILE
17+
18+
void __gcov_dump();
19+
SEXP gcov_flush() {
20+
REprintf("Flushing coverage info\n");
21+
__gcov_dump();
22+
return R_NilValue;
23+
}
24+
25+
#else
26+
27+
SEXP gcov_flush(void) {
28+
return R_NilValue;
29+
}
30+
31+
#endif
32+
1633
static const R_CallMethodDef callMethods[] = {
1734
CLEANCALL_METHOD_RECORD,
1835
{ "processx_exec", (DL_FUNC) &processx_exec, 14 },
@@ -73,6 +90,8 @@ static const R_CallMethodDef callMethods[] = {
7390
{ "processx__echo_on", (DL_FUNC) &processx__echo_on, 0 },
7491
{ "processx__echo_off", (DL_FUNC) &processx__echo_off, 0 },
7592

93+
{ "gcov_flush", (DL_FUNC) gcov_flush, 0 },
94+
7695
{ NULL, NULL, 0 }
7796
};
7897

0 commit comments

Comments
 (0)