29 public $resultsFile = NULL;
30 public $resultsPath = NULL;
32 public function __construct($Path=NULL, $notesPath=NULL) {
35 $Latest =
'/home/fosstester/public_html/TestResults/Data/Latest';
39 $this->resultsPath = $Latest;
41 else if(is_dir($Path)) {
42 $this->resultsPath = $Path;
44 else if(is_file($Path)) {
45 $this->resultsFILE = $Path;
67 $matched = preg_match_all(
'/^Exception\s[0-9]+.*?$/m',$suite, $matches);
68 $pm = preg_match_all(
'/^Unexpected PHP error.*?$/m',$suite, $ematches);
76 foreach($matches as $ex){
77 foreach($ex as $except) {
78 foreach ($ematches as $ematch){
79 foreach($ematch as $estring){
80 $elist[$except] = $estring;
109 $matched = preg_match_all(
'/^[0-9]+\).*?$/m',$suite, $matches);
110 $exm = preg_match_all(
'/Expected:.*/', $suite, $expected);
111 $gm = preg_match_all(
'/Got:.*/', $suite, $got);
115 foreach($matches as $flist){
116 foreach($flist as $failure){
117 $failList[] = $failure;
120 if(!empty($expected))
122 foreach($expected as $elist)
124 foreach($elist as $expResult)
126 $failList[] = $expResult;
132 foreach($got as $glist)
134 foreach($glist as $gotResult)
136 $failList[] = $gotResult;
167 $exceptions = array();
169 $FD = fopen($file,
'r');
170 while ($line = fgets($FD, 1024)) {
171 if (preg_match(
'/^Running\sAll/', $line)){
173 list ($this->Date, $this->Time) = $DateTime;
174 $svnline = preg_split(
'/:/', $line);
175 $this->Svn = $svnline[4];
178 elseif (preg_match(
'/^Starting.*?on:/', $line)) {
179 $aSuite = $this->
getSuite($FD,$line);
181 list($pass, $fail, $except) = preg_split(
'/:/',$sum[1]);
193 for($i=0; $i < count($sum); $i++) {
194 $summary[$sum[$i]] = array($sum[$i+1]);
198 if(empty($failures)) {
203 $summary[$suite][] = array(
'failures' => $failures);
206 if(empty($exceptions)) {
211 $summary[$suite][] = array(
'exceptions' => $exceptions);
212 $exceptions = array();
238 if(!is_resource($FD)) {
241 while($line = fgets($FD,1024)) {
243 if(strcasecmp($line,
'<----->') == 0) {
246 $result .= $line .
' ';
275 while ($line = fgets($FD, 1024)) {
276 if (preg_match(
'/^OK/', $line) || preg_match(
'/^FAILURES/', $line)) {
277 $line = fgets($FD, 1024);
278 if (preg_match(
'/^Test cases run:/', $line))
280 $tossme = fgets($FD, 1024);
281 $line = fgets($FD, 1024);
305 $dataSize = count($moData);
306 for ($suite = 0; $suite <= $dataSize; $suite += 3)
308 if (($suite +2) > $dataSize)
314 $results[] = $suiteName;
318 $pfe = explode(
':', $pfe_results);
319 $results[] = $pfe[0];
320 $results[] = $pfe[1];
321 $results[] = $pfe[2];
348 $pat =
'.*?s\son:(.*?)\sat\s(.*?)\s';
349 $matches = preg_match(
"/$pat/", $line, $matched);
350 $dateTime[] = $matched[1];
351 $dateTime[] = $matched[2];
369 if(!is_resource($FD)) {
375 $LicenseType = array();
376 $VettedName = array();
381 $resultParts = explode(
';',$line);
382 list($lKey,$licenseType) = explode(
'=',$resultParts[0]);
383 list($fnKey,$fileName) = explode(
'=',$resultParts[1]);
384 $FileName[] = rtrim($fileName,
'.txt');
385 $LicenseType[$licenseType] = $FileName;
387 list($fnKey,$std) = explode(
'=',$resultParts[1]);
388 $VettedName[] = str_replace(
',',
",<br>",$std);
389 list($pKey,$pass) = explode(
'=',$resultParts[2]);
390 $results[] = str_replace(
',',
",<br>",$pass);
391 list($fKey,$fail) = explode(
'=',$resultParts[3]);
392 $results[] = str_replace(
',',
",<br>",$fail);
394 $All[] = $LicenseType;
395 $All[] = $VettedName;
411 if(is_resource($FD)) {
417 $line =
trim(fgets($FD, 1024));
418 list($agent[],$pass[],$fail[]) = explode(
':',$line);
421 return(array($agent,$pass,$fail));
443 $pat =
'^Starting\s(.*?)\son:';
444 $matches = preg_match(
"/$pat/", $string, $matched);
446 return ($matched[1]);
467 $pat =
'.*?(Passes):\s(.*?),\s(Failures):\s(.*?),\s(Exceptions):\s(.*)';
468 $matches = preg_match(
"/$pat/", $string, $matched);
472 $results[$matched[1]] = $matched[2];
473 $results[$matched[3]] = $matched[4];
474 $results[$matched[5]] = $matched[6];
475 $res = $matched[2] .
":" . $matched[4] .
":" . $matched[6];
497 $pat =
'.+took\s(.*?)\sto\srun$';
498 $matches = preg_match(
"/$pat/", $string, $matched);
500 $parts = explode(
' ', $matched[1]);
503 $sizep = count($parts);
505 for ($i = 0; $i < $sizep; $i++)
507 $etime .= $parts[$i] . substr($parts[$i +1], 0, 1) .
":";
510 $etime = rtrim($etime,
':');
534 return(array($suiteName,$results));
globdata($results, $moData)
char * trim(char *ptext)
Trimming whitespace.
list_t type structure used to keep various lists. (e.g. there are multiple lists).