Skip to content

Commit

Permalink
Add a native gcov_flush function
Browse files Browse the repository at this point in the history
To flush coverage informmation.
  • Loading branch information
gaborcsardi committed Dec 18, 2023
1 parent bb1fa3d commit 0362a37
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@ SEXP processx__echo_on(void);
SEXP processx__echo_off(void);
SEXP processx__set_boot_time(SEXP);

#ifdef GCOV_COMPILE

void __gcov_dump();
SEXP gcov_flush() {
REprintf("Flushing coverage info\n");
__gcov_dump();
return R_NilValue;
}

#else

SEXP gcov_flush(void) {
return R_NilValue;
}

#endif

static const R_CallMethodDef callMethods[] = {
CLEANCALL_METHOD_RECORD,
{ "processx_exec", (DL_FUNC) &processx_exec, 14 },
Expand Down Expand Up @@ -73,6 +90,8 @@ static const R_CallMethodDef callMethods[] = {
{ "processx__echo_on", (DL_FUNC) &processx__echo_on, 0 },
{ "processx__echo_off", (DL_FUNC) &processx__echo_off, 0 },

{ "gcov_flush", (DL_FUNC) gcov_flush, 0 },

{ NULL, NULL, 0 }
};

Expand Down

0 comments on commit 0362a37

Please sign in to comment.