FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
TestReport Class Reference
Collaboration diagram for TestReport:
Collaboration graph

Public Member Functions

 __construct ($Path=NULL, $notesPath=NULL)
 
 parseResultsFile ($file)
 
 globdata ($results, $moData)
 
 parseLicenseResults ($FD)
 
 parseLicenseTotals ($FD)
 
 suiteSummary ($suite)
 

Public Attributes

 $Date
 
 $Time
 
 $Svn
 
 $resultsFile = NULL
 
 $resultsPath = NULL
 

Protected Member Functions

 getException ($suite)
 
 getFailures ($suite)
 
 getResult ($FD)
 
 getSuite ($FD, $line)
 

Protected Attributes

 $results
 

Private Member Functions

 parseDateTime ($line)
 
 parseSuiteName ($string)
 
 parseResults ($string)
 
 parseElapseTime ($string)
 

Private Attributes

 $testRuns
 
 $smarty
 

Detailed Description

Report class

Parameters
string$paththe fully qualified path to the results file
Version
"$Id: reportClass.php 3567 2010-10-15 01:06:58Z rrando $"

Created on Dec 12, 2008

Definition at line 33 of file reportClass.php.

Member Function Documentation

TestReport::getException (   $suite)
protected

getException

Find exceptions in the results

Parameters
string$suitethe results for a particular test suite.
Returns
array $xList the list of exceptions (if any), can return an empty array.

Definition at line 73 of file reportClass.php.

TestReport::getFailures (   $suite)
protected

getFailures

Find test failures in the results, capture the first 2 errors, the rest are usually a result of the first 1 or 2.

Parameters
string$suitethe results for a particular test suite.
Returns
array $xList the first 2 errors (if any), can return an empty array.

Definition at line 112 of file reportClass.php.

TestReport::getResult (   $FD)
protected

getResult

using the open file descriptor, read from the file and create a space seperated string of results. A result is everything up to the string <--—>.

Parameters
resource$FDopened file resource to the results file
Returns
string $result the result string

Definition at line 247 of file reportClass.php.

TestReport::getSuite (   $FD,
  $line 
)
protected

getSuite

Gather all the lines in the results file associated with the suite output.

Parameters
resource$FD,openfile positioned at the start of a suite
string$linethe line that matched the start of the suite
Returns
string $suite one long string of the suite results, imbeded newlines.

Definition at line 274 of file reportClass.php.

TestReport::globdata (   $results,
  $moData 
)

globdata

Parse the data and then put all the data into one big array and then let smarty display it

Parameters
array$datathe data array to add to
array$moDatathe data array to glob onto the other array
Returns
array the first parameter globed together with the second.

Definition at line 314 of file reportClass.php.

TestReport::parseDateTime (   $line)
private

parseDateTime

Parse the start line from the test suite output, return the date and time

Parameters
string$linethe line to parse
Returns
array date and time.

Definition at line 352 of file reportClass.php.

TestReport::parseElapseTime (   $string)
private

parseElapseTime

Given a string that represents the elapse time printed by the fossology tests, parse it and return a string in the form hh:mm:ss.

Parameters
string$string
Returns
boolean (string or false)

Definition at line 501 of file reportClass.php.

TestReport::parseLicenseResults (   $FD)

parseLicenseResults

read the results file and parse it.

Parameters
resource$FDopened file resource.
Returns
$array array of all of the results
Todo:
rename this to parsePassFailResults

Definition at line 378 of file reportClass.php.

TestReport::parseLicenseTotals (   $FD)

parseLicenseTotals

parse the liscense total file

Parameters
resource$FDopened file descriptor
Returns
array an array of 3 arrays, agent, pass, fail.

Definition at line 420 of file reportClass.php.

TestReport::parseResults (   $string)
private

parseResults

parse a line of text that represents simpletest test result line. Return an associative array with passes, failures and exceptions as the keys,

Parameters
string$stringthe string to parse
Returns
string? $res

Definition at line 471 of file reportClass.php.

TestReport::parseResultsFile (   $file)

gatherData

read a file and return the number of passes, failures,exceptions and elapse time.

Set attributes Date and Time.

Definition at line 170 of file reportClass.php.

TestReport::parseSuiteName (   $string)
private

parseSuiteName

parse a line of text, return the 2nd and 3rd token as a hyphonated name.

Parameters
string$stringthe string to parse
Returns
boolean (false or a string)

Definition at line 449 of file reportClass.php.

TestReport::suiteSummary (   $suite)

suiteSummary

produce a summary list from the input:

  • suite name
  • Number of tests
  • Number of failures
  • Number of exceptions
Parameters
string$suitethe suite output as one long string.
Returns
array $summary

Definition at line 540 of file reportClass.php.


The documentation for this class was generated from the following file: