Skip to Content
Jan 04, 2011 at 02:24 PM

ABAP Unit - measuring code coverage for global class with local test class



Did anyone of you succeed in measuring code coverage for ABAP Unit tests created as local test classes for a global class?

It works fine when it create unit tests as local classes in reports but in SE24 I always get empty results.

My scenario is:

1. Create Global class ZCL1, add method A

2. Create local test class in ZCL1 add add a test case which examines ZCL1-A

3. In ABAP unit browser execute UT with measuring coverage

Result: coverage for ZCL1-A always shows as 0 (zero). I can see results from some system classes but not from ZCL1.

So in general measurement works but somehow omits ZCL1.

Some interesting observations:

- when I display details of coverage for ZCL1-A lines are marked with blue color. Normally they apear as grean if line was hit and red when lines was not ht

- if I create another global class ZCL2 with method B and examine it from local test class of ZCL1 then coverage results show hits for ZCL2-B but ZCL1-A has 0 hits.

- creating local test class in ZCL2 and examining ZCL2-B also doesn't bring any results

Looks like there is some issue with coverage for the class when runing it from own local test class.

Am I missing something or it's a bug?

I couldn't find any relevant notes.