diff options
-rw-r--r-- | ci/common/build.sh | 2 | ||||
-rw-r--r-- | ci/common/suite.sh | 19 | ||||
-rw-r--r-- | ci/common/test.sh | 5 | ||||
-rwxr-xr-x | ci/run_lint.sh | 24 | ||||
-rwxr-xr-x | ci/run_tests.sh | 8 | ||||
-rwxr-xr-x | scripts/gen_vimdoc.py | 2 | ||||
-rw-r--r-- | src/nvim/option.c | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test_vartabs.vim | 10 |
8 files changed, 33 insertions, 39 deletions
diff --git a/ci/common/build.sh b/ci/common/build.sh index 0ee4b7493f..c44c234274 100644 --- a/ci/common/build.sh +++ b/ci/common/build.sh @@ -8,8 +8,6 @@ _stat() { top_make() { printf '%78s\n' | tr ' ' '=' - # Travis has 1.5 virtual cores according to: - # http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM ninja "$@" } diff --git a/ci/common/suite.sh b/ci/common/suite.sh index 561849ce2d..f6a8c22d21 100644 --- a/ci/common/suite.sh +++ b/ci/common/suite.sh @@ -73,13 +73,8 @@ fail() { run_test() { local cmd="$1" - test $# -gt 0 && shift - local test_name="$1" - : ${test_name:=$cmd} - test $# -gt 0 && shift - if ! eval "$cmd" ; then - fail "${test_name}" "$@" - fi + local test_name="$2" + eval "$cmd" || fail "$test_name" } ended_successfully() { @@ -99,3 +94,13 @@ end_tests() { touch "${END_MARKER}" ended_successfully } + +run_suite() { + local command="$1" + local suite_name="$2" + + enter_suite "$suite_name" + run_test "$command" "$suite_name" + exit_suite --continue +} + diff --git a/ci/common/test.sh b/ci/common/test.sh index 92c15c8ba1..798f2926c6 100644 --- a/ci/common/test.sh +++ b/ci/common/test.sh @@ -182,8 +182,3 @@ install_nvim() {( exit_suite )} - -csi_clean() { - find "${BUILD_DIR}/bin" -name 'test-includes-*' -delete - find "${BUILD_DIR}" -name '*test-include*.o' -delete -} diff --git a/ci/run_lint.sh b/ci/run_lint.sh index 314976edc2..607ffa233a 100755 --- a/ci/run_lint.sh +++ b/ci/run_lint.sh @@ -8,24 +8,10 @@ CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "${CI_DIR}/common/build.sh" source "${CI_DIR}/common/suite.sh" -enter_suite 'clint' -run_test 'make clint-full' clint -exit_suite --continue - -enter_suite 'lualint' -run_test 'make lualint' lualint -exit_suite --continue - -enter_suite 'pylint' -run_test 'make pylint' pylint -exit_suite --continue - -enter_suite 'shlint' -run_test 'make shlint' shlint -exit_suite --continue - -enter_suite single-includes -run_test 'make check-single-includes' single-includes -exit_suite --continue +run_suite 'make clint-full' 'clint' +run_suite 'make lualint' 'lualint' +run_suite 'make pylint' 'pylint' +run_suite 'make shlint' 'shlint' +run_suite 'make check-single-includes' 'single-includes' end_tests diff --git a/ci/run_tests.sh b/ci/run_tests.sh index c175910da5..6c310ccc76 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -23,13 +23,13 @@ if test "$CLANG_SANITIZER" != "TSAN" ; then # Additional threads are only created when the builtin UI starts, which # doesn't happen in the unit/functional tests if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then - run_test run_unittests + run_test run_unittests unittests fi - run_test run_functionaltests + run_test run_functionaltests functionaltests fi -run_test run_oldtests +run_test run_oldtests oldtests -run_test install_nvim +run_test install_nvim install_nvim exit_suite --continue diff --git a/scripts/gen_vimdoc.py b/scripts/gen_vimdoc.py index 61fa5971a4..36768953f9 100755 --- a/scripts/gen_vimdoc.py +++ b/scripts/gen_vimdoc.py @@ -52,7 +52,7 @@ import logging from xml.dom import minidom -MIN_PYTHON_VERSION = (3, 5) +MIN_PYTHON_VERSION = (3, 6) if sys.version_info < MIN_PYTHON_VERSION: print("requires Python {}.{}+".format(*MIN_PYTHON_VERSION)) diff --git a/src/nvim/option.c b/src/nvim/option.c index 2c4c4819ea..b9fed8b378 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -7551,7 +7551,7 @@ bool tabstop_set(char_u *var, long **array) int n = atoi((char *)cp); // Catch negative values, overflow and ridiculous big values. - if (n < 0 || n > TABSTOP_MAX) { + if (n <= 0 || n > TABSTOP_MAX) { semsg(_(e_invarg2), cp); XFREE_CLEAR(*array); return false; diff --git a/src/nvim/testdir/test_vartabs.vim b/src/nvim/testdir/test_vartabs.vim index 46e0d62313..d05008d2dd 100644 --- a/src/nvim/testdir/test_vartabs.vim +++ b/src/nvim/testdir/test_vartabs.vim @@ -135,6 +135,16 @@ func Test_vartabs() bwipeout! endfunc +func Test_retab_invalid_arg() + new + call setline(1, "\ttext") + retab 0 + call assert_fails("retab -8", 'E487: Argument must be positive') + call assert_fails("retab 10000", 'E475:') + call assert_fails("retab 720575940379279360", 'E475:') + bwipe! +endfunc + func! Test_vartabs_breakindent() if !exists("+breakindent") return |