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

[GoogleTest] Invalid test in test list #55

Closed
OpenNingia opened this issue Jan 18, 2019 · 8 comments
Closed

[GoogleTest] Invalid test in test list #55

OpenNingia opened this issue Jan 18, 2019 · 8 comments
Assignees

Comments

@OpenNingia
Copy link

Before you file an issue, please check the README.md's known issues section.

Describe the bug (A clear and concise description of what the bug is.)

In the test list of my project I find a strange test:
Running main() from gmock_main.c

Running this test does nothing.

To Reproduce (Steps to reproduce the behavior:)
It's always there.

Expected behavior (A clear and concise description of what you expected to happen.)
That test shouldn't be there.

Screenshots (If applicable, add screenshots to help explain your problem.)
image

Desktop (please complete the following information):

  • Extension Version: 2.3.13
  • VS Code Version:

Version: 1.30.2 (user setup)
Commit: 61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8
Date: 2019-01-07T22:54:13.295Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
OS: Windows_NT x64 10.0.15063

  • Catch2/Google Test Version: GoogleTest: 1.7
  • OS Type and Version: Windows 10 Pro

Log (Attach log. (optional, Set: catch2TestExplorer.logfile and reproduce the bug.) Warning: Log probably contains file and test names too.)

Additional context Add any other context about the problem here.

@matepek
Copy link
Owner

matepek commented Jan 18, 2019

Could you comment the output of your executable with argument: --gtest_list_tests --gtest_output=xml:x.xml.
Also the generated x.xml files content pls.

@matepek matepek self-assigned this Jan 18, 2019
@matepek
Copy link
Owner

matepek commented Jan 18, 2019

I got it and fixed it. Gonna release soon. (version>2.3.13)

But I would like to see your logfile please. (generated with the new version)
The extension searches for tests in the output xml file, but in case of failure it parses the standard output which contains the line Running main() from ....

My fix will filter it (and it will work), but the reason I am asking you log is because somehow the xml generation or processing fails in your case.

@matepek matepek mentioned this issue Jan 18, 2019
@matepek
Copy link
Owner

matepek commented Jan 18, 2019

If you have time @OpenNingia the log would be appreciated. :)

@matepek matepek closed this as completed Jan 18, 2019
@OpenNingia
Copy link
Author

Sorry for the late, I'll send you the log file asap

@OpenNingia
Copy link
Author

gtest.log

Here is the logfile, I redacted some of the paths but it should be readable.

@matepek
Copy link
Owner

matepek commented Jan 21, 2019

Thank. Was the log created with the version > 2.3.13?

Here is how the parser works:

  1. Calls the test executable with --gtest_list_tests --gtest_output=xml:<some xml tmp file path>.
    (For example: --gtest_list_tests --gtest_output=xml:[redacted]\build\test\Debug_Static\tmp_gtest_output_0.e2uelxisqia_.xml.tmp)
  2. Tries to load and parse the generated xml file.
  3. If it fails, it tries to parse the output of the executable.

In your case phase 2 fails, but I don't understand why. The problem was in the 3th phase. There is an extra line what the parser couldn't handle (fixed), but still cant see why is 2th phase fails in your case.

If you have time you could run the test executable with the example and analyse what happening. If we can solve it the "jump to test" button will work again in your case too (xml contains file&line info, but output doesn't).

@OpenNingia
Copy link
Author

aparently my version of GTest doesn't support --gtest_list_tests together with --gtest_output=xml. It just ignore the directive and print the test list to the console.
However just running it with only --gtest_output=xml:<path> works correctly.

@matepek
Copy link
Owner

matepek commented Jan 22, 2019

It crossed my mind.
But happy to hear that the fallback option works.
You only miss the "navigate to test" feature.

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