Changeset 965

Show
Ignore:
Timestamp:
07/25/08 10:52:32 (1 month ago)
Author:
arnoschn
Message:

ci-tests: adding summary page for all tests

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/arnoschn/cache/CiReportTask.php

    r948 r965  
    2222                $files[]=$fs->getDir($this->project).DIRECTORY_SEPARATOR.$f; 
    2323            } 
    24             var_dump($files); 
    2524             
    2625        } 
     26        $environments = array(); 
     27        $summaryFile = $this->reportDir.DIRECTORY_SEPARATOR.'index.html'; 
    2728        foreach($files as $file) 
    2829        { 
     
    3536                mkdir($dir,0777,true); 
    3637            } 
     38            $xml = new SimpleXMLElement(file_get_contents($file)); 
     39            $suites=$xml->xpath("/testsuites/testsuite"); 
     40            $tests=0; 
     41            $failures=0; 
     42            $errors=0; 
     43            $time=0; 
     44             
     45            foreach($suites as $suite){ 
     46                $attributes = $suite->attributes(); 
     47                $tests += (int)$attributes->tests; 
     48                $failures += (int)$attributes->failures; 
     49                $errors += (int)$attributes->errors; 
     50                $time += (int)$attributes->time; 
     51            } 
     52            $environment = array(); 
     53            $environment['php']=$php; 
     54            $environment['class']=$failures>0?'failure':$errors>0?'error':''; 
     55            $environment['backend']=$backend; 
     56            $environment['tests']=$tests; 
     57            $environment['failures']=$failures; 
     58            $environment['errors']=$errors; 
     59            $environment['time']=$time; 
     60            $environment['details']=$dir.DIRECTORY_SEPARATOR.'phpunit2-noframes.html'; 
     61            $environments[]=$environment; 
    3762            $this->setInFile($file); 
    3863            $this->log("Report available in:\n\n".$dir.DIRECTORY_SEPARATOR."phpunit2-noframes.html"); 
    3964            parent::main(); 
    4065        } 
     66        ob_start(); 
     67        include_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'summary.php'); 
     68        $contents = ob_get_clean(); 
     69         
     70        file_put_contents($summaryFile, $contents); 
    4171    } 
    4272    /** 
  • branches/arnoschn/cache/test/unit/lib/AkActionController/_action_caching.php

    r964 r965  
    1616            $cacheDir = $settings['handler']['options']['cacheDir']; 
    1717        } 
    18         chmod($cacheDir,0777); 
     18        //chmod($cacheDir,0777); 
    1919        $this->_flushCache('akelos.org'); 
    2020        $this->_flushCache('www.akelos.org');