Closed
Description
When I build my test project:
ERROR: Exception while resolving test locations and traits in C:\Siarhei.Homan\Win32\Debug\opencv_core310d.dll
System.NullReferenceException: Object reference not set to an instance of an object.
at GoogleTestAdapter.DiaResolver.DiaResolver.GetFunctions(String symbolFilterString)
at GoogleTestAdapter.TestCases.TestCaseResolver.FindTestCaseLocationsInBinary(String binary, List`1 testMethodSignatures, String symbolFilterString, String pathExtension)
Activity
csoltenborn commentedon Jul 13, 2016
Hi Sergey,
thanks for the report! Here are a couple of questions for the sake of narrowing down the cause:
opencv_core310d.dll
(if any) should be affected...gomons commentedon Jul 13, 2016
Hi Christian!
GoogleTestAdapter.zip
csoltenborn commentedon Jul 14, 2016
Hi Sergey,
thanks for the example solution! I have built that solution (although using v140_xp as toolset) and might have found the cause for your problems: Please run the test executable from the command line (which is always a good idea in case GTA has issues - see our trouble shooting section ;-) ). You will probably get windows dialogs complaining about missing dlls (in my case,
openvc_core310d.dll
andopencv_imgcodecs310d.dll
), and if I comment out the lines you suggested, the test executable runs fine. You should be able to fix that by adding those dlls to the path (either system wide or using our Path extension option, see trouble shooting section).However, this does not explain why our code produces a
NullReferenceException
, and to be honest, I don't see how this could happen when looking at the code mentioned in the exception. Would you be willing to help debug this issue, even if the above solves your concrete problem?gomons commentedon Jul 14, 2016
Thank you alot, Christian!
I'm sorry for my inattention... It's all because of my environment settings, I can run executable from Visual Studio because I use Envirement option and I just forgot about it.
I reproduced NullReferenceException. I attached modified solution. The NullReferenceException reason: not all dll dependencies satisfied. So I just added opencv_core310d.dll to build output directory. If I put other dll that needed to start application all is ok.
GoogleTestAdapter.zip
csoltenborn commentedon Jul 14, 2016
Hi Sergey,
no problem :-) I will try reproduce the NRE with your new solution soon...
if listing of tests fails, GTA produces a warning now, and no further…
added test case for test executable crashing when listing tests (#63)
Fic loc paths from projects for localization and remove res swix (#63)