Add a test header and log it to help find which tests cause problems.

This commit is contained in:
Andrew McMillan 2010-03-18 19:59:19 +13:00
parent 58356fb3e3
commit 1296bded43
3 changed files with 10 additions and 2 deletions

View File

@ -121,7 +121,10 @@ if ( isset($c->deny_put_collection) ) {
if ( !isset($c->page_title) ) $c->page_title = $c->system_name;
if ( count($c->dbg) > 0 ) {
if ( isset($_SERVER['HTTP_X_DAVICAL_TESTCASE']) ) {
@dbg_error_log( 'LOG', '==========> Test case =%s=', $_SERVER['HTTP_X_DAVICAL_TESTCASE'] );
}
else if ( count($c->dbg) > 0 ) {
// Only log this if debugging of some sort is turned on, somewhere
@dbg_error_log( 'LOG', '==========> method =%s= =%s= =%s= =%s= =%s=',
$_SERVER['REQUEST_METHOD'], $c->protocol_server_port_script, $_SERVER['PATH_INFO'], $c->base_url, $c->base_directory );

View File

@ -121,7 +121,10 @@ if ( isset($c->deny_put_collection) ) {
if ( !isset($c->page_title) ) $c->page_title = $c->system_name;
if ( count($c->dbg) > 0 ) {
if ( isset($_SERVER['HTTP_X_DAVICAL_TESTCASE']) ) {
@dbg_error_log( 'LOG', '==========> Test case =%s=', $_SERVER['HTTP_X_DAVICAL_TESTCASE'] );
}
else if ( count($c->dbg) > 0 ) {
// Only log this if debugging of some sort is turned on, somewhere
@dbg_error_log( 'LOG', '==========> method =%s= =%s= =%s= =%s= =%s=',
$_SERVER['REQUEST_METHOD'], $c->protocol_server_port_script, $_SERVER['PATH_INFO'], $c->base_url, $c->base_directory );

View File

@ -55,6 +55,7 @@ if ( !defined($testdef) ) {
my $datafile = $testdef;
$datafile =~ s{\.test$}{};
push @arguments, "--header", 'X-DAViCal-Testcase: '.$datafile;
$datafile .= '.data';
my $state = "";
@ -66,6 +67,7 @@ my $sql_values = {};
my $queries = ();
my $replacements = ();
open( TEST, '<', $testdef ) or die "Can't open '$testdef'";
while( <TEST> ) {
my $line = $_;