Development

Changeset 5580

You must first sign up to be able to contribute.

Changeset 5580

Show
Ignore:
Timestamp:
10/18/07 10:03:23 (2 years ago)
Author:
fabien
Message:

lime: fixed coverage bug using ob_start(), minor optimizations

Files:

Legend:

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

    r5575 r5580  
    648648<?php 
    649649xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); 
    650 ob_start(); 
    651650include('$file'); 
    652 ob_end_clean(); 
    653651echo '<PHP_SER>'.serialize(xdebug_get_code_coverage()).'</PHP_SER>'; 
    654652EOF; 
     
    666664        foreach ($cov as $file => $lines) 
    667665        { 
     666          if (!in_array($file, $this->files)) 
     667          { 
     668            continue; 
     669          } 
     670 
    668671          if (!isset($coverage[$file])) 
    669672          { 
     
    672675          } 
    673676 
    674           foreach ($lines as $line => $count
     677          foreach ($lines as $line => $flag
    675678          { 
    676             if ($count == 1) 
     679            if ($flag == 1) 
    677680            { 
    678681              $coverage[$file][$line] = 1; 
     
    722725    } 
    723726 
    724     $output->echoln(sprintf("TOTAL COVERAGE: %3.0f%%", $total_covered_lines * 100 / $total_php_lines)); 
     727    $output->echoln(sprintf("TOTAL COVERAGE: %3.0f%%", $total_php_lines ? $total_covered_lines * 100 / $total_php_lines : 0)); 
    725728  } 
    726729 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.