diff options
-rw-r--r-- | .travis.yml | 66 | ||||
-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-- | cmake/GetCompileFlags.cmake | 8 | ||||
-rw-r--r-- | runtime/doc/options.txt | 2 | ||||
-rw-r--r-- | src/nvim/eval.c | 10 | ||||
-rw-r--r-- | src/nvim/event/process.c | 10 | ||||
-rw-r--r-- | src/nvim/ex_getln.c | 2 | ||||
-rw-r--r-- | src/nvim/memory.c | 2 | ||||
-rw-r--r-- | src/nvim/option.c | 2 | ||||
-rw-r--r-- | src/nvim/os/pty_process_unix.c | 10 | ||||
-rw-r--r-- | src/nvim/screen.c | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test_diffmode.vim | 3 | ||||
-rw-r--r-- | src/nvim/testdir/test_options.vim | 2 | ||||
-rw-r--r-- | test/functional/eval/executable_spec.lua | 9 | ||||
-rw-r--r-- | test/functional/options/num_options_spec.lua | 2 |
17 files changed, 88 insertions, 53 deletions
diff --git a/.travis.yml b/.travis.yml index c7c824afc0..18ab33e802 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,47 +47,77 @@ env: - CCACHE_SLOPPINESS=time_macros,file_macro - CCACHE_BASEDIR="$TRAVIS_BUILD_DIR" +anchors: + envs: &common-job-env + # Do not fall back to cache for "master" for PR on "release" branch: + # adds the target branch to the cache key. + FOR_TRAVIS_CACHE=$TRAVIS_BRANCH + jobs: include: - stage: baseline + name: clang-asan os: linux compiler: clang-4.0 # Use Lua so that ASAN can test our embedded Lua support. 8fec4d53d0f6 - env: > - CLANG_SANITIZER=ASAN_UBSAN - CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON" - ASAN_SYMBOLIZE=asan_symbolize-4.0 - - os: linux + env: + - CLANG_SANITIZER=ASAN_UBSAN + - CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON" + - ASAN_SYMBOLIZE=asan_symbolize-4.0 + - *common-job-env + - name: gcc-functionaltest-lua + os: linux compiler: gcc - env: > - FUNCTIONALTEST=functionaltest-lua - CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON" - DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF" - - os: linux + env: + - FUNCTIONALTEST=functionaltest-lua + - CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON" + - DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF" + - *common-job-env + - name: gcc-32bit + os: linux # Travis creates a cache per compiler. Set a different value here to # store 32-bit dependencies in a separate cache. compiler: gcc - env: BUILD_32BIT=ON + env: + - BUILD_32BIT=ON + - *common-job-env - if: branch = master AND commit_message !~ /\[skip.lint\]/ + name: lint os: linux - env: CI_TARGET=lint + env: + - CI_TARGET=lint + - *common-job-env - stage: second stage + name: "macOS: clang" os: osx compiler: clang osx_image: xcode10.2 # macOS 10.14 - - os: osx + env: + - *common-job-env + - name: "macOS: gcc" + os: osx compiler: gcc osx_image: xcode10.2 # macOS 10.14 + env: + - *common-job-env - - os: linux + - name: gcc-coverage + os: linux compiler: gcc - env: GCOV=gcov CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON" - - os: linux + 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 compiler: clang - env: CLANG_SANITIZER=TSAN + env: + - CLANG_SANITIZER=TSAN + - *common-job-env allow_failures: - - env: CLANG_SANITIZER=TSAN + - name: clang-tsan fast_finish: true before_install: ci/before_install.sh 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/cmake/GetCompileFlags.cmake b/cmake/GetCompileFlags.cmake index 77a5260780..482eacca16 100644 --- a/cmake/GetCompileFlags.cmake +++ b/cmake/GetCompileFlags.cmake @@ -1,6 +1,6 @@ function(get_compile_flags _compile_flags) # Create template akin to CMAKE_C_COMPILE_OBJECT. - set(compile_flags "<CMAKE_C_COMPILER> <CFLAGS> <BUILD_TYPE_CFLAGS> <COMPILE_OPTIONS> <COMPILE_DEFINITIONS> <INCLUDES>") + set(compile_flags "<CMAKE_C_COMPILER> <CFLAGS> <BUILD_TYPE_CFLAGS> <COMPILE_OPTIONS><COMPILE_DEFINITIONS> <INCLUDES>") # Get C compiler. string(REPLACE @@ -13,9 +13,11 @@ function(get_compile_flags _compile_flags) get_directory_property(compile_definitions DIRECTORY "src/nvim" COMPILE_DEFINITIONS) - # NOTE: list(JOIN) requires CMake 3.12. + # NOTE: list(JOIN) requires CMake 3.12, string(CONCAT) requires CMake 3. string(REPLACE ";" " -D" compile_definitions "${compile_definitions}") - string(CONCAT compile_definitions "-D" "${compile_definitions}") + if(compile_definitions) + set(compile_definitions " -D${compile_definitions}") + endif() string(REPLACE "<COMPILE_DEFINITIONS>" "${compile_definitions}" diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 7c9ad3010e..a421f6b5e7 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -4202,7 +4202,7 @@ A jump table for the options with a short description can be found at |Q_op|. rows in the window, depending on whether 'number' or 'relativenumber' is set. Thus with the Vim default of 4 there is room for a line number up to 999. When the buffer has 1000 lines five columns will be used. - The minimum value is 1, the maximum value is 10. + The minimum value is 1, the maximum value is 20. *'omnifunc'* *'ofu'* 'omnifunc' 'ofu' string (default: empty) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 1935478f15..becd4eaca1 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -22025,6 +22025,7 @@ static bool script_autoload(const char *const name, const size_t name_len, } /// Return the autoload script name for a function or variable name +/// Caller must make sure that "name" contains AUTOLOAD_CHAR. /// /// @param[in] name Variable/function name. /// @param[in] name_len Name length. @@ -22213,12 +22214,9 @@ static void func_clear_items(ufunc_T *fp) ga_clear_strings(&(fp->uf_args)); ga_clear_strings(&(fp->uf_lines)); - xfree(fp->uf_tml_count); - fp->uf_tml_count = NULL; - xfree(fp->uf_tml_total); - fp->uf_tml_total = NULL; - xfree(fp->uf_tml_self); - fp->uf_tml_self = NULL; + XFREE_CLEAR(fp->uf_tml_count); + XFREE_CLEAR(fp->uf_tml_total); + XFREE_CLEAR(fp->uf_tml_self); } /// Free all things that a function contains. Does not free the function 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/ex_getln.c b/src/nvim/ex_getln.c index 1f258985a6..093067894f 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -2495,7 +2495,7 @@ static void realloc_cmdbuff(int len) static char_u *arshape_buf = NULL; # if defined(EXITFREE) -void free_cmdline_buf(void) +void free_arshape_buf(void) { xfree(arshape_buf); } diff --git a/src/nvim/memory.c b/src/nvim/memory.c index dced03f3d5..1384aa177b 100644 --- a/src/nvim/memory.c +++ b/src/nvim/memory.c @@ -648,7 +648,7 @@ void free_all_mem(void) // Free all option values. Must come after closing windows. free_all_options(); - free_cmdline_buf(); + free_arshape_buf(); /* Clear registers. */ clear_registers(); diff --git a/src/nvim/option.c b/src/nvim/option.c index 2c96dae64e..9cdcf4cc34 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -4275,7 +4275,7 @@ static char *set_num_option(int opt_idx, char_u *varp, long value, } else if (pp == &curwin->w_p_nuw || pp == &curwin->w_allbuf_opt.wo_nuw) { if (value < 1) { errmsg = e_positive; - } else if (value > 10) { + } else if (value > 20) { errmsg = e_invarg; } } else if (pp == &curbuf->b_p_iminsert || pp == &p_iminsert) { 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/src/nvim/screen.c b/src/nvim/screen.c index 94887e113a..a007aa9a47 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -2086,7 +2086,7 @@ win_line ( int lcs_eol_one = wp->w_p_lcs_chars.eol; // 'eol' until it's been used int lcs_prec_todo = wp->w_p_lcs_chars.prec; // 'prec' until it's been used - /* saved "extra" items for when draw_state becomes WL_LINE (again) */ + // saved "extra" items for when draw_state becomes WL_LINE (again) int saved_n_extra = 0; char_u *saved_p_extra = NULL; int saved_c_extra = 0; diff --git a/src/nvim/testdir/test_diffmode.vim b/src/nvim/testdir/test_diffmode.vim index 00f4563f3d..1ba36ca8e9 100644 --- a/src/nvim/testdir/test_diffmode.vim +++ b/src/nvim/testdir/test_diffmode.vim @@ -752,6 +752,9 @@ func Test_diff_of_diff() if !CanRunVimInTerminal() return endif + if !has("rightleft") + throw 'Skipped: rightleft not supported' + endif call writefile([ \ 'call setline(1, ["aa","bb","cc","@@ -3,2 +5,7 @@","dd","ee","ff"])', diff --git a/src/nvim/testdir/test_options.vim b/src/nvim/testdir/test_options.vim index 28576709a3..a6ebd7b023 100644 --- a/src/nvim/testdir/test_options.vim +++ b/src/nvim/testdir/test_options.vim @@ -231,7 +231,7 @@ func Test_set_errors() call assert_fails('set backupcopy=', 'E474:') call assert_fails('set regexpengine=3', 'E474:') call assert_fails('set history=10001', 'E474:') - call assert_fails('set numberwidth=11', 'E474:') + call assert_fails('set numberwidth=21', 'E474:') call assert_fails('set colorcolumn=-a') call assert_fails('set colorcolumn=a') call assert_fails('set colorcolumn=1,') diff --git a/test/functional/eval/executable_spec.lua b/test/functional/eval/executable_spec.lua index ca82c8c9da..1107fe6a0b 100644 --- a/test/functional/eval/executable_spec.lua +++ b/test/functional/eval/executable_spec.lua @@ -21,17 +21,10 @@ 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 - local is_executable = call('executable', sibling_exe) - if iswin() and is_executable ~= expected then - pending('XXX: sometimes fails on AppVeyor') - else - eq(expected, is_executable) - end + eq(expected, call('executable', sibling_exe)) end) describe('exec-bit', function() diff --git a/test/functional/options/num_options_spec.lua b/test/functional/options/num_options_spec.lua index 88e554c86f..deda5c9118 100644 --- a/test/functional/options/num_options_spec.lua +++ b/test/functional/options/num_options_spec.lua @@ -74,7 +74,7 @@ describe(':set validation', function() should_fail('foldlevel', -5, 'E487') should_fail('foldcolumn', 13, 'E474') should_fail('conceallevel', 4, 'E474') - should_fail('numberwidth', 11, 'E474') + should_fail('numberwidth', 21, 'E474') should_fail('numberwidth', 0, 'E487') -- If smaller than 1 this one is set to 'lines'-1 |