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
Discoverer fails to find any tests #19
Comments
Looks like the warning is generated by the Boost test adapter. It may be interfering with Catch2 test discovery. One solution is to disable the Boost test adapter extension, or change the settings for the boost test adapter so it does not try to run discovery on your Catch2 unit tests. The Test Adapter for Catch2 does not need the debug symbols. I have no experience with the Boost test adapter so I'm afraid I cannot help any further there. |
Thank you for the prompt reply. Indeed you were correct. Disabling the Boost test adapter got rid of the debug symbols error. However, the discoverer is still not finding our tests. We have over 100 Catch2 tests in the NG-DART.exe file, but it does not find any of them. Also I can find no FilenameFilter setting to prevent it from searching every DLL in the project.
|
Setting
|
With
|
With
|
To start, the I'm a bit puzzled that you get no tests available in *.dll, as the Test Adapter for Catch2 should only be passed exe-files. It might be a different test adapter that is interfering in this case (e.g., Google test adapter). But it looks like that the real problem is that during discovery there are some extra unexpected lines being send to the output that probably are messing with the discovery process. Notably in:
the Also in:
the |
I have disabled both the Google Test Adapter and the Boost Test Adapter. AFAIK there are no other adapters for C++ installed. I added the "doDiscover == true" to cout for debugging. If it's not supposed to echo the command line (for Verbose and Debug output), then maybe our main is messing up the command line. But the output shows that the command line is effectively switching between XML Discovery and Default Discovery. So I think maybe the command line is ok, and the problem is something else. I have no idea what yet. Thank you very much for your help! |
It seems like the only way we might get this to work is if we could debug the adapter. I was able to clone and build it, but I don't know how to debug it. I'll try to learn how when I have time. |
I have found debugging the adapter directly is troublesome, in the sense that I haven't been able to get it to work. What I've done is that I use unittests to test the main components of the test adapter. Here I call a Catch2 executable, from the unittest. See the ExecuterTests and DiscovererTests for examples. Note that I've just submitted some changes that improve test discovery using the default discover mechanism that comes with Catch2 (works with Catch 2.0.1 and up). Here you now also get source file and line number information, so you no longer need the custom XML discovery mechanism for this. I expect to release the new version of the adapter somewhere around the weekend. I still need to update the documentation, and do some last sanity checks before I release the new version. But you can of course already get the latest features if you compile the adapter yourself. |
Now I am trying to get this to work with the exercism hello-world folder. I just installed VS 2019 and the Catch2 test adapter. Even with that, the adapter cannot find any tests. I just don't get it. Here is the test.runnsettings file, which I selected:
|
I finally got it to work on a new console project. Apparently, the test adapter requires a solution file to discover tests. |
Good to hear you got it working. I was out of ideas of what could be causing your problems. Thank you for mentioning your solution. It is typically one of those subtleties that is easy to take for granted. |
I have been having trouble with discovery, but think I have diagnosed the problem. So.. "MyTests.exe --list-tests" will crash instead of returning anything useful. Is there a way to control where the discoverer looks for the exe to discover the tests? |
@ScottHutchinson I have the same problem as you are describing, " the test adapter requires a solution file to discover tests.": what do you mean? Does it need its own *.sln file or its own subproject in the master sln-file? Stefan |
I didn't do the fix (for my build) myself, but it seemed to consist of:
Runsettings looks like this: %SAETests_DEPLOYMENT_PATH% x64 true .* 60000 on --verbosity high --list-tests * true debug ShortInfo 60 , 20000 Executable |
@allan-bommer, then I guess you have built the interface on your own and not used the version downloaded from within VS. |
@StefanOlin The tests just have to be in a project that is part of a solution. I believe initially I was trying to get it to work on a stand-alone project with no .sln file at all. |
Why can't it find the debug symbols when the .pdb files are in the same folder as the .exe file?
[1/30/2019 1:57:34 PM Warning] Could not locate debug symbols for 'C:\Users\Scott\Source\DART\NG-DART\Source\VS2012\NG-DART\Debug\NG-DART.exe'. To make use of '--list_content' discovery, ensure that debug symbols are available or make use of '<ForceListContent>' via a .runsettings file.
The text was updated successfully, but these errors were encountered: