cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Unit Code Coverage error: Program is not relevant for coverage measurements

Former Member

Hi,

we have the following scenario:

  • Global test class (superclass, abstract) CL_A in package T
  • local test class LCL_A in CL_A inheriting from CL_A
  • Global class CL_T in package X (this is the class we want to test in CL_A)


The problem here is, that the code coverage of CL_T somehow cannot be shown via executing unit tests with coverage on CL_A. When I do this and click on the tab "Coverage Metrics" an empty tab is shown with an error message "Program CL_A====CP" is not relevant for coverage measurements".

Observation we did so far: When executing the unit tests for our top level package, the coverage tab provides results and one can show the coverage of CL_T via browsing to the package of CL_T. But this way is very time consuming if I only want to check the coverage of the single class.

Somebody has an idea how to solve the problem?

Thanks and regards

Stefan

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

That error message is caused by definition, see class CL_SCV_MD_GENERATOR method check_program_valid.

There it uses an instance of CL_SCV_SOURCE_CODE_UTILS for source_utils and the method is_relevant_program thereof.

In that method it is tested if tha program is among others a global test class and if so it is not relevant and exceptions are raised ending up in that error message.

If you change that class definition, i.e. remove FOR TESTING, it will pass that hurdle and show the coverage ( for that class that is... )