-
Notifications
You must be signed in to change notification settings - Fork 463
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
CTest integration not picking up test names on first compile #3358
Comments
Thanks for the report! I suspect the |
Thanks. Things do seem to work fine with the C++ TestMate extension, which is probably better integrated with Catch. It would be nice to be able to run the test properly from cmake-tools directly, but it's not a high priority if it doesn't happen. |
I'm hitting the same issue but with GTest, but for me rebuilding is not helping. The fix for me is to refresh the tests (either through UI or with command cmake.refreshTests). @benmcmorran, I have a similar file (<test_name>[1]_include.cmake) being generated in the build folder. Note that with GTest the suffix is slightly different.
The file A solid repro for me is to delete the build folder (so starting fresh) and clicking run all tests in the UI. |
I spent quite a bit of time debugging this today. From what I can tell it looks like VSCode is querying and caching the tests before the initial build is complete. As such the corresponding So I agree that it would make sense to refresh the tests any time that build is run that touches a test target. |
@dcoles Thank you for the follow up. Our developers will be working on this issue, thank you for your patience. |
We are having the |
@dabrahams Thank you very much for being able to ask this question, when I use this project you provided to reproduce the problem it will fail to configure, I can't be sure if this is something wrong with my operation, can you provide a simple reproduction project or a recording of the problem reproduced? |
You need to add a minimal Sorry, scratch that. I'll fix the project so you can reproduce it. |
I just pushed an update to make it easier to reproduce. Run CTest using the The result will contain failures like this on some of the tests:
The test explorer gets wedged - My current list of extensions (not all are enabled, but there is no filter to list only enabled ones).
|
I have reproduced it with a much shorter list of extensions attached |
@dabrahams Thank you very much for your reply as well as the update, we are having the following problem with the project you provided, on the first Run tests all the tests give an error, on every subsequent click a different test gives an error. Does this reproduce the problem you mentioned? |
I don't understand what this means:
You're talking about a different set of steps. Whether it's the same problem is unclear. Are you asking whether I see the same symptoms if I follow your steps? Please clarify, thanks. |
@dabrahams I'm very sorry that I didn't understand your question, I thought your question was the same as the one mentioned in this issue. |
@gcampbell-msft I'm not really sure what the call logic is for this question: #3358 (comment), so I hope you can provide some help. :) |
Now I'm even more confused. What question? Before this reply saying I didn't understand your question to me, I had no question. What I had was a reproducible example that shows some of the same symptoms as the OP, a workaround, and a partial explanation for why the workaround is effective. I assumed that information might be helpful to you in fully diagnosing and then fixing the problem. Please let me know if there's anything further I can do to make this information more useful. If you think it's unrelated maybe it would help for me to file a separate issue? |
@dabrahams To be clear, it sounds this like this problem is well understood now. It sounds like, when the test explorer integration is enabled, it works as expected, but when it isn't enabled, it doesn't behave as expected in this scenario. @v-frankwang I don't believe this needs any further triaging, @dabrahams please confirm and I will label this accordingly and put it in our backlog. |
No, it's exactly the opposite. |
@dabrahams Ah, thanks for the clarification, my apologies. I'll update the context. |
Brief Issue Summary
I have a project where I am managing tests through Catch2. The CTest integration can successfully find, run, and display the results from my tests, but I'm facing an odd issue where it only works on the second compile of the project.
The first compile and run of Ctest finds no tests because instead of running the tests with a command of the form:
ctest -jxx -C Debug -T test --output-on-failure -R ^my_test_name-buildid
it instead runs
ctest -jxx -C Debug -T test --output-on-failure -R ^my_test_name_NOT_BUILT-buildid
The build itself actually looks fine, running
ctest
with no arguments in the build directory will run all the tests.What's odd is that if I recompile (say by selecting a different build variant) and recompile/retest, changing nothing else, it will correctly pick up and run all the tests.
I can't figure out where the extension is picking up the test names, for example grepping for NOT_BUILT in the build directory returns nothing.
CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: