Unable to cover an exe old friend: NCover.Console
Unable to cover an exe old friend: NCover.Console
Seems I get this every single time I try to cover something new... Below are the 4 combinations I tried, I believe I've ruled out the x86 vs x64 and whether the extension is need or not...
On a working build the start looks like: Loading C:\Jenkins.hudson\jobs\FileImport\workspace\File Import\MAINLINE\LocalTestRun.testrunconfig... Loading C:\Jenkins.hudson\jobs\FileImport\workspace\File Import\MAINLINE\FileImportLib.Test\bin\Release\FileImportLib.Test.dll... Loading C:\Jenkins.hudson\jobs\FileImport\workspace\File Import\MAINLINE\FileImport.IntegrationTest\bin\Release\FileImport.Integration.Test.dll... Starting execution... Process 'QTAgent' [PID 416] has begun profiling.
On this new failing build is looks like: Loading C:\Jenkins.hudson\jobs\CahpsXmlExport\workspace\CahpsXmlExport\MAINLINE\LocalTestRun.testrunconfig... Loading C:\Jenkins.hudson\jobs\CahpsXmlExport\workspace\CahpsXmlExport\MAINLINE\CahpsXmlExport.Test\bin\Release\CahpsXmlExport.Test.dll... Starting execution...
Other project all covered DLL's, this one an exe... So what do I have to do special to cover exes?
command lines used:
NCover command: "C:\Program Files\NCover\ncover.console.exe" //x TestResults\unit_coverage.xml //ias CahpsXMLExport.exe //ea System.* "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe" /testcontainer:"C:/Jenkins/.hudson/jobs/CahpsXmlExport/workspace/CahpsXmlExport/MAINLINE/CahpsXmlExport.Test/bin/Release/CahpsXmlExport.Test.dll" /resultsfile:TestResults/testResults.trx /runconfig:"C:/Jenkins/.hudson/jobs/CahpsXmlExport/workspace/CahpsXmlExport/MAINLINE/LocalTestRun.testrunconfig"
NCover command: "C:\Program Files (x86)\NCover\ncover.console.exe" //x TestResults\unit_coverage.xml //ias CahpsXMLExport.exe //ea System.* "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe" /testcontainer:"C:/Jenkins/.hudson/jobs/CahpsXmlExport/workspace/CahpsXmlExport/MAINLINE/CahpsXmlExport.Test/bin/Release/CahpsXmlExport.Test.dll" /resultsfile:TestResults/testResults.trx /runconfig:"C:/Jenkins/.hudson/jobs/CahpsXmlExport/workspace/CahpsXmlExport/MAINLINE/LocalTestRun.testrunconfig"
NCover command: "C:\Program Files\NCover\ncover.console.exe" //x TestResults\unit_coverage.xml //ias CahpsXMLExport //ea System.* "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe" /testcontainer:"C:/Jenkins/.hudson/jobs/CahpsXmlExport/workspace/CahpsXmlExport/MAINLINE/CahpsXmlExport.Test/bin/Release/CahpsXmlExport.Test.dll" /resultsfile:TestResults/testResults.trx /runconfig:"C:/Jenkins/.hudson/jobs/CahpsXmlExport/workspace/CahpsXmlExport/MAINLINE/LocalTestRun.testrunconfig"
NCover command: "C:\Program Files (x86)\NCover\ncover.console.exe" //x TestResults\unit_coverage.xml //ias CahpsXMLExport //ea System.* "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe" /testcontainer:"C:/Jenkins/.hudson/jobs/CahpsXmlExport/workspace/CahpsXmlExport/MAINLINE/CahpsXmlExport.Test/bin/Release/CahpsXmlExport.Test.dll" /resultsfile:TestResults/testResults.trx /runconfig:"C:/Jenkins/.hudson/jobs/CahpsXmlExport/workspace/CahpsXmlExport/MAINLINE/LocalTestRun.testrunconfig"
RE: Unable to cover an exe old friend: NCover.Console
The simplest example of using NCover console to profile an executable is:
ncover.console.exe notepad.exe
So, assuming the exe in your first command line is the one you want to profile, the basic syntax would be: "C:\Program Files\NCover\ncover.console.exe" CahpsXMLExport.exe
Then, put in all your other parameters.
Also, NCover can only attach to one process at a time, so you can have NCover start MSTest to exercise your code, or have NCover start the exe and then you can run manual or automatic tests, but not both.
I hope this helps!
NCover Support
RE: Unable to cover an exe old friend: NCover.Console
The same code works for an DLL on a different application.
Other than changing the paths for the app and the DLL to an EXE, there is no real changes. Thus my confusion over why it is failing...
I'm sure I must have a typo in there somewhere that is causing it to bomb, but after looking it over for most of the morning, I just can't find it. :(
Any other logging I can turn on to see why it is not working?
As for the simple example, I need to run it through mstest, to get all the input files, parameters and databases configured for the tests to run.
I have verified that mstest works fine without NCover.