minor changes to the testing infrastructure
This commit is contained in:
parent
941de722da
commit
5b93dd4b53
|
@ -77,6 +77,7 @@ sub _confargs {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub confreset {
|
sub confreset {
|
||||||
|
chdir("../gitolite-admin") or die "in `pwd`, could not cd ../g-a";
|
||||||
system( "rm", "-rf", "conf" );
|
system( "rm", "-rf", "conf" );
|
||||||
mkdir("conf");
|
mkdir("conf");
|
||||||
system("mv ~/repositories/gitolite-admin.git ~/repositories/.ga");
|
system("mv ~/repositories/gitolite-admin.git ~/repositories/.ga");
|
||||||
|
@ -93,6 +94,7 @@ sub confreset {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub confadd {
|
sub confadd {
|
||||||
|
chdir("../gitolite-admin") or die "in `pwd`, could not cd ../g-a";
|
||||||
my ( $file, $string ) = _confargs(@_);
|
my ( $file, $string ) = _confargs(@_);
|
||||||
put "|cat >> conf/$file", $string;
|
put "|cat >> conf/$file", $string;
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ my $cmd; # the current command
|
||||||
|
|
||||||
my $testnum; # current test number, for info in TAP output
|
my $testnum; # current test number, for info in TAP output
|
||||||
my $testname; # current test name, for error info to user
|
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 $err_count; # count of test failures
|
||||||
my @errors_in; # list of testnames that errored
|
my @errors_in; # list of testnames that errored
|
||||||
|
@ -115,7 +115,7 @@ sub tsh {
|
||||||
# (later) handles single commands
|
# (later) handles single commands
|
||||||
|
|
||||||
sub try {
|
sub try {
|
||||||
$rc = $err_count = 0;
|
$line = $rc = $err_count = 0;
|
||||||
@errors_in = ();
|
@errors_in = ();
|
||||||
|
|
||||||
# break up multiline arguments into separate lines
|
# break up multiline arguments into separate lines
|
||||||
|
@ -238,11 +238,13 @@ sub rc_lines {
|
||||||
my $_ = shift @lines;
|
my $_ = shift @lines;
|
||||||
chomp; $_ = trim_ws($_);
|
chomp; $_ = trim_ws($_);
|
||||||
|
|
||||||
|
$line++;
|
||||||
|
|
||||||
# this also sets $testname
|
# this also sets $testname
|
||||||
next if is_comment_or_empty($_);
|
next if is_comment_or_empty($_);
|
||||||
|
|
||||||
dbg( 2, "L: $_" );
|
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
|
# a DEF has to be on a line by itself
|
||||||
if (/^DEF\s+([-.\w]+)\s*=\s*(\S.*)$/) {
|
if (/^DEF\s+([-.\w]+)\s*=\s*(\S.*)$/) {
|
||||||
|
|
14
t/z-end.t
Executable file
14
t/z-end.t
Executable file
|
@ -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();
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue