PartCover code details - code-coverage

I am using PartCover 2.2/2.3(trying with both) on win 7 x64. After generating report and selecting view coverage details, I can see for each method the code coverage. When I click on a method I see on the right list with block, block length, visit count and has source(set to yes).
I am using the money project from NUnit 2.5.2 samples.
However, it doesn't fill the code like shown here http://www.csharpcity.com/using-partcover-and-nunit-for-code-coverage/.
I haven't checked anything, everything is default.
Can you tell me how I can see the coverage code?
Thank you

Wrong assembly reference. Solved

Related

pydev code coverage reports zero

I am using eclipse Mars with pydev.
the python coverage module version is 3.7.1. It is installed with pip.
On the code coverage view there is no checkbox for "Enable code coverage for new launches?". The text is there, just there is no control associated.
I see "0%" everywhere in the Cover column, even after refreshing with hand.
The file /home/mag/workspace-mars/.metadata/.plugins/org.python.pydev.debug/coverage/.coverage is 50 byte binary. If I remove it before running unit tests, it reapears. My guess that this file is empty.
I did delete all interpreters in Pydev/Interpreters/Python interpreters and find them again with "quick auto-config.
This was an overlook from my part. There is actually a checkbox near "Enable coverage for new launches", just it is not visible.
I have clicked above the other two checkboxes, and voila. A check sign appeared, and coverage reports are shown.

Why are there errors in my structure viewer pane but not when I compile?

I build my project, and there are no errors:
That's because the build succeeded without any errors:
This is a good thing. The application runs and everything!
Except there are errors
What the compiler doesn't tell me is that there are errors:
I just happened to have this file open. And i just happened to have the Structure viewer open. And i just happened to see the errors.
Is there a way for Delphi to report all error it encounters during a build?
Is optimization on?
No
It's no big deal for a simple one-form test application, with one error. But when i have 200 forms, XE6 starts to look as bad a Visual Studio 2012. I then have to be sure to manually open every code file and check if there are any errors in it.
Is there a way to get XE6 to report all errors?
#xe6usability
The compiler is correct. Your code does not contain an error. You have two functions with the same name, but declared with the overload directive.
The IDE's Code Insight, or Error Insight, or whatever the feature is called, is mis-reporting this as an error. This is an age old phenomenon. The IDE uses a different code parser from the real compiler. Indeed, if I recall correctly, it uses multiple such fake parsers. They are not as good as the real one, and not infrequently get things like this wrong. It's considered to be a minor inconvenience and that's probably reasonable. I'd much rather the real compiler got it right than the other way around.
Short answer: Turn off ErrorInsight, it doesn't work.
Click Tools, Options, Find Editor Options item in the list, expand it, find Code Insight, click it. Then unclick Error insight.

Sampling Profiler with Delphi XE2

I have some problems in configuring Sampling Profiler (http://www.delphitools.info/samplingprofiler/)
I compiled a test application in debug build configuration, the relevant detailed map file is generated and use debug .dcus option is set to true. Here below the screenshots of the compiler configuration.
I ran the application from Sampling Profiler with the configuration here below and after having performed a few tasks I stopped the profiling.
I cannot see any of the lines I coded in the reports and I can see very few units names I coded. The vast majority of the units shown are third part components I use.
Where am I doing wrong ?
It seems that Sampling Profiler does not pick up the browsing path correctly as selected (I have the same issue with a project in XE).
So until that will get fixed you might add the source paths manually ("Custom Source Files Search Path" below the drop down list for the Delphi versions)
However in the function you selected in your screenshot it will not show the correct code because the function is located in the getmem.inc file which is included in the System.pas.

how to use NCover in console/command line?

i've downloaded a free version of ncover here -> http://sourceforge.net/projects/ncover/
but unortunately i am unable to find steps on how to use it in the command line.
any help would be great, thanks!
Have a look at this question.
There are two free versions of NCover available: The SourceForge one (which is discontinued and not working well as Try's comment on Ira Baxter's answer shows) and the Gnoso one (which used to be free and has gone commercial after version 1.5.8). Get the latter one from here.
In case it helps somebody else. I was able to get NCover 1.5.8 (one that comes with TestDriven.NET) working nicely with nunit.
NCover.Console.exe nunit-console-x86.exe /noshadow yourAssembly.dll
The only trick was to makes sure CoverLib.dll COM component is properly registered
regsrv32 CoverLib.dll
Otherwise you'd get "Profiled Process Terminated" error, and then making sure we are passing /noshadow parameter to nunit, otherwise NCover would fail to load symbols for the assembly (at least in my case).
Have a look at this question.
Steps to solve
1.Need to monitor the execution of Test cases Using ncover-console.exe
"[path]\NCover.Console.exe" "[path]\nunit- console.exe" "E:\Myapp\test.sln" /xml="[PATH]\TestResult.xml"
This will create a .nccov file
2.Create coverage html report from .nccov file using NCover.Reporting.exe
"[path]\NCover\NCover.Reporting.exe" "[path]\coverage.nccov" //or FullCoverageReport:Html:output

SharePoint Console Output

I made a class library, and put it in GAC.
It has one C# code file, and I put a Console.WriteLine() statement in.
When I run the Feature, where would I see the output from this statement?
Use
System.Diagnostics.Trace.WriteLine()
or
System.Diagnostics.Debug.WriteLine()
(Will only output text if assembly
compiled in debug mode)
to output some text. You would then see it in a program like DebugView.
But the best way to debug the program (if you ask this question regarding to debugging) i recommend attachking to SharePoint with Visual Studio debugger. Some debugging tips here.

Resources