Hi,

I've few perl scripts called from C++ programs. I wanted to do code coverage
for
those scripts and i am using Devel::Cover module. Since the existing C++ 
programs are huge and takes lot of time to compile, I don't want to change 
the existing C++ code to build those scripts with coverage. For example, i 
don't want the following changes to be done inside a C++ program.

perl -MDevel::Cover <script name with arguments>

Is it possible to change the perl script itself in such a way that it can
give
code coverage metrics along with normal execution. I tried to include 
Devel::Cover module inside the perl script (use Devel::Cover) and executed. 
It didn't give any metrics and just printed 'n/a' against all the 
coverages (statement, branch, sub, cond, time, total). 

How to handle this scenario?

One more thing to add. if it is possible to do it inside the perl script
then 
Is it possible to read some ENV variable and decide on whether to include 
coverage or not. I am just trying to add some flexibility so that 
i don't get the coverage everytime it is executed and i only want it when i
am 
running the unit test cases of C++ programs. 


TIA.

Regards,
Guru.
  • Using Devel::Cove... Padubidri Nagaraja Rao, Guruprasad (Guruprasad)** CTR **

Reply via email to