orjangj / neotest-ctest

A neotest adapter for C/C++ using CTest as a test runner. Supports GoogleTest, Catch2 and doctest test frameworks.
MIT License
8 stars 4 forks source link

Namespaces are incorrectly marked as failed #11

Closed orjangj closed 5 months ago

orjangj commented 5 months ago

Namespaces are marked failed if tests outside the namespace is failing. Even if tests within the namespace are passing.

minimal example of when a namespace will be marked as failed:

#include <catch2/catch_test_macros.hpp>

namespace example {   <--- marked as failed

TEST_CASE("First", "[first]") { REQUIRE(true); }

}

TEST_CASE("Second", "[second]") {
    REQUIRE(false);
}

To trigger the bug, run the command require("neotest").run.run(vim.fn.expand("%")) to execute all tests within the file