summaryrefslogtreecommitdiffstatshomepage
path: root/test/unit/testutil.lua
AgeCommit message (Collapse)AuthorFiles
2026-04-15test: replace busted with local harnessLewis Russell1
Replace the busted-based Lua test runner with a repo-local harness. The new harness runs spec files directly under `nvim -ll`, ships its own reporter and lightweight `luassert` shim, and keeps the helper/preload flow used by the functional and unit test suites. Keep the file boundary model shallow and busted-like by restoring `_G`, `package.loaded`, `package.preload`, `arg`, and the process environment between files, without carrying extra reset APIs or custom assertion machinery. Update the build and test entrypoints to use the new runner, add black-box coverage for the harness itself, and drop the bundled busted/luacheck dependency path. AI-assisted: Codex
2026-01-21test: fix some type warnings (#37483)zeertzjq1
2025-11-18build(test): unknown 'ipc_info_object_type_t' type on macOS #36523Koichi Shiraishi1
Problem: On macOS Tahoe, `make unittest` started failing with the following error. ```` test/unit/testutil.lua:784: test/unit/testutil.lua:768: (string) ' test/unit/testutil.lua:295: declaration specifier expected near 'ipc_info_object_type_t' at line 2297' exit code: 256 stack traceback: test/unit/testutil.lua:784: in function 'itp_parent' test/unit/testutil.lua:822: in function <test/unit/testutil.lua:812> ```` Solution: Update filter_complex_blocks.
2025-09-26test(unit): disable JIT when using mocks (#35913)zeertzjq1
This fixes the flaky eval/typval_spec.lua tests.
2025-09-06fix(tests): ignore vector math typesJames McCoy1
As noted in #34908, the arm unittests fail due to unrecognized types: ERROR test/unit/testutil.lua @ 802: Expressions parser works with &opt test/unit/testutil.lua:774: test/unit/testutil.lua:758: (string) ' test/unit/testutil.lua:288: declaration specifier expected near '__SVFloat32_t'' exit code: 256 After testing on Debian's arm64 porterbox, the unittests cleanly pass when ignoring various types defined in /usr/include/aarch64-linux-gnu/bits/math-vector.h
2025-05-22fix(tests): use correct include path for unittestbfredl1
Copy whatever was made to work for generated headers: (1) we need to consider all cmake targets not just main_lib (2) we need to add the sysroot for macOS
2025-03-02test: simplify ASAN detectiondundargoc1
2025-02-22fix(tests): filter out lines with __typeof__ keyword (#32524)Sören Tempel1
Problem: On 32-bit architectures, musl libc makes heavy use of __typeof__ as part of its __REDIR macro for optional backwards compatibility with 32-bit time_t values. Unfortunately, the __typeof__ keyword is not supported by the LuaJIT C parser. Solution: Filter out the keyword in filter_complex_blocks.
2025-02-18fix(tests): remove the __extension__ keyword in filter_complex_blocks (#32483)Sören Tempel1
Problem: This keyword is used by GCC and Clang to prevent -Wpedantic (and other options) from emitting warnings for many GNU C extensions. This is used heavily in Alpine Linux through musl libc and foritfy-headers. Without filtering the __extension__ keyword some type definitions are duplicated. For example, timeval is defined once as struct timeval { time_t tv_sec; suseconds_t tv_usec; }; and once as: __extension__ struct timeval { time_t tv_sec; suseconds_t tv_usec; }; Without this patch, the LuaJIT C parser doesn't recognize that these definitions are equivalent, causing unit test to fail on Alpine Linux. Solution: Filter out the keyword in filter_complex_blocks.
2024-10-22test: port libvterm unit test to neovim test suitedundargoc1
These were imported from the v0.3.3 git tag https://github.com/neovim/libvterm/tree/v0.3.3 and not the latest commit. This is for compatibility reasons as the libvterm code was imported from v0.3.3.
2024-04-20refactor(lua): "module" => "M" #28426Justin M. Keyes1
Most of the codebase uses the `M` convention for Lua module. Update the last remaining cases.
2024-04-14ci: enable unittests on macos-14Joey Gouly1
Add more filters so that LuaJIT can parse headers on macOS 14. The system headers use a style of enum introduced in C++11 (and allowed as an extension in C by clang) of the form: enum Name : Type { The system headers also use bitfields in the mach_vm_range_recipe* types: struct Foo { int bar : 32; } Neither of these constructs can be parsed by LuaJIT, so filter the lines out. Neither of these declarations are used by neovim's unittests. There is a (now closed) issue about bitfields for LuaJIT: https://github.com/LuaJIT/LuaJIT/issues/951 Fixes #26145.
2024-04-10refactor(test): inject after_each differentlyLewis Russell1
2024-04-08test: improve test conventionsdundargoc1
Work on https://github.com/neovim/neovim/issues/27004.