neovim/test
Justin M. Keyes c67dd5acd0 NVIM v0.2.1
FEATURES:
0e873a30f3 Lua(Jit) built-in #4411
5b32bce73c Windows: `:terminal` #7007
7b0ceb3726 UI/API: externalize cmdline #7173
b67f58b284 UI/API: externalize wildmenu #7454
b23aa1cf09 UI: 'winhighlight' #6597
17531ed082 UI: command-line coloring (`:help input()-highlight`) #6364
244a1f97db API: execute lua directly from the remote api #6704
45626de63f API: `get_keymap()` #6236
db999821d4 API: `nvim_get_hl_by_name()`, `nvim_get_hl_by_id()` #7082
dc685387a3 menu_get() function #6322
9db42d4ce9 :cquit : take an error code argument #7336
9cc185dc6d job-control: serverstart(): support ipv6 #6680
1b7a9bf4d2 job-control: sockopen() #6594
6efe84af68 clipboard: fallback to tmux clipboard #6894
6016ac270f clipboard: customize clipboard with `g:clipboard` #6030
3a86dd54f3 ruby: override ruby host via `g:ruby_host_prog` #6841
16cce1ac17 debug: $NVIM_LOG_FILE #6827
0cba3da26e `:checkhealth` built-in, validates $VIMRUNTIME #7399

FIXES:
105d680aea TUI: more terminals, improve scroll/resize #6816
cb912a3eda :terminal : handle F1-F12, other keys #7241
619838f85d inccommand: improve performance #6949
04b3c32772 inccommand: Fix matches for zero-width #7487
60b1e8ad12 inccommand: multiline, other fixes #7315
f1f7f3b512 inccommand: Ignore leading modifiers in the command #6967
1551f71321 inccommand: fix 'gdefault' lockup #7262
6338199b76 API: bufhl: support creating new groups #7414
541dde36e3 API: allow K_EVENT during operator-pending
8c732f7274 terminal: adjust for 'number' #7440
5bec94652c UI: preserve wildmenu during jobs/events #7110
c349083155 UI: disable 'lazyredraw' during ui_refresh. #6259
51808a244e send FocusGained/FocusLost event instead of pseudokey #7221
133f8bc628 shada: preserve unnamed register on restart #4700
1b70a1da04 shada: avoid assertion on corrupt shada file #6958
9f534f338a mksession: Restore tab-local working directory #6859
de1084f3c4 fix buf_write() crash #7140
7f7698649f syntax: register 'Normal' highlight group #6973
6e7a8c3fe2 RPC: close channel if stream was closed #7081
85f3084e21 clipboard: disallow recursion; show hint only once #7203
8d1ccb606d clipboard: performance, avoid weird edge-cases #7193
01487d4385 'titleold' #7358
01e53a5cbe Windows: better path-handling, separator (slash) hygiene #7349
0f2873ce99 Windows: multibyte startup arguments #7060

CHANGES:
9ff0cc7085 :terminal : start in normal-mode #6808
032b088c84 lower priority of 'cursorcolumn', 'colorcolumn' #7364
2a3bcd1ff8 RPC: Don't delay notifications when request is pending #6544
023f67cad8 :terminal : Do not change 'number', 'relativenumber' #6796
1ef2d768e7 socket.c: Disable Nagle's algorithm on TCP sockets #6915
6720fe253e help: `K` tries Vim help instead of manpage #3104
7068370560 help, man.vim: change "outline" map to `gO` #7405
2017-11-07 23:54:31 +01:00
..
benchmark test: helpers.execute() => helpers.feed_command() 2017-04-11 02:37:39 +02:00
config functests: Fix some tests which are failing locally for unrelated reasons 2017-04-09 03:24:14 +03:00
functional NVIM v0.2.1 2017-11-07 23:54:31 +01:00
includes test: fix the unit test build on macOS Sierra (#6300) 2017-03-17 09:14:56 +01:00
unit test: avoid extra clear() calls 2017-10-02 01:46:16 +02:00
.luacheckrc test: lint whitespace in legacy/ (#7308) 2017-09-24 20:42:48 +02:00
README.md doc 2017-11-06 01:56:04 +01:00
helpers.lua functests: Add tests 2017-06-21 10:58:47 +03:00

README.md

Tests

Tests are run by /cmake/RunTests.cmake file, using busted.

For some failures, .nvimlog (or $NVIM_LOG_FILE) may provide insight.

Lint

make lint (and make testlint) runs luacheck on the test code.

If a luacheck warning must be ignored, specify the warning code. Example:

-- luacheck: ignore 621

http://luacheck.readthedocs.io/en/stable/warnings.html

Ignore the smallest applicable scope (e.g. inside a function, not at the top of the file).

Layout

  • /test/benchmark : benchmarks
  • /test/functional : functional tests
  • /test/unit : unit tests
  • /test/config : contains *.in files which are transformed into *.lua files using configure_file CMake command: this is for acessing CMake variables in lua tests.
  • /test/includes : include-files for use by luajit ffi.cdef C definitions parser: normally used to make macros not accessible via this mechanism accessible the other way.
  • /test/*/preload.lua : modules preloaded by busted --helper option
  • /test/**/helpers.lua : common utility functions for test code
  • /test/*/**/*_spec.lua : actual tests. Files that do not end with _spec.lua are libraries like /test/**/helpers.lua, except that they have some common topic.

Tests in /test/unit and /test/functional are normally divided into groups by the semantic component they are testing.

Environment variables

Test behaviour is affected by environment variables. Currently supported (Functional, Unit, Benchmarks) (when Defined; when set to 1; when defined, treated as Integer; when defined, treated as String; when defined, treated as Number; !must be defined to function properly):

GDB (F) (D): makes nvim instances to be run under gdbserver. It will be accessible on localhost:7777: use gdb build/bin/nvim, type target remote :7777 inside.

GDBSERVER_PORT (F) (I): overrides port used for GDB.

VALGRIND (F) (D): makes nvim instances to be run under valgrind. Log files are named valgrind-%p.log in this case. Note that non-empty valgrind log may fail tests. Valgrind arguments may be seen in /test/functional/helpers.lua. May be used in conjunction with GDB.

VALGRIND_LOG (F) (S): overrides valgrind log file name used for VALGRIND.

TEST_SKIP_FRAGILE (F) (D): makes test suite skip some fragile tests.

NVIM_PROG, NVIM_PRG (F) (S): override path to Neovim executable (default to build/bin/nvim).

CC (U) (S): specifies which C compiler to use to preprocess files. Currently only compilers with gcc-compatible arguments are supported.

NVIM_TEST_MAIN_CDEFS (U) (1): makes ffi.cdef run in main process. This raises a possibility of bugs due to conflicts in header definitions, despite the counters, but greatly speeds up unit tests by not requiring ffi.cdef to do parsing of big strings with C definitions.

NVIM_TEST_PRINT_I (U) (1): makes cimport print preprocessed, but not yet filtered through formatc headers. Used to debug formatc. Printing is done with the line numbers.

NVIM_TEST_PRINT_CDEF (U) (1): makes cimport print final lines which will be then passed to ffi.cdef. Used to debug errors ffi.cdef happens to throw sometimes.

NVIM_TEST_PRINT_SYSCALLS (U) (1): makes it print to stderr when syscall wrappers are called and what they returned. Used to debug code which makes unit tests be executed in separate processes.

NVIM_TEST_RUN_FAILING_TESTS (U) (1): makes itp run tests which are known to fail (marked by setting third argument to true).

LOG_DIR (FU) (S!): specifies where to seek for valgrind and ASAN log files.

NVIM_TEST_CORE_* (FU) (S): a set of environment variables which specify where to search for core files. Are supposed to be defined all at once.

NVIM_TEST_CORE_GLOB_DIRECTORY (FU) (S): directory where core files are located. May be .. This directory is then recursively searched for core files. Note: this variable must be defined for any of the following to have any effect.

NVIM_TEST_CORE_GLOB_RE (FU) (S): regular expression which must be matched by core files. E.g. /core[^/]*$. May be absent, in which case any file is considered to be matched.

NVIM_TEST_CORE_EXC_RE (FU) (S): regular expression which excludes certain directories from searching for core files inside. E.g. use ^/%.deps$ to not search inside /.deps. If absent, nothing is excluded.

NVIM_TEST_CORE_DB_CMD (FU) (S): command to get backtrace out of the debugger. E.g. gdb -n -batch -ex "thread apply all bt full" "$_NVIM_TEST_APP" -c "$_NVIM_TEST_CORE". Defaults to the example command. This debug command may use environment variables _NVIM_TEST_APP (path to application which is being debugged: normally either nvim or luajit) and _NVIM_TEST_CORE (core file to get backtrace from).

NVIM_TEST_CORE_RANDOM_SKIP (FU) (D): makes check_cores not check cores after approximately 90% of the tests. Should be used when finding cores is too hard for some reason. Normally (on OS X or when NVIM_TEST_CORE_GLOB_DIRECTORY is defined and this variable is not) cores are checked for after each test.

NVIM_TEST_RUN_TESTTEST (U) (1): allows running test/unit/testtest_spec.lua used to check how testing infrastructure works.

NVIM_TEST_TRACE_LEVEL (U) (N): specifies unit tests tracing level: 0 disables tracing (the fastest, but you get no data if tests crash and there was no core dump generated), 1 or empty/undefined leaves only C function cals and returns in the trace (faster then recording everything), 2 records all function calls, returns and lua source lines exuecuted.