just for fun, here is my contribution of a write version using format, possibly hinted by BillKSmith
the sprintf was a bit of a pain, but you get the idea... haha
#!/usr/local/bin/perl
use strict;
use warnings;
chomp ( my $first = <DATA> );
my @header = split /\s+/, $first;
my $body = "";
$body .= sprintf "| %-50s | %10s | %4s %-11s| %4s %-11s| %4s %-11s|\n"
+, split /\s+/, $_
while <DATA>;
format STDOUT =
@||||||||||||||||||||||||||||||||||||||||||||||||||||||||@||||||||||@
+|||||||||||||||||@|||||||||||||||||@|||||||||||||||||
@header
------------------------------------------------------------------
+-------------------------------------------------------
^*
$body
~~ ^*
$body
------------------------------------------------------------------
+-------------------------------------------------------
.
write STDOUT;
__DATA__
Package Coverage Line Method Branch
com.gandu.base.alltests 90% 91% (20/22) 50% (1/2) 0
+% (0/0)
com.gandu.base.commons 47% 43% (579/1336) 34% (73/213) 4
+1% (111/270)
com.gandu.base.commons.status 27% 27% (103/388) 46% (25/5
+4) 8% (5/60)
com.gandu.base.commons.test 94% 84% (62/74) 85% (11/13) 1
+00% (6/6)
com.gandu.base.commons.validchecker 90% 90% (9/10) 50%
+ (1/2) 0% (0/0)
com.gandu.base.commons.validchecker.arghandler 12% 8% (115/140
+4) 8% (8/99) 0% (0/350)
com.gandu.base.commons.validchecker.centralarea 26% 37% (111/29
+7) 65% (17/26) 56% (47/84)
com.gandu.base.commons.validchecker.testtag 85% 82% (613/74
+8) 82% (93/114) 53% (90/170)
com.gandu.base.consoleindependentcommons 91% 91% (79/87) 8
+2% (14/17) 90% (18/20)
com.gandu.base.disk 80% 79% (70/89) 76% (16/21) 75% (27/3
+6)
com.gandu.base.disk.test 2% 3% (3/98) 7% (1/14) 0
+% (0/0)
com.gandu.base.flow 39% 37% (479/1281) 41% (131/321) 6% (21/33
+6)
com.gandu.base.flow.parser 31% 34% (468/1363) 34% (48/141) 1
+5% (51/348)
com.gandu.base.helpcontent 0% 0% (0/6) 0% (0/4) 0
+% (0/0)
com.gandu.base.datafeeder 0% 0% (0/144) 0% (0/23)
+ 0% (0/66)
com.gandu.base.datafeeder.test 3% 4% (3/82) 8% (1/12)
+ 0% (0/20)
com.gandu.base.preferencefiles 62% 55% (505/915) 52% (15/2
+9) 21% (42/204)
com.gandu.base.preferences 50% 43% (1139/2620) 28% (138/500) 6
+% (38/688)
com.gandu.base.report 19% 22% (439/1954) 61% (46/76) 4
+7% (105/224)
com.gandu.base.report.emailreport 91% 88% (244/278) 93% (26/2
+8) 67% (28/42)
com.gandu.base.report.test 86% 86% (6/7) 50% (1/2) 0
+% (0/0)
com.gandu.base.managerexec 28% 26% (1101/4209) 43% (90/208) 34
+% (200/593)
com.gandu.base.managerexec.runmanager 18% 18% (344/1913) 23
+% (46/200) 19% (122/638)
com.gandu.base.managerexec.rununitexecutor 15% 18% (907/5149) 40
+% (115/291) 6% (61/1062)
com.gandu.base.testmanager 95% 89% (117/131) 78% (21/27) 8
+2% (28/34)
com.gandu.base.testmanager.housekeeping 72% 69% (1044/1513) 6
+8% (116/171) 50% (130/260)
com.gandu.base.util 10% 11% (48/450) 13% (11/82) 12% (13/1
+07)
com.gandu.base.util.test 81% 80% (4/5) 50% (1/2) 0
+% (0/0)
__output__
Package Coverage
+ Line Method Branch
------------------------------------------------------------------
+-------------------------------------------------------
| com.gandu.base.alltests | 90%
+| 91% (20/22) | 50% (1/2) | 0% (0/0) |
| com.gandu.base.commons | 47%
+| 43% (579/1336) | 34% (73/213) | 41% (111/270) |
| com.gandu.base.commons.status | 27%
+| 27% (103/388) | 46% (25/54) | 8% (5/60) |
| com.gandu.base.commons.test | 94%
+| 84% (62/74) | 85% (11/13) | 100% (6/6) |
| com.gandu.base.commons.validchecker | 90%
+| 90% (9/10) | 50% (1/2) | 0% (0/0) |
| com.gandu.base.commons.validchecker.arghandler | 12%
+| 8% (115/1404) | 8% (8/99) | 0% (0/350) |
| com.gandu.base.commons.validchecker.centralarea | 26%
+| 37% (111/297) | 65% (17/26) | 56% (47/84) |
| com.gandu.base.commons.validchecker.testtag | 85%
+| 82% (613/748) | 82% (93/114) | 53% (90/170) |
| com.gandu.base.consoleindependentcommons | 91%
+| 91% (79/87) | 82% (14/17) | 90% (18/20) |
| com.gandu.base.disk | 80%
+| 79% (70/89) | 76% (16/21) | 75% (27/36) |
| com.gandu.base.disk.test | 2%
+| 3% (3/98) | 7% (1/14) | 0% (0/0) |
| com.gandu.base.flow | 39%
+| 37% (479/1281) | 41% (131/321) | 6% (21/336) |
| com.gandu.base.flow.parser | 31%
+| 34% (468/1363) | 34% (48/141) | 15% (51/348) |
| com.gandu.base.helpcontent | 0%
+| 0% (0/6) | 0% (0/4) | 0% (0/0) |
| com.gandu.base.datafeeder | 0%
+| 0% (0/144) | 0% (0/23) | 0% (0/66) |
| com.gandu.base.datafeeder.test | 3%
+| 4% (3/82) | 8% (1/12) | 0% (0/20) |
| com.gandu.base.preferencefiles | 62%
+| 55% (505/915) | 52% (15/29) | 21% (42/204) |
| com.gandu.base.preferences | 50%
+| 43% (1139/2620)| 28% (138/500) | 6% (38/688) |
| com.gandu.base.report | 19%
+| 22% (439/1954) | 61% (46/76) | 47% (105/224) |
| com.gandu.base.report.emailreport | 91%
+| 88% (244/278) | 93% (26/28) | 67% (28/42) |
| com.gandu.base.report.test | 86%
+| 86% (6/7) | 50% (1/2) | 0% (0/0) |
| com.gandu.base.managerexec | 28%
+| 26% (1101/4209)| 43% (90/208) | 34% (200/593) |
| com.gandu.base.managerexec.runmanager | 18%
+| 18% (344/1913) | 23% (46/200) | 19% (122/638) |
| com.gandu.base.managerexec.rununitexecutor | 15%
+| 18% (907/5149) | 40% (115/291) | 6% (61/1062) |
| com.gandu.base.testmanager | 95%
+| 89% (117/131) | 78% (21/27) | 82% (28/34) |
| com.gandu.base.testmanager.housekeeping | 72%
+| 69% (1044/1513)| 68% (116/171) | 50% (130/260) |
| com.gandu.base.util | 10%
+| 11% (48/450) | 13% (11/82) | 12% (13/107) |
| com.gandu.base.util.test | 81%
+| 80% (4/5) | 50% (1/2) | 0% (0/0) |
------------------------------------------------------------------
+-------------------------------------------------------
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|