Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch2 test cases with same name show up only once #443

Closed
5 tasks done
qustrolabe opened this issue Aug 23, 2024 · 1 comment
Closed
5 tasks done

Catch2 test cases with same name show up only once #443

qustrolabe opened this issue Aug 23, 2024 · 1 comment

Comments

@qustrolabe
Copy link

Checklist

  • The issue is about this extension and NOT about a fork.
  • Checked the ALL the SUPPORT document.
  • The latest version of the extension was used.
  • It is not related to remote-vscode or I checked the following issue
  • Imagine yourself into my position and think how hard to debug the issue without insufficient information.
    I understand that you have privacy concerns and I expect you to understand that this extension is developed for free.
    Thanks.

Describe the bug

Catch2 test cases allow same name if tags are different. Test Results on the VSCode Panel work fine, but issue lies in "Testing" section on VSCode Activity Bar - there only one of these tests show up

To Reproduce

TEST_CASE("Test123", "[MyTag1]") { REQUIRE(true); }
TEST_CASE("Test123", "[MyTag2]") { REQUIRE(true); }
TEST_CASE("Test123", "[MyTag3]") { REQUIRE(true); }
  1. Create and run tests shown above
  2. Open Testing on Activity Bar
  3. Notice how only one Test123 shows up

Screenshots (optional)

Screenshot 2024-08-23 204005
Desktop

  • Extension Version: v4.12.0
  • VS Code Version: 1.92.2
  • Catch2 Version: 3.7.0
  • OS Type and Version: Windows 11
  • Using remote-ssh/docker/wsl?: No
@matepek
Copy link
Owner

matepek commented Oct 19, 2024

Hey,
Thanks for the report.
It ringed a bell so I checked the code.
So the thing is that there is no way to identify runtime the test based on a name + tag combo.
Therefore it would not work.

./catch2v3_test1.exe 'Scenario: some scenario' --reporter xml
<?xml version="1.0" encoding="UTF-8"?>
<Catch2TestRun name="catch2v3_test1.exe" rng-seed="2992006806" catch2-version="3.1.1" filters="Scenario: some scenario">
  <TestCase name="Scenario: some scenario" tags="[.][integration]" filename="./test/cpp/catch2/catch2v3_test1.cpp" line="47">
    <Section name="Given: a widget, a gadget, a whoozit, a whatzit, and a thingamajig" filename="./test/cpp/catch2/catch2v3_test1.cpp" line="48">
      <Section name="When: foo is barred" filename="./test/cpp/catch2/catch2v3_test1.cpp" line="49">
        <Section name="Then: bif is bazzed" filename="./test/cpp/catch2/catch2v3_test1.cpp" line="50">
          <OverallResults successes="1" failures="0" expectedFailures="0"/>
        </Section>
        <OverallResults successes="1" failures="0" expectedFailures="0"/>
      </Section>
      <OverallResults successes="1" failures="0" expectedFailures="0"/>
    </Section>
    <OverallResult success="true"/>
  </TestCase>
  <OverallResults successes="1" failures="0" expectedFailures="0"/>
  <OverallResultsCases successes="1" failures="0" expectedFailures="0"/>
</Catch2TestRun>

I'm sorry but live feedback is more valuable feature than this.

@matepek matepek closed this as completed Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants