lundi 22 août 2016

Perl Devel::Cover to test (cover) my_file.pl with different command line input arguments

I am a newbie and pardon my ignorance. I am trying to use Devel::Cover (DC) to get an idea of the code coverage of my my_file.pl Perf file ran with arg1, arg2 as command-line input arguments. I am using Perl 5.8.9 with DC 1.23. The steps I executed successfully to generate the html file are:

1) `perl -MDevel::Cover my_file.pl -arg1 arg1_value -arg2 arg2_value`

2) `Devel-Cover-1.23/bin/cover cover_db --report=html`

Now, I do not have packages/modules to test directly. But I have the my_file.pl file which invokes several packages.

And I need to test my_file.pl with several different combinations of command line i/p arguments (i.e. arg1_different_value, arg2_different_value, etc.). All these test combinations are a part of my regression suite (you can think of the options written in a test.txt file sequentially) and I am trying to see if Devel::Cover can assure that I have 100% code coverage with these tests.

While I can run the above in a for-loop, each time with different arguments, I am not sure if that is the best way since I will end up with 100's of html/report files that need to be merged for any meaningful purpose.

Could you kindly provide some pointers?

Thanks, Tito

Aucun commentaire:

Enregistrer un commentaire