diff options
-rw-r--r-- | .travis.yml | 1 | ||||
-rw-r--r-- | appveyor.yml | 2 | ||||
-rwxr-xr-x | ci/common/submit_coverage.sh | 3 | ||||
-rwxr-xr-x | ci/script.sh | 6 | ||||
-rw-r--r-- | src/nvim/event/process.c | 10 | ||||
-rw-r--r-- | src/nvim/os/pty_process_unix.c | 10 | ||||
-rw-r--r-- | test/functional/eval/executable_spec.lua | 2 |
7 files changed, 21 insertions, 13 deletions
diff --git a/.travis.yml b/.travis.yml index 1ccfe0f3ab..18ab33e802 100644 --- a/.travis.yml +++ b/.travis.yml @@ -108,6 +108,7 @@ jobs: env: - GCOV=gcov - CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON" + - GCOV_ERROR_FILE="/tmp/libgcov-errors.log" - *common-job-env - name: clang-tsan os: linux diff --git a/appveyor.yml b/appveyor.yml index b41f0ee7a8..bb7bb1c4e9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -32,6 +32,8 @@ after_build: if (Test-Path $env:GCOV_ERROR_FILE) { Get-Content $env:GCOV_ERROR_FILE -Head 10 Get-Content $env:GCOV_ERROR_FILE -Tail 10 + } else { + write-host "no GCOV_ERROR_FILE" } cache: - C:\projects\nvim-deps -> third-party\** diff --git a/ci/common/submit_coverage.sh b/ci/common/submit_coverage.sh index 7c343268d1..218b90d6f4 100755 --- a/ci/common/submit_coverage.sh +++ b/ci/common/submit_coverage.sh @@ -25,6 +25,7 @@ python3 -m gcovr --branches --exclude-unreachable-branches --print-summary -j 2 # Upload to codecov. # -X gcov: disable gcov, done manually above. +# -X fix: disable fixing of reports (not necessary, rather slow) # -Z: exit non-zero on failure # -F: flag(s) # NOTE: ignoring flags for now, since this causes timeouts on codecov.io then, @@ -32,7 +33,7 @@ python3 -m gcovr --branches --exclude-unreachable-branches --print-summary -j 2 # Flags must match pattern ^[\w\,]+$ ("," as separator). codecov_flags="$(uname -s),${1}" codecov_flags=$(echo "$codecov_flags" | sed 's/[^,_a-zA-Z0-9]/_/g') -if ! "$codecov_sh" -f coverage.xml -X gcov -Z -F "${codecov_flags}"; then +if ! "$codecov_sh" -f coverage.xml -X gcov -X fix -Z -F "${codecov_flags}"; then echo "codecov upload failed." fi diff --git a/ci/script.sh b/ci/script.sh index a59c40cd2d..c8025ce34d 100755 --- a/ci/script.sh +++ b/ci/script.sh @@ -11,3 +11,9 @@ if [[ "${TRAVIS_OS_NAME}" == osx ]]; then else ci/run_${CI_TARGET}.sh fi + +if [[ -s "${GCOV_ERROR_FILE}" ]]; then + echo '=== Unexpected gcov errors: ===' + cat "${GCOV_ERROR_FILE}" + exit 1 +fi diff --git a/src/nvim/event/process.c b/src/nvim/event/process.c index 7a8a39dbcf..990dee0c7f 100644 --- a/src/nvim/event/process.c +++ b/src/nvim/event/process.c @@ -26,6 +26,11 @@ // For PTY processes SIGTERM is sent first (in case SIGHUP was not enough). #define KILL_TIMEOUT_MS 2000 +/// Externally defined with gcov. +#ifdef USE_GCOV +void __gcov_flush(void); +#endif + static bool process_is_tearing_down = false; /// @returns zero on success, or negative error code @@ -50,6 +55,11 @@ int process_spawn(Process *proc, bool in, bool out, bool err) proc->err.closed = true; } +#ifdef USE_GCOV + // Flush coverage data before forking, to avoid "Merge mismatch" errors. + __gcov_flush(); +#endif + int status; switch (proc->type) { case kProcessTypeUv: diff --git a/src/nvim/os/pty_process_unix.c b/src/nvim/os/pty_process_unix.c index 97545a6cb1..5fdf0e6181 100644 --- a/src/nvim/os/pty_process_unix.c +++ b/src/nvim/os/pty_process_unix.c @@ -36,11 +36,6 @@ # include "os/pty_process_unix.c.generated.h" #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(). static struct termios termios_default; @@ -64,11 +59,6 @@ int pty_process_spawn(PtyProcess *ptyproc) 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) Process *proc = (Process *)ptyproc; assert(proc->err.closed); diff --git a/test/functional/eval/executable_spec.lua b/test/functional/eval/executable_spec.lua index c8170076cc..1107fe6a0b 100644 --- a/test/functional/eval/executable_spec.lua +++ b/test/functional/eval/executable_spec.lua @@ -21,8 +21,6 @@ describe('executable()', function() -- Windows: siblings are in Nvim's "pseudo-$PATH". local expected = iswin() and 1 or 0 if iswin() then - -- $PATH on AppVeyor CI might be oversized, redefine it to a minimal one. - clear({env={PATH=[[C:\Windows\system32;C:\Windows]]}}) eq('arg1=lemon;arg2=sky;arg3=tree;', call('system', sibling_exe..' lemon sky tree')) end |