csoltenborn / GoogleTestAdapter

Visual studio extension that adds support for the C++ testing framework Google Test.
Other
143 stars 100 forks source link

Could not find source location for test. with googletest/googlemock #319

Closed sarukk closed 3 years ago

sarukk commented 3 years ago

Hi,

We're using quite old version 1.7.0 [it's not up to me;)]. Currently we need to rebuild this library that was build in our env. sometime ago and it's working ok.

But with the newly build libs, with VS 2017 we're getting Could not find source location for test warning and the test are not run. It's happening only when we execute test with vs test console and GTA test adapter. If we run the test executable directly they are running properly.

Any one had an idea what is the issue here apart from 'upgrade gtest'?

Thanks!

csoltenborn commented 3 years ago

See trouble shooting section - let me know whether this helped.

sarukk commented 3 years ago

Hi Christian,

Thank you for your quick response. Unfortunately, non of the solutions worked.

  1. pdb files are in the same directory.
  2. /DEBUG:FULL is turned on on the test executable.
  3. ParseSymbolInformation: True is showing on debug GTA output.

GTA is also reportng something like this: Found 138 test method symbols and 0 trait symbols in binary c:\w\NGDS\0.4\Toolbox-GTA\Toolbox\Build\Windows\Debug\ToolboxTest.exe, pdb c:\w\NGDS\0.4\Toolbox-GTA\Toolbox\Build\Windows\Debug\ToolboxTest.pdb

csoltenborn commented 3 years ago
  1. would have been my guess... GTA prints out the command executed if debugging is enabled. What happens if you run that command in the printed directory?

Btw, my guess would also be that this is not related to gtest 1.7.0.

sarukk commented 3 years ago

If I run it in the printed directory the effect is the same.

It may not be related to gtest 1.7.0, but, we have some old compiled gtest 1.7.0 that if used, it's working ok. When I use newly compiled binary, it behave like in this issue.

csoltenborn commented 3 years ago

Then the problem is probably related to that... internally, GTA just uses C#'s Process class to run the executable, and then parses the executable's output. If you are able to run the command as printed out and it works, then it will almost certainly also work within Visual Studio.

csoltenborn commented 3 years ago

Closing due to inactivty - feel free to reopen if you need more input.