40 public $resultsFile = NULL;
41 public $resultsPath = NULL;
43 public function __construct($Path=NULL, $notesPath=NULL) {
46 $Latest =
'/home/fosstester/public_html/TestResults/Data/Latest';
50 $this->resultsPath = $Latest;
52 else if(is_dir($Path)) {
53 $this->resultsPath = $Path;
55 else if(is_file($Path)) {
56 $this->resultsFILE = $Path;
78 $matched = preg_match_all(
'/^Exception\s[0-9]+.*?$/m',$suite, $matches);
79 $pm = preg_match_all(
'/^Unexpected PHP error.*?$/m',$suite, $ematches);
87 foreach($matches as $ex){
88 foreach($ex as $except) {
89 foreach ($ematches as $ematch){
90 foreach($ematch as $estring){
91 $elist[$except] = $estring;
120 $matched = preg_match_all(
'/^[0-9]+\).*?$/m',$suite, $matches);
121 $exm = preg_match_all(
'/Expected:.*/', $suite, $expected);
122 $gm = preg_match_all(
'/Got:.*/', $suite, $got);
126 foreach($matches as $flist){
127 foreach($flist as $failure){
128 $failList[] = $failure;
131 if(!empty($expected))
133 foreach($expected as $elist)
135 foreach($elist as $expResult)
137 $failList[] = $expResult;
143 foreach($got as $glist)
145 foreach($glist as $gotResult)
147 $failList[] = $gotResult;
178 $exceptions = array();
180 $FD = fopen($file,
'r');
181 while ($line = fgets($FD, 1024)) {
182 if (preg_match(
'/^Running\sAll/', $line)){
184 list ($this->Date, $this->Time) = $DateTime;
185 $svnline = preg_split(
'/:/', $line);
186 $this->Svn = $svnline[4];
189 elseif (preg_match(
'/^Starting.*?on:/', $line)) {
190 $aSuite = $this->
getSuite($FD,$line);
192 list($pass, $fail, $except) = preg_split(
'/:/',$sum[1]);
204 for($i=0; $i < count($sum); $i++) {
205 $summary[$sum[$i]] = array($sum[$i+1]);
209 if(empty($failures)) {
214 $summary[$suite][] = array(
'failures' => $failures);
217 if(empty($exceptions)) {
222 $summary[$suite][] = array(
'exceptions' => $exceptions);
223 $exceptions = array();
249 if(!is_resource($FD)) {
252 while($line = fgets($FD,1024)) {
254 if(strcasecmp($line,
'<----->') == 0) {
257 $result .= $line .
' ';
286 while ($line = fgets($FD, 1024)) {
287 if (preg_match(
'/^OK/', $line) || preg_match(
'/^FAILURES/', $line)) {
288 $line = fgets($FD, 1024);
289 if (preg_match(
'/^Test cases run:/', $line))
291 $tossme = fgets($FD, 1024);
292 $line = fgets($FD, 1024);
316 $dataSize = count($moData);
317 for ($suite = 0; $suite <= $dataSize; $suite += 3)
319 if (($suite +2) > $dataSize)
325 array_push($results, $suiteName);
329 $pfe = split(
':', $pfe_results);
330 array_push($results, $pfe[0]);
331 array_push($results, $pfe[1]);
332 array_push($results, $pfe[2]);
336 array_push($results, $etime);
359 $pat =
'.*?s\son:(.*?)\sat\s(.*?)\s';
360 $matches = preg_match(
"/$pat/", $line, $matched);
361 $dateTime[] = $matched[1];
362 $dateTime[] = $matched[2];
380 if(!is_resource($FD)) {
386 $LicenseType = array();
387 $VettedName = array();
392 $resultParts = split(
';',$line);
393 list($lKey,$licenseType) = split(
'=',$resultParts[0]);
394 list($fnKey,$fileName) = split(
'=',$resultParts[1]);
395 $FileName[] = rtrim($fileName,
'.txt');
396 $LicenseType[$licenseType] = $FileName;
398 list($fnKey,$std) = split(
'=',$resultParts[1]);
399 $VettedName[] = str_replace(
',',
",<br>",$std);
400 list($pKey,$pass) = split(
'=',$resultParts[2]);
401 $results[] = str_replace(
',',
",<br>",$pass);
402 list($fKey,$fail) = split(
'=',$resultParts[3]);
403 $results[] = str_replace(
',',
",<br>",$fail);
405 $All[] = $LicenseType;
406 $All[] = $VettedName;
422 if(is_resource($FD)) {
428 $line =
trim(fgets($FD, 1024));
429 list($agent[],$pass[],$fail[]) = explode(
':',$line);
432 return(array($agent,$pass,$fail));
454 $pat =
'^Starting\s(.*?)\son:';
455 $matches = preg_match(
"/$pat/", $string, $matched);
457 return ($matched[1]);
478 $pat =
'.*?(Passes):\s(.*?),\s(Failures):\s(.*?),\s(Exceptions):\s(.*)';
479 $matches = preg_match(
"/$pat/", $string, $matched);
483 $results[$matched[1]] = $matched[2];
484 $results[$matched[3]] = $matched[4];
485 $results[$matched[5]] = $matched[6];
486 $res = $matched[2] .
":" . $matched[4] .
":" . $matched[6];
508 $pat =
'.+took\s(.*?)\sto\srun$';
509 $matches = preg_match(
"/$pat/", $string, $matched);
511 $parts = split(
' ', $matched[1]);
514 $sizep = count($parts);
516 for ($i = 0; $i < $sizep; $i++)
518 $etime .= $parts[$i] . substr($parts[$i +1], 0, 1) .
":";
521 $etime = rtrim($etime,
':');
545 return(array($suiteName,$results));
globdata($results, $moData)
list_t type structure used to keep various lists. (e.g. there are multiple lists).
char * trim(char *ptext)
Trimming whitespace.