You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl-cvs@perl.apache.org by ri...@apache.org on 2010/03/13 13:19:50 UTC
svn commit: r922544 - /perl/embperl/trunk/test.pl
Author: richter
Date: Sat Mar 13 12:19:49 2010
New Revision: 922544
URL: http://svn.apache.org/viewvc?rev=922544&view=rev
Log:
Verbose Compare Option for test script
Modified:
perl/embperl/trunk/test.pl
Modified: perl/embperl/trunk/test.pl
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/test.pl?rev=922544&r1=922543&r2=922544&view=diff
==============================================================================
--- perl/embperl/trunk/test.pl (original)
+++ perl/embperl/trunk/test.pl Sat Mar 13 12:19:49 2010
@@ -1122,7 +1122,7 @@ use vars qw ($httpconfsrc $httpconf $EPP
$opt_multchild $opt_memcheck $opt_exitonmem $opt_exitonsv $opt_config $opt_nostart $opt_uniquefn
$opt_quite $opt_qq $opt_ignoreerror $opt_tests $opt_blib $opt_help $opt_dbgbreak $opt_finderr
$opt_ddd $opt_gdb $opt_ab $opt_abpre $opt_abverbose $opt_start $opt_startinter $opt_kill $opt_showcookie $opt_cache
- $opt_cfgdebug) ;
+ $opt_cfgdebug $opt_verbosecmp) ;
{
local $^W = 0 ;
@@ -1222,7 +1222,7 @@ $ret = GetOptions ("offline|o", "ep1|1",
"multchild|m", "memcheck|v", "exitonmem|g", "exitonsv", "config|f=s", "nostart|x", "uniquefn|u",
"quite|q", "qq", "ignoreerror|i", "tests|t", "blib|b", "help", "dbgbreak", "finderr",
"ddd", "gdb", "ab:s", "abverbose", "abpre", "start", "startinter", "kill", "showcookie",
- "cfgdebug") ;
+ "cfgdebug", "verbosecmp|V") ;
$opt_help = 1 if ($ret == 0) ;
@@ -1287,6 +1287,7 @@ if ($opt_help)
print "-q set debug to 0\n" ;
print "-i ignore errors\n" ;
print "-t list tests\n" ;
+ print "-V verbose compare, show diff\n" ;
# print "-b use uninstalled version (from blib/..)\n" ;
print "--ddd start apache under ddd\n" ;
print "--gdb start apache under gdb\n" ;
@@ -1420,6 +1421,7 @@ sub CmpFiles
{
my ($f1, $f2, $errin) = @_ ;
my $line = 0 ;
+ my $line2 = 0 ;
my $err = 0 ;
local $^W = 0 ;
@@ -1435,10 +1437,12 @@ sub CmpFiles
{
$line++ ;
chompcr ($l1) ;
+ printf ("<<<#%3d: %s\n", $line, $l1) if ($opt_verbosecmp) ;
while (($l1 =~ /^\s*$/) && defined ($l1 = <F1>))
{
$line++ ;
chompcr ($l1) ;
+ printf ("<<<#%3d: %s\n", $line, $l1) if ($opt_verbosecmp) ;
}
@@ -1446,8 +1450,14 @@ sub CmpFiles
{
$l2 = <F2> ;
chompcr ($l2) ;
+ $line2++ ;
+ printf ("-->#%3d: %s\n", $line2, $l2) if ($opt_verbosecmp) ;
while (($l2 =~ /^\s*$/) && defined ($l2 = <F2>))
- { chompcr ($l2) ; }
+ {
+ chompcr ($l2) ;
+ $line2++ ;
+ printf ("-->#%3d: %s\n", $line2, $l2) if ($opt_verbosecmp) ;
+ }
}
last if (!defined ($l2) && !defined ($l1)) ;
@@ -1472,6 +1482,8 @@ sub CmpFiles
}
$l2 = <F2> if (!$eq) ;
chompcr ($l2) ;
+ $line2++ ;
+ printf ("-->#%3d: %s\n", $line2, $l2) if ($opt_verbosecmp) ;
}
if (!$eq)
@@ -1504,6 +1516,8 @@ sub CmpFiles
while (defined ($l2 = <F2>))
{
chompcr ($l2) ;
+ $line2++ ;
+ printf ("-->#%3d: %s\n", $line2, $l2) if ($opt_verbosecmp) ;
if (!($l2 =~ /^\s*$/))
{
print "\nError in Line $line\nIs:\t\nShould:\t$l2\n" ;
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-cvs-help@perl.apache.org