mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 15:21:47 +00:00
gcov: use __gcov_flush instead of __gcov_dump (#10260)
This restores missing coverage again. Move it to process_spawn in os/pty_process_unix.c, since it seems to break printargs-test on Windows/AppVeyor otherwise (#10248).
This commit is contained in:
@@ -22,11 +22,6 @@
|
|||||||
# 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
|
||||||
@@ -55,11 +50,6 @@ 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:
|
||||||
|
@@ -36,6 +36,11 @@
|
|||||||
# include "os/pty_process_unix.c.generated.h"
|
# include "os/pty_process_unix.c.generated.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/// Externally defined with gcov.
|
||||||
|
#ifdef USE_GCOV
|
||||||
|
void __gcov_flush(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
/// termios saved at startup (for TUI) or initialized by pty_process_spawn().
|
/// termios saved at startup (for TUI) or initialized by pty_process_spawn().
|
||||||
static struct termios termios_default;
|
static struct termios termios_default;
|
||||||
|
|
||||||
@@ -59,6 +64,11 @@ int pty_process_spawn(PtyProcess *ptyproc)
|
|||||||
init_termios(&termios_default);
|
init_termios(&termios_default);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_GCOV
|
||||||
|
// Flush coverage data before forking, to avoid "Merge mismatch" errors.
|
||||||
|
__gcov_flush();
|
||||||
|
#endif
|
||||||
|
|
||||||
int status = 0; // zero or negative error code (libuv convention)
|
int status = 0; // zero or negative error code (libuv convention)
|
||||||
Process *proc = (Process *)ptyproc;
|
Process *proc = (Process *)ptyproc;
|
||||||
assert(proc->err.closed);
|
assert(proc->err.closed);
|
||||||
|
Reference in New Issue
Block a user