diff --git a/src/Gitolite/Test.pm b/src/Gitolite/Test.pm index 331c886..52b3445 100644 --- a/src/Gitolite/Test.pm +++ b/src/Gitolite/Test.pm @@ -77,6 +77,7 @@ sub _confargs { } sub confreset { + chdir("../gitolite-admin") or die "in `pwd`, could not cd ../g-a"; system( "rm", "-rf", "conf" ); mkdir("conf"); system("mv ~/repositories/gitolite-admin.git ~/repositories/.ga"); @@ -93,6 +94,7 @@ sub confreset { } sub confadd { + chdir("../gitolite-admin") or die "in `pwd`, could not cd ../g-a"; my ( $file, $string ) = _confargs(@_); put "|cat >> conf/$file", $string; } diff --git a/src/Gitolite/Test/Tsh.pm b/src/Gitolite/Test/Tsh.pm index 1a1711f..3281a34 100644 --- a/src/Gitolite/Test/Tsh.pm +++ b/src/Gitolite/Test/Tsh.pm @@ -53,7 +53,7 @@ my $cmd; # the current command my $testnum; # current test number, for info in TAP output my $testname; # current test name, for error info to user -my $line; # current line number +my $line; # current line number and text my $err_count; # count of test failures my @errors_in; # list of testnames that errored @@ -115,7 +115,7 @@ sub tsh { # (later) handles single commands sub try { - $rc = $err_count = 0; + $line = $rc = $err_count = 0; @errors_in = (); # break up multiline arguments into separate lines @@ -238,11 +238,13 @@ sub rc_lines { my $_ = shift @lines; chomp; $_ = trim_ws($_); + $line++; + # this also sets $testname next if is_comment_or_empty($_); dbg( 2, "L: $_" ); - $line = $_; # save line for printing with 'FAIL:' + $line .= ": $_"; # save line for printing with 'FAIL:' # a DEF has to be on a line by itself if (/^DEF\s+([-.\w]+)\s*=\s*(\S.*)$/) { diff --git a/t/z-end.t b/t/z-end.t new file mode 100755 index 0000000..25edbd9 --- /dev/null +++ b/t/z-end.t @@ -0,0 +1,14 @@ +#!/usr/bin/perl +use strict; +use warnings; + +# this is hardcoded; change it if needed +use lib "src"; +use Gitolite::Test; + +try "plan 1; cd $ENV{PWD}; git status -s -uno; !/./ or die" or die "dirty tree"; +try "git log -1 --format='%h %ai %s'"; +put "|cat >> prove.log", text(); + + +