Changeset 8318 for trunk

Show
Ignore:
Timestamp:
21/12/11 11:17:43 (5 months ago)
Author:
westram
Message:
  • repaired compile-tests for delivered perl-macros and -scripts
    • was broken by [6318]
    • now tests whether Lint/LintSubs is installed
      • if not installed -> accept failure
      • if installed -> fail compilation if scripts do not compile
    • test whether Bioperl is installed
      • if not installed -> accept failure on scripts in BIOPERL folder
      • if installed -> fail compilation if scripts there do not compile
Location:
trunk
Files:
3 added
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/Makefile

    r8297 r8318  
    15761576                        "cross_lflags=$(cross_lflags)" \ 
    15771577                        all && \ 
     1578                $(MAKE) -C PERL_SCRIPTS/test test && \ 
    15781579                echo "$(SEP) Make PERL2ARB [done]" ; \ 
    15791580        ) > PERL2ARB.log 2>&1 && (cat PERL2ARB.log;rm PERL2ARB.log)) || (cat PERL2ARB.log;rm PERL2ARB.log;false) 
    1580  
    1581  
    1582 testperlscripts: perl  
    1583         @$(MAKE) -C PERL_SCRIPTS/test test 
    15841581 
    15851582perl_clean: 
  • trunk/PERL_SCRIPTS/test/Makefile

    r6113 r8318  
    1919        @echo $(SEP) Testing scripts in PERL_SCRIPTS 
    2020        @perl -c testScripts.pl 
    21         @perl testScripts.pl || echo "You either lack S::LintSubs and/or Bio::TreeIO or the perl scripts are buggy. We continue anyway.." 
     21        @perl testScripts.pl 
    2222        @touch $@ 
    2323 
  • trunk/PERL_SCRIPTS/test/testScripts.pl

    r5888 r8318  
    9999} 
    100100 
     101my %failed_test = (); # scripts in this directory (key=failed script,value=1) 
     102my $failed_bioperl = 0; # script in BIOPERL directory 
     103my $failed_normal  = 0; # other scripts 
     104 
     105sub announce_failure($) { 
     106  my ($script) = @_; 
     107  if ($script =~ /\/PERL_SCRIPTS\/test\//) { 
     108    $failed_test{$'} = 1; 
     109  } 
     110  elsif ($script =~ /\/PERL_SCRIPTS\/BIOPERL\//) { $failed_bioperl++; } 
     111  else { $failed_normal++; } 
     112} 
     113 
    101114sub main() { 
    102115  $arbhome = $ENV{ARBHOME}; 
     
    116129  # foreach (@scripts) { print "- '$_'\n"; } 
    117130 
    118   my $failed = 0; 
    119   foreach (@modules) { if (test_script($_,1)==0) { $failed++; } } 
    120   foreach (@scripts) { if (test_script($_,0)==0) { $failed++; } } 
     131  foreach (@modules) { if (test_script($_,1)==0) { announce_failure($_); } } 
     132  foreach (@scripts) { if (test_script($_,0)==0) { announce_failure($_); } } 
    121133 
    122   if ($failed>0) { 
    123     die "$failed perl scripts failed to compile\n"; 
     134  $| = 1; 
     135 
     136  if (defined $failed_test{'check_lint.pl'}) { 
     137    print "Assuming Lint/LintSubs is not installed (cannot test whether perl modules compile)\n"; 
     138  } 
     139  else { 
     140    my $failed = $failed_normal+$failed_bioperl; 
     141 
     142    if (defined $failed_test{'check_arb.pl'}) { 
     143      die "Fatal error: Failed to load ARB perl module\n"; 
     144    } 
     145    if (defined $failed_test{'check_bioperl.pl'}) { 
     146      print "Assuming BIOPERL is not installed\n"; 
     147      if ($failed_bioperl==0) { 
     148        die "but all BIOPERL scripts compiled - sth is completely wrong here\n"; 
     149      } 
     150      print "accepting $failed_bioperl failing scripts that use BIOPERL\n"; 
     151      $failed -= $failed_bioperl; 
     152    } 
     153    else { 
     154      print "Assuming BIOPERL is installed\n"; 
     155    } 
     156 
     157    if ($failed>0) { 
     158      die "$failed scripts failed to compile\n"; 
     159    } 
    124160  } 
    125161}