Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lawrence-laz/neotest-zig
Test runner for Zig in Neovim using Neotest backend.
https://github.com/lawrence-laz/neotest-zig
lua neotest neovim test zig
Last synced: about 2 months ago
JSON representation
Test runner for Zig in Neovim using Neotest backend.
- Host: GitHub
- URL: https://github.com/lawrence-laz/neotest-zig
- Owner: lawrence-laz
- License: mit
- Created: 2023-10-01T13:29:42.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-24T18:14:12.000Z (3 months ago)
- Last Synced: 2024-10-26T03:12:31.399Z (3 months ago)
- Topics: lua, neotest, neovim, test, zig
- Language: Lua
- Homepage:
- Size: 74.2 KB
- Stars: 27
- Watchers: 2
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Neotest Zig ⚡
![Zig v0.14.0-dev](https://img.shields.io/badge/Zig-v0.14.0_dev-orange?logo=zig)
![Neovim v0.10](https://img.shields.io/badge/Neovim-v0.10-green?logo=neovim)[Neotest](https://github.com/nvim-neotest/neotest) test runner for [Zig](https://github.com/ziglang/zig).
https://github.com/lawrence-laz/neotest-zig/assets/8823448/9a003d0a-9ba4-4077-aa1b-3c0c90717734
## ⚙️ Requirements
- [`zig` v0.14.0-dev installed](https://ziglang.org/download/) and available in PATH
- [Neotest](https://github.com/nvim-neotest/neotest#installation)
- [Treesitter](https://github.com/nvim-treesitter/nvim-treesitter#installation) with [Zig support](https://github.com/maxxnino/tree-sitter-zig)## 📦 Setup
Install & configure using the package manager of your choice.
Example using lazy.nvim:
```lua
return {
"nvim-neotest/neotest",
dependencies = {
"lawrence-laz/neotest-zig", -- Installation
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"antoinemadec/FixCursorHold.nvim",
},
config = function()
require("neotest").setup({
adapters = {
-- Registration
require("neotest-zig")({
dap = {
adapter = "lldb",
}
}),
}
})
end
}
```## ⭐ Features
- Can run tests in individual `.zig` files and projects using `build.zig`
- Does not support a mix of individual files and `build.zig`:w
- `buil.zig` must have a standard `test` step
- Exact test filtering
- Timing all tests individually## 📄 Logs
Enabling logging in `neotest` automatically enables logging in `neotest-zig` as well:
```lua
require("neotest").setup({
log_level = vim.log.levels.TRACE,
-- ...
})
```
The logs can be openned by:
```vim
:exe 'edit' stdpath('log').'/neotest-zig.log'
```