Ignore:
Timestamp:
01/24/12 05:38:16 (4 months ago)
Author:
PaulHarvey
Message:

Item11466: unit test showing broken TestRunner

Conflicts:

lib/Foswiki/Contrib/UnitTestContrib/MANIFEST

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UnitTestContrib/test/bin/TestRunner.pl

    r13606 r13802  
    11#!/usr/bin/perl -w 
    22# See bottom of file for description 
     3use strict; 
     4use warnings; 
     5require 5.006; 
    36 
    4 require 5.006; 
    57use FindBin; 
    68use Cwd (); 
     
    2123 
    2224BEGIN { 
     25    if ( not defined $ENV{FOSWIKI_ASSERTS} or $ENV{FOSWIKI_ASSERTS} eq 'soft' ) { 
     26        print 
     27    "exporting FOSWIKI_ASSERTS=1 for extra checking; disable by exporting FOSWIKI_ASSERTS=0\n"; 
     28        $ENV{FOSWIKI_ASSERTS} = 1; 
     29    } 
     30 
    2331    $Foswiki::cfg{Engine} = 'Foswiki::Engine::CGI'; 
    2432 
     
    4755} 
    4856 
    49 use strict; 
    50 use Foswiki;   # If you take this out then TestRunner.pl will fail on IndigoPerl 
     57# Item11466: PH commented the below & added require statements where necessary, 
     58# to avoid compiling Foswiki.pm before FOSWIKI_ASSERTS have been set 
     59#use Foswiki;   # If you take this out then TestRunner.pl will fail on IndigoPerl 
    5160use Unit::TestRunner; 
    5261 
     
    7988print STDERR "Options: ", join( ' ', keys %options ), "\n"; 
    8089 
    81 if ( not defined $ENV{FOSWIKI_ASSERTS} or $ENV{FOSWIKI_ASSERTS} eq 'soft' ) { 
    82     print 
    83 "exporting FOSWIKI_ASSERTS=1 for extra checking; disable by exporting FOSWIKI_ASSERTS=0\n"; 
    84     $ENV{FOSWIKI_ASSERTS} = 1; 
    85 } 
    86  
    8790if ( $ENV{FOSWIKI_ASSERTS} ) { 
    8891    print "Assert checking on $ENV{FOSWIKI_ASSERTS}\n"; 
     
    9497if ( $options{-clean} ) { 
    9598    require File::Path; 
     99    require Foswiki; 
    96100    my $rmDir = $Foswiki::cfg{DataDir}; 
    97101    opendir( my $dataDir, $rmDir ) or die "Can't open directory $rmDir: $!"; 
     
    114118 
    115119if ( not $options{-worker} ) { 
     120    require Foswiki; 
    116121    testForFiles( $Foswiki::cfg{DataDir}, '/Temp*' ); 
    117122    testForFiles( $Foswiki::cfg{PubDir},  '/Temp*' ); 
Note: See TracChangeset for help on using the changeset viewer.