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 tests with custom main function are not discovered #456

Open
5 tasks done
placintaalexandru opened this issue Dec 2, 2024 · 4 comments
Open
5 tasks done

Comments

@placintaalexandru
Copy link

placintaalexandru commented Dec 2, 2024

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

I have a test suite with a custom main function, something that resembles this file:

#define CATCH_CONFIG_CONSOLE_WIDTH 150
#include <catch2/catch_all.hpp>

int main( int argc, char ** argv ) {
  // some init code here
  ...
  
  // run the session
  const int & result = Catch::Session().run( argc, argv );

  // some cleanup code
  ....

  return result;
}

To Reproduce

Create a test with custom main, link Catch2::Catch2 using cmake.

Screenshots (optional)

The binary gets compiler:

image

But the extension does not show me the tests that the binary has.

Desktop

  • Extension Version: 4.12.2
  • VS Code Version: 1.95.3 f1a4fb101478ce6ec82fe9627c43efbf9e98c813 arm64
  • Catch2 / Google Test / DOCTest Version: catch2 3.7.1
  • OS Type and Version: macOS Darwin Kernel Version 24.1.0 arm64
  • Using remote-ssh/docker/wsl?: no, the tests are built on my local machine

Regression bug?

  • Last extension version in which the feature were working: I've just installed the extension today so I cannot tell.
**Log** (optional but recommended)
  <paste logs here>

There is no log in the Test Explorer in vscode.

@matepek
Copy link
Owner

matepek commented Dec 18, 2024

Can you paste the raw output of the executable for parameter --help?

@matepek
Copy link
Owner

matepek commented Dec 18, 2024

find the logs pls

@placintaalexandru
Copy link
Author

hello @matepek

where can I find the logs?

@placintaalexandru
Copy link
Author

Can you paste the raw output of the executable for parameter --help?

the output did not look like any catch2 help message. perhaps this why the tests where not discovered. i guess this can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants