This class provides code coverage analysis by sampling the lines of code executed by a program and counting those occurrences, and by parsing the source files to find any code that was not executed.
Sampling is performed by using a Telnet connection to drive the Synergy/DE remote debugger, stepping through the code a line at a time and recording the line numbers encountered. This process can take quite a bit of time, depending on the code being executed. Because the Telnet remote debugger is not available for Synergy.NET, this class is not provided for .NET either.
This class is used by two supplied utilities: cover and htmlcover.
Words in italics indicate an instance of a class. The word corresponds to the class name, except where more than one instance is represented in the same statement. In that case a number (2, 3, etc.) is appended to the class name.
Words in normal typeface are to be taken literally (required punctuation, class name in a static reference, method name, etc.)
The symbol => is used to separate an expression (on the left) from its return value (on the right).
An ellipsis (...) indicates that the previous argument may be repeated any number of times. The description will indicate whether one instance is required.
codecoverage.Analyze(a) => boolean
codecoverage.AnalyzeAll() => ls
codecoverage.AnalyzeAll(ProgressHandler) => ls
codecoverage.Map => Hash
codecoverage.Map = Hash
codecoverage.Markup(a) => ls
Returns a list of HTML source lines that represent the source code from the file specified in a, marked up to indicate code coverage. If the file cannot be opened, then ls is returned as a list without any source lines, but still containing headers. If the file does not exist in the Map, it will be analyzed.
In the generated HTML, the first line will be a header in a <div> section of class "coverage coverage-head". This will contain <span>s for each header, of the same class as the columns, which are "coverage-line" (line number), "coverage-source" (the source line itself), and "coverage-hits" (the number of executions sampled). Each successive line is an actual source line from the file enclosed within a <div> with two classes: "coverage" and a class that specifies a range of hits:
codecoverage.MarkupAll(a, a2) => ls
codecoverage.MarkupAll(a, a2, ProgressHandler) => ls
Generates an HTML report of coverage for all known files, returning a list of files that could not be opened. The first argument (a) specifies the name of the HTML file that will be created. The second argument (a2) specifies the title for the report. At the top of the report will be a table that contains the name of each source file (linked to its specific sub-report) and the percentage of code executed at least once, more than once, and more than 10 times. Each file's report (generated by Markup) is then presented in a <div> section of class "coverage-file" and an id corresponding to the name of the file. If ProgressHandler is passed, then its OnProgress method will be invoked for each file as it is being processed.
The generated file contains a link to a stylesheet named "coverage.css". An example of this stylesheet can be found in tests\coverage.css.
codecoverage.Sample(a) => Hash
codecoverage.Sample(a, ProgressHandler) => Hash
CodeCoverage.SourcePath => string
CodeCoverage.SourcePath = string
codecoverage.TelnetPort => int
codecoverage.TelnetPort = int