Ask a Question

Ignore unreachable code in code coverage reports

Ignore unreachable code in code coverage reports

We are using the "Light Coverage Profiler" with "collect info about lines: on" for creating coverage reports of our unit tests.


Let's say, you have C++ code like this:

__declspec(noreturn) void throw_bad_cast();

__declspec(noreturn) void throw_bad_cast()
  throw bad_any_cast{};

And let's assume that the function is hit when the main program is executed.
However, AQtime will mark the last line of the function "throw_bad_cast" as "not covered" (the line with the closing brace).
The (invisible) return statement of the function will never be reached, so the resulting report gives the impression that the code coverage is incomplete.

Thus, it would be nice if unreachable code like this would be ignored in the coverage results so that the function is marked with "coverage 100%".

1 Comment
New Contributor

something relevant to [[noreturn]]?

Welcome to the AQTime Feature Requests board!

Here you can review submitted feature requests and vote up the ones you like! If you can't find the feature you want - go ahead and suggest your own idea. Ideas with the highest rating can be implemented in the product.

Check out the Create a Feature Request guide for more information.
New Here?
Welcome to the Community
Sign Up Here