Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Devel::Cover for myfile.pl with different command-line input arguments

by tito80 (Novice)
on Aug 23, 2016 at 00:06 UTC ( [id://1170199]=note: print w/replies, xml ) Need Help??


in reply to Re: Devel::Cover for myfile.pl with different command-line input arguments
in thread Devel::Cover for myfile.pl with different command-line input arguments

Mr. Muskrat, thanks. This definitely helped.

But I am not very sure on the coverage by Devel::Cover itself. I have legacy code. For e.g., we use a certain Perl custom-developed package which is basically a wrapper around Perl GetOpt. When I pass an option arg1 = "abc" 1st time, and then arg1="xyz" the 2nd time, and I have code like: if ($run eq "abc") {do_this} else {do_that}.

I expected devel_cover to show me the if-loop covered 1st time. Else-loop uncovered. While vice versa in the 2nd run.

It did not. I hope I am not missing anything.

Replies are listed 'Best First'.
Re^3: Devel::Cover for myfile.pl with different command-line input arguments
by Mr. Muskrat (Canon) on Aug 24, 2016 at 14:03 UTC

    If you test coverage with the first condition and then generate a report it should show the if was covered. If you test coverage with the second condition and then generate a report it should show that the else was covered. If you test coverage of both conditions and then generate the report (as I described in my previous reply) then it should show both the if and the else have been covered.

      Thanks. This helped.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1170199]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-03-29 09:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found