mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 10:56:31 +00:00
Dump gcov coverage in process_spawn (#10230)
Fixes https://github.com/neovim/neovim/pull/3926#issuecomment-502343527.
This commit is contained in:
@@ -7,6 +7,7 @@ if(USE_GCOV)
|
|||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage")
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage")
|
||||||
|
add_compile_definitions(USE_GCOV)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -22,6 +22,11 @@
|
|||||||
# include "event/process.c.generated.h"
|
# include "event/process.c.generated.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/// Externally defined with gcov.
|
||||||
|
#ifdef USE_GCOV
|
||||||
|
void __gcov_dump(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Time for a process to exit cleanly before we send KILL.
|
// Time for a process to exit cleanly before we send KILL.
|
||||||
// For PTY processes SIGTERM is sent first (in case SIGHUP was not enough).
|
// For PTY processes SIGTERM is sent first (in case SIGHUP was not enough).
|
||||||
#define KILL_TIMEOUT_MS 2000
|
#define KILL_TIMEOUT_MS 2000
|
||||||
@@ -50,6 +55,11 @@ int process_spawn(Process *proc, bool in, bool out, bool err)
|
|||||||
proc->err.closed = true;
|
proc->err.closed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_GCOV
|
||||||
|
// Dump coverage data before forking, to avoid "Merge mismatch" errors.
|
||||||
|
__gcov_dump();
|
||||||
|
#endif
|
||||||
|
|
||||||
int status;
|
int status;
|
||||||
switch (proc->type) {
|
switch (proc->type) {
|
||||||
case kProcessTypeUv:
|
case kProcessTypeUv:
|
||||||
|
Reference in New Issue
Block a user