Development

Changeset 4115

You must first sign up to be able to contribute.

Changeset 4115

Show
Ignore:
Timestamp:
05/29/07 08:55:26 (1 year ago)
Author:
fabien
Message:

lime: fixed lime_harness incompatible with PHP 5.2.2 (closes #1744, patch from l2k)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tools/lime/trunk/lib/lime.php

    r4112 r4115  
    466466        if ($delta > 0) 
    467467        { 
    468           $this->output->echoln(sprintf('%s%s%s', substr($relative_file, -67), str_repeat('.', 70 - min(67, strlen($relative_file))), $this->output->colorizer->colorize(sprintf('# Looks like you planned %d tests but only ran %d.', $this->stats[$file]['plan'], $this->stats[$file]['nb_tests']), 'COMMENT'))); 
     468          $this->output->echoln(sprintf('%s%s%s', substr($relative_file, -min(67, strlen($relative_file))), str_repeat('.', 70 - min(67, strlen($relative_file))), $this->output->colorizer->colorize(sprintf('# Looks like you planned %d tests but only ran %d.', $this->stats[$file]['plan'], $this->stats[$file]['nb_tests']), 'COMMENT'))); 
    469469          $this->stats[$file]['status'] = 'dubious'; 
    470470          $this->stats[$file]['status_code'] = 255; 
     
    477477        else if ($delta < 0) 
    478478        { 
    479           $this->output->echoln(sprintf('%s%s%s', substr($relative_file, -67), str_repeat('.', 70 - min(67, strlen($relative_file))), $this->output->colorizer->colorize(sprintf('# Looks like you planned %s test but ran %s extra.', $this->stats[$file]['plan'], $this->stats[$file]['nb_tests'] - $this->stats[$file]['plan']), 'COMMENT'))); 
     479          $this->output->echoln(sprintf('%s%s%s', substr($relative_file, -min(67, strlen($relative_file))), str_repeat('.', 70 - min(67, strlen($relative_file))), $this->output->colorizer->colorize(sprintf('# Looks like you planned %s test but ran %s extra.', $this->stats[$file]['plan'], $this->stats[$file]['nb_tests'] - $this->stats[$file]['plan']), 'COMMENT'))); 
    480480          $this->stats[$file]['status'] = 'dubious'; 
    481481          $this->stats[$file]['status_code'] = 255; 
     
    492492      } 
    493493 
    494       $this->output->echoln(sprintf('%s%s%s', substr($relative_file, -67), str_repeat('.', 70 - min(67, strlen($relative_file))), $this->stats[$file]['status'])); 
     494      $this->output->echoln(sprintf('%s%s%s', substr($relative_file, -min(67, strlen($relative_file))), str_repeat('.', 70 - min(67, strlen($relative_file))), $this->stats[$file]['status'])); 
    495495      if (($nb = count($this->stats[$file]['failed'])) || $return > 0) 
    496496      { 
     
    518518        if (!in_array($file, $this->stats['_failed_files'])) continue; 
    519519 
    520         $this->output->echoln(sprintf($format, substr($this->get_relative_file($file), -30), $file_stat['status_code'], count($file_stat['failed']) + count($file_stat['passed']), count($file_stat['failed']), implode(' ', $file_stat['failed']))); 
     520        $relative_file = $this->get_relative_file($file); 
     521        $this->output->echoln(sprintf($format, substr($relative_file, -min(30, strlen($relative_file))), $file_stat['status_code'], count($file_stat['failed']) + count($file_stat['passed']), count($file_stat['failed']), implode(' ', $file_stat['failed']))); 
    521522      } 
    522523 
     
    655656      $total_covered_lines += count($cov); 
    656657 
    657       $output->echoln(sprintf("%-70s %3.0f%%", substr($this->get_relative_file($file), -70), $percent), $percent == 100 ? 'INFO' : ($percent > 90 ? 'PARAMETER' : ($percent < 20 ? 'ERROR' : ''))); 
     658      $relative_file = $this->get_relative_file($file); 
     659      $output->echoln(sprintf("%-70s %3.0f%%", substr($relative_file, -min(70, strlen($relative_file))), $percent), $percent == 100 ? 'INFO' : ($percent > 90 ? 'PARAMETER' : ($percent < 20 ? 'ERROR' : ''))); 
    658660      if ($this->verbose && $percent != 100) 
    659661      {