Recommended Test Coverage Profilers
Teamscale can process a wide range of test-coverage formats, as produced by its own and dozens of different third-party tools.
If you already have coverage data, you can import it easily into Teamscale. The full list of supported coverage formats is listed in Upload formats.
If you don't have a profiler yet, see our extensive guides on setting up coverage recording.
Additional Tools & Formats
If your profiler isn't supported yet, don't hesitate to contact us; we continuously add support for new formats.
Excluding Code from Coverage
Teamscale recognizes the exclusion markers of common coverage tools and removes the marked code from the coverable lines. Excluded code is therefore reported neither as covered nor as uncovered, and does not appear as a test gap.
Teamscale's own marker works in every language Teamscale parses. The markers of the individual coverage tools are only recognized for the languages listed below and have no effect in any other language.
| Language | Marker | Excludes |
|---|---|---|
| All parsed languages | teamscale:coverage ignore method | The method following the comment |
| C# | [ExcludeFromCodeCoverage] | The annotated class, struct, method, property, getter, setter, or event, including all its members |
| C, C++, C++/CLI | LCOV_EXCL_LINE, GCOV_EXCL_LINE, GCOVR_EXCL_LINE | The line containing the marker |
| C, C++, C++/CLI | LCOV_EXCL_START … LCOV_EXCL_STOP (also GCOV_, GCOVR_) | The lines from the start marker up to, but excluding, the stop marker |
| C, C++, C++/CLI | #pragma ctc skip … #pragma ctc endskip | The enclosed code |
| C, C++, C++/CLI | "CTC SKIP" … "CTC ENDSKIP" (string literals) | The enclosed code |
| C, C++, C++/CLI | LCOV_EXCL_BR_LINE, LCOV_EXCL_BR_START … LCOV_EXCL_BR_STOP (also GCOV_, GCOVR_) | The same regions as the LCOV markers above, but only from branch coverage; line coverage is unaffected |
| JavaScript, TypeScript | /* istanbul ignore next */ | The next statement or block |
| JavaScript, TypeScript | /* c8 ignore next 3 */ | The given number of lines following the comment |
| JavaScript, TypeScript | /* istanbul ignore if */ | The body of the next if statement |
| JavaScript, TypeScript | /* istanbul ignore else */ | All else if and else branches of the next if statement |
| JavaScript, TypeScript | /* istanbul ignore file */ | The whole file |
| JavaScript, TypeScript | /* istanbul ignore start */ … /* istanbul ignore stop */ | The lines from the start marker up to, but excluding, the stop marker |
| JavaScript, TypeScript | /* node:coverage disable */ … /* node:coverage enable */ | The same as ignore start and ignore stop |
Teamscale's own marker has to be alone on its source line, with no code before or after it, and it has to be the only content of its comment, so that a comment that merely mentions the marker does not exclude the method below it. The comment carrying the marker has to start on a line of its own as well, because Teamscale looks for the excluded method starting from that first line, and code on it takes the marker's place. It is recognized in every comment syntax, so // teamscale:coverage ignore method, # teamscale:coverage ignore method and a block comment all work. Annotations, attributes, and decorators may sit between the comment and the method. It applies to methods only and has no effect in front of a class or a field, so a whole class has to be excluded method by method.
In JavaScript and TypeScript, the prefix istanbul is interchangeable with c8, v8, and node:coverage, with one exception. ignore file, ignore start, and ignore stop do not accept the node:coverage prefix; use node:coverage disable and node:coverage enable instead.
The C and C++ markers are matched anywhere in the file, including in identifiers and string literals, because the LCOV and GCOV documentation does not restrict them to comments. The JavaScript and TypeScript markers are only recognized inside comments.
All markers are case-insensitive, except for the "CTC SKIP" and "CTC ENDSKIP" string literals, which must be written in upper case. Start and stop markers may be nested; a region ends only at the stop marker that closes the outermost start marker. A start marker without a matching stop marker excludes the rest of the file.
