FOSSology  4.4.0
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 22 of file reportClass.php.

Member Function Documentation

◆ getException()

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 62 of file reportClass.php.

◆ getFailures()

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 101 of file reportClass.php.

◆ getResult()

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 236 of file reportClass.php.

◆ getSuite()

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 263 of file reportClass.php.

◆ globdata()

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$resultsthe 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 303 of file reportClass.php.

◆ parseDateTime()

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 341 of file reportClass.php.

◆ parseElapseTime()

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 490 of file reportClass.php.

◆ parseLicenseResults()

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 367 of file reportClass.php.

◆ parseLicenseTotals()

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 409 of file reportClass.php.

◆ parseResults()

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 460 of file reportClass.php.

◆ parseResultsFile()

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 159 of file reportClass.php.

◆ parseSuiteName()

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 438 of file reportClass.php.

◆ suiteSummary()

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 529 of file reportClass.php.


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