Neotest adapter for Rust, using cargo-nextest.
Requires nvim-treesitter and the parser for Rust.
require("neotest").setup({
adapters = {
require("neotest-rust")
}
})
If you wish to give additional arguments to the cargo nextest,
you can specify the args when initializing the adapter.
require("neotest").setup({
adapters = {
require("neotest-rust") {
args = { "--no-capture" },
}
}
})
Supports standard library tests, rstest,
Tokio's [#tokio::test], and more. Does not support rstest's parametrized
tests.
Codelldb is the default adapter used for debugging.
Alternatives can be specified via the dap_adapter property during initialization.
require("neotest").setup({
adapters = {
require("neotest-rust") {
args = { "--no-capture" },
dap_adapter = "lldb",
}
}
})
See nvim-dap, and rust-tools#debugging if you are using rust-tools.nvim, for more information.
The following limitations apply to both running and debugging tests.
main.rs, mod.rs, and lib.rs are in a tests
module.rstest's #[case] macro.main.rs in an integration test subdirectory (e.g.
tests/testsuite/main.rs), all tests in that subdirectory will be run (e.g.
all tests in tests/testsuite/). This is because Cargo lacks the capability
to specify a test file.Additionally, when debugging tests, no output from failed tests will be captured in the results provided to Neotest.
Lua
96.9%
Rust
2.7%
Neotest adapter for Rust, using cargo-nextest.
Requires nvim-treesitter and the parser for Rust.
require("neotest").setup({
adapters = {
require("neotest-rust")
}
})
If you wish to give additional arguments to the cargo nextest,
you can specify the args when initializing the adapter.
require("neotest").setup({
adapters = {
require("neotest-rust") {
args = { "--no-capture" },
}
}
})
Supports standard library tests, rstest,
Tokio's [#tokio::test], and more. Does not support rstest's parametrized
tests.
Codelldb is the default adapter used for debugging.
Alternatives can be specified via the dap_adapter property during initialization.
require("neotest").setup({
adapters = {
require("neotest-rust") {
args = { "--no-capture" },
dap_adapter = "lldb",
}
}
})
See nvim-dap, and rust-tools#debugging if you are using rust-tools.nvim, for more information.
The following limitations apply to both running and debugging tests.
main.rs, mod.rs, and lib.rs are in a tests
module.rstest's #[case] macro.main.rs in an integration test subdirectory (e.g.
tests/testsuite/main.rs), all tests in that subdirectory will be run (e.g.
all tests in tests/testsuite/). This is because Cargo lacks the capability
to specify a test file.Additionally, when debugging tests, no output from failed tests will be captured in the results provided to Neotest.
Lua
96.9%
Rust
2.7%