diff --git a/plugins/by-name/neotest/adapters-list.nix b/plugins/by-name/neotest/adapters-list.nix index 0e553a75..e651d391 100644 --- a/plugins/by-name/neotest/adapters-list.nix +++ b/plugins/by-name/neotest/adapters-list.nix @@ -7,6 +7,10 @@ bash = { treesitter-parser = "bash"; }; + ctest = { + treesitter-parser = "cpp"; + settingsSuffix = settingsLua: ".setup(${settingsLua})"; + }; dart = { treesitter-parser = "dart"; }; diff --git a/tests/test-sources/plugins/by-name/neotest/ctest.nix b/tests/test-sources/plugins/by-name/neotest/ctest.nix new file mode 100644 index 00000000..c2f7bb9e --- /dev/null +++ b/tests/test-sources/plugins/by-name/neotest/ctest.nix @@ -0,0 +1,23 @@ +{ + example = { + plugins = { + treesitter.enable = true; + neotest = { + enable = true; + + adapters.ctest = { + enable = true; + + settings = { + is_test_file.__raw = '' + function(file_path) + -- check if path has test in it + return string.match(file_path, "test") ~= nil + end + ''; + }; + }; + }; + }; + }; +} diff --git a/tests/test-sources/plugins/by-name/neotest/default.nix b/tests/test-sources/plugins/by-name/neotest/default.nix index 60ccbb22..2ec9ade9 100644 --- a/tests/test-sources/plugins/by-name/neotest/default.nix +++ b/tests/test-sources/plugins/by-name/neotest/default.nix @@ -11,6 +11,7 @@ adapters = { bash.enable = true; + ctest.enable = true; dart.enable = true; deno.enable = true; dotnet.enable = true;