aboutsummaryrefslogtreecommitdiff
path: root/test/unit/helpers.lua
Commit message (Collapse)AuthorAge
* refactor(tests): run unittests using main nvim binary in interpreter modebfredl2023-01-31
| | | | This allows us to get rid of the separate "nvim-test" target
* fix(unittest): delete unused duplicated codebfredl2023-01-18
| | | | YAGNI. These were disabled 5 years ago in lint commit 29ed5b3a39abb84d6af602b2d0a7680d9dab381c
* fix(unittests): do not consider process crash to be a successbfredl2023-01-18
| | | | | | | | unittests relied on the exact setup of coredumps on CI to detect process crashing, and otherwise completely discarded errors. Dectect child process failure reliably using process status, so that unittests actually work locally as well.
* build: rename build-related dirsJustin M. Keyes2022-06-28
| | | | | | | | | | | | | | Problem: Dirs "config", "packaging", and "third-party" are all closely related but this is not obvious from the layout. This adds friction for new contributors. Solution: - rename config/ to cmake.config/ - rename test/config/ to test/cmakeconfig/ because it is used in Lua tests: require('test.cmakeconfig.paths'). - rename packaging/ to cmake.packaging/ - rename third-party/ to cmake.deps/ (parallel with .deps/)
* fix(unittests): coredump when running unit tests #18663Jun-ichi TAKIMOTO2022-05-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fs_init() must be called before early_init() in init/helpers.lua If I run 'make unittest' on my Mac (macOS 10.14/Mojave or 12/Big Sur, intel CPU), every test produce a core dump. Call sequence in the core is: early_init() main.c:197 set_init_1() option.c:508 runtimepath_default() runtime.c:1205 get_lib_dir() runtime.c:1175 os_isdir() fs.c:137 os_getperm() fs.c:777 os_stat() fs.c:761 fs_loop_lock() fs.c:72 uv_mutex_lock(&fs_loop_mutex) thread.c:352 abort() .deps/build/src/libuv/src/unix/thread.c: void uv_mutex_lock(uv_mutex_t* mutex) { if (pthread_mutex_lock(mutex)) abort(); // line 352 } So pthread_mutex_lock(&fs_loop_mutex) failed. The reason seems to be simple. fs_init() was not called and fs_loop_mutex has not been initialized. fs_init() was moved out from early_init() in main.c by b87867e69e94d9784468a126f21c721446f080de, but unit/helpers.lua was not updated accordingly.
* vim-patch:8.0.1554: custom plugins loaded with --cleanJan Edmund Lazo2020-06-18
| | | | | | Problem: Custom plugins loaded with --clean. Solution: Do not include the home directory in 'runtimepath'. https://github.com/vim/vim/commit/072687032683b1994d25a114893d9a6f8bc36612
* lua: move test helper function, map and filter, to vim.shared moduleHirokazu Hata2020-02-18
|
* tests: unit: NVIM_TEST_TRACE_LEVEL: default to 0 #11144Daniel Hahler2019-10-02
| | | | Traces are not useful normally (unless debugging/fixing tests), but only add overhead. Disable them by default.
* tests: unit.helpers: provide string with write errors (#10715)Daniel Hahler2019-08-06
| | | | This might help to have more information in case of errors, like mentioned in https://github.com/neovim/neovim/commit/eec529cf9e.
* Merge #9709 'fileio: use os_copy to create backups'Justin M. Keyes2019-05-20
|\ | | | | | | ref #8288
| * test: move trim to global helpersSaid Al Attrach2019-03-30
| |
* | lua/stdlib: Introduce vim.sharedJustin M. Keyes2019-05-18
| | | | | | | | | | | | | | | | | | | | This is where "pure functions" can live, which can be shared by Nvim and test logic which may not have a running Nvim instance available. If in the future we use Nvim itself as the Lua engine for tests, then these functions could be moved directly onto the `vim` Lua module. closes #6580
* | test: Extend {unit,functional}.helpers with global helpersJustin M. Keyes2019-05-18
|/ | | | | | | | Automatically include all "global helper" util functions in the unit.helpers and functional.helpers and modules. So tests don't need to expicitly do: local global_helpers = require('test.helpers')
* os/env: use libuv v1.12 getenv/setenv APIJustin M. Keyes2019-02-27
| | | | | | | | | | | - Minimum required libuv is now v1.12 - Because `uv_os_getenv` requires allocating, we must manage a map (`envmap` in `env.c`) to maintain the old behavior of `os_getenv` . - free() map-items after removal. khash.h does not make copies of anything, so even its keys must be memory-managed by the caller. closes #8398 closes #9267
* Merge branch 'master' into s-dash-stdinb-r-o-c-k2018-04-14
|\
| * unittest: Ignore all _Float-prefixed types (#8067)James McCoy2018-02-25
| | | | | | | | Previously, we ignored only _Float128. But glibc 2.27 added _Float32 and _Float32x. Rather than play whack-a-mole, ignore everything.
| * unittests: Do gc after reporting error, not beforeZyX2017-12-24
| | | | | | | | | | Reason: test may contain cleanup at the endwhich is needed for GC to work properly, but is not done if test fails. With collectgarbage() in former position it would crash when collecting garbage.
| * unittests: Remove start of trace, not endZyX2017-12-24
| |
| * unittests: Reduce memory used by vim_str2nr testZyX2017-11-30
| |
| * Merge branch 'master' into expression-parserZyX2017-11-30
| |\
| * | unittests: Avoid infinite cycle somewhere because of init failureZyX2017-11-19
| | |
| * | unittests: Add a way to show some custom messages only when crashedZyX2017-11-11
| | |
| * | tests: Fix testlint errorsZyX2017-11-06
| | |
| * | unittests: Free everything and check for memory leaksZyX2017-10-16
| | | | | | | | | Also improves error reporting.
| * | viml/parser/expressions: Start creating expressions parserZyX2017-10-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently supported nodes: - Register as it is one of the simplest value nodes (even numbers are not that simple with that dot handling). - Plus, both unary and binary. - Parenthesis, both nesting and calling. Note regarding unit tests: it stores data for AST in highlighting in strings in place of tables because luassert fails to do a good job at representing big tables. Squashing a bunch of data into a single string simply yields more readable result.
| * | unittests: Move some functions into helpers modulesZyX2017-10-08
| | |
| * | unittests: Add a way to print trace on regular errorZyX2017-09-29
| | |
* | | Merge branch 'master' into s-dash-stdinZyX2017-12-03
|\ \ \ | | |/ | |/|
| * | unittest: Ignore _Float128 types in ffiJames McCoy2017-11-29
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building with certain GCC versions, a _Float128 type is present when setting up the ffi for unit tests. ./test/unit/helpers.lua:256: declaration specifier expected near '_Float128' at line 396 /usr/bin/luajit: /usr/share/lua/5.1/busted/runner.lua:99: attempt to concatenate local 'message' (a table value) stack traceback: /usr/share/lua/5.1/busted/runner.lua:99: in function 'fn' /usr/share/lua/5.1/mediator.lua:103: in function 'publish' /usr/share/lua/5.1/busted/modules/helper_loader.lua:21: in function 'helperLoader' /usr/share/lua/5.1/busted/runner.lua:147: in function </usr/share/lua/5.1/busted/runner.lua:11> /usr/bin/busted:3: in main chunk [C]: at 0x004044a0 CMake Error at /<<PKGBUILDDIR>>/cmake/RunTests.cmake:53 (message): Running unit tests failed with error: 1. Since this is being pulled in by a dependency, not directly used by nvim, just ignore the type. Closes #7423
| * unittests: Move checking cores to check_child_errZyX2017-04-08
| |
| * unittests: Force GC, fix GC failures in typval_specZyX2017-04-06
| |
| * unittests: Make it easier to determine on which _spec line it crashed (#6424)Nikolai Aleksandrovich Pavlov2017-04-02
| | | | | | | | | | | | Benchmarks: Before change: 17.78s user 3.48s system 94% cpu 22.525 total After change: 25.38s user 4.46s system 101% cpu 29.317 total
| * unittests: Replace two environment variables with one TRACE_LEVELZyX2017-04-01
| |
| * unittests: Fix linter errorZyX2017-04-01
| |
| * unittests: Disable non-C-callsZyX2017-04-01
| | | | | | | | | | | | | | Some benchmarks: TRACE_EVERYTHING: 79.45s user 12.68s system 124% cpu 1:13.94 total (default): 30.26s user 5.30s system 89% cpu 39.663 total
| * unittests: Add trace description right to the error messageZyX2017-04-01
| |
| * unittests: Collect tracesZyX2017-04-01
| | | | | | | | | | | | | | | | | | | | | | Some benchmarks: MAIN_CDEFS + NO_TRACE: 3.81s user 1.65s system 33% cpu 16.140 total MAIN_CDEFS: 73.61s user 10.98s system 154% cpu 54.690 total NO_TRACE: 18.49s user 4.30s system 73% cpu 30.804 total (default): 77.11s user 14.74s system 126% cpu 1:12.79 total
| * unittests: Split itp implementation into multiple functionsZyX2017-04-01
| |
| * unittests: Do not hang when error message is too longZyX2017-04-01
| |
| * ci: Do not hide ci directory (#6410)Nikolai Aleksandrovich Pavlov2017-03-31
| |
| * unittests: Add tests for dictionary indexingZyX2017-03-29
|/
* unittests: Fix linter errorZyX2017-03-12
|
* unittests: Allow running `ffi.cdef` in the main processZyX2017-03-12
|
* unittests: Move filtering cdefs to main processZyX2017-03-12
|
* unittests: Use more adequate names for some functionsZyX2017-03-12
|
* unittests: Fix linter errorsZyX2017-03-11
|
* unittests: Do not use which, add data to paths.lua.in insteadZyX2017-03-11
|
* unittests: Always close all pipesZyX2017-03-11
|
* unittests: Do not import libnvim or headers in main processZyX2017-03-11
| | | Slows down unit tests much, but gets rid of as much preserved state as possible.
* unittests: Check core dumps in after_each, like in functestsZyX2017-03-11
|