# cp.spec.Report

The results of a test run.


# API Overview

Constructors - API calls which return an object, typically one that offers API methods

  • Report

Fields - Variables which can only be accessed from an object returned by a constructor

  • aborts
  • failures
  • passes
  • run
  • startTime
  • stopTime
  • totalTime

Methods - API calls which can only be made on an object returned by a constructor

  • aborted
  • add
  • failed
  • passed
  • start
  • stop
  • summary
  • waiting

# API Documentation

# Constructors

# Report

Signature cp.spec.Report(run) -> cp.spec.Report
Type Constructor
Description Creates a new test report.
Parameters
  • run
Returns
  • A new cp.spec.Report object
Notes None
Examples None
Source src/extensions/cp/spec/Report.lua line 16

# Fields

# aborts

Signature cp.spec.Report.aborts <number>
Type Field
Description The number of aborts in the run.
Notes None
Source src/extensions/cp/spec/Report.lua line 42

# failures

Signature cp.spec.Report.failures <number>
Type Field
Description The number of failures in the run.
Notes None
Source src/extensions/cp/spec/Report.lua line 37

# passes

Signature cp.spec.Report.passes <number>
Type Field
Description The number of passes in the run.
Notes None
Source src/extensions/cp/spec/Report.lua line 32

# run

Signature cp.spec.Report.run <cp.spec.Run>
Type Field
Description The run the reports are for.
Notes None
Source src/extensions/cp/spec/Report.lua line 27

# startTime

Signature cp.spec.Report.startTime <number>
Type Field
Description The number of seconds since epoch when the test started, or nil if not started yet.
Notes None
Source src/extensions/cp/spec/Report.lua line 47

# stopTime

Signature cp.spec.Report.stopTime <number>
Type Field
Description The number of seconds since epoch when the tests stopped, or nil if not stopped yet.
Notes None
Source src/extensions/cp/spec/Report.lua line 52

# totalTime

Signature cp.spec.Report.totalTime <number>
Type Field
Description The number of seconds the run took (may be decimal), or nil if the test hasn't run.
Notes None
Source src/extensions/cp/spec/Report.lua line 57

# Methods

# aborted

Signature cp.spec.Report:aborted(message)
Type Method
Description Records an abort, with the specified message.
Parameters
  • message - The related message to output.
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/spec/Report.lua line 120

# add

Signature cp.spec.Report:add(otherReport) -> nil
Type Method
Description Adds the passes/failures/aborts from the other report into this one.
Parameters
  • otherReport - The other report to add.
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/spec/Report.lua line 160

# failed

Signature cp.spec.Report:failed(message)
Type Method
Description Records a fail, with the specified message.
Parameters
  • message - The related message to output.
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/spec/Report.lua line 106

# passed

Signature cp.spec.Report:passed([message])
Type Method
Description Records a pass, with the specified message.
Parameters
  • message - an optional additional message to output.
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/spec/Report.lua line 92

# start

Signature cp.spec.Report:start() -> nil
Type Method
Description Logs the start time.
Parameters
  • None
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/spec/Report.lua line 63

# stop

Signature cp.spec.Report:stop() -> nil
Type Method
Description Logs the end time.
Parameters
  • None
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/spec/Report.lua line 77

# summary

Signature cp.spec.Report:summary()
Type Method
Description Summarise the reports.
Parameters
  • None
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/spec/Report.lua line 147

# waiting

Signature cp.spec.Report:waiting(timeout)
Type Method
Description Records that a run is waiting for up to the specified amount of time.
Parameters
  • timeout - The timeout to wait for, in seconds.
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/spec/Report.lua line 134