#cp.spec.Handler

Subclasses of this can customise how reports are handled. All methods do nothing.

See DefaultHandler.


#API Overview

Functions - API calls offered directly by the extension

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

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


#API Documentation

#Functions

Signaturecp.spec.Handler.default([handler]) -> cp.spec.Handler
TypeFunction
DescriptionGets and sets the current default Handler implementation. This is used when processing test runs.
Parameters
  • handler - (optional) when provided, sets the default to the specified handler.
Returns
  • The current Handler implementation.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/spec/Handler.lua line 16

#Constructors

Signaturecp.spec.Handler() -> cp.spec.Handler
TypeConstructor
DescriptionCreates a new Handler
Parameters
  • None
Returns
  • None
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/spec/Handler.lua line 36

#Methods

Signaturecp.spec.Handler:aborted(run, msg) -> none
TypeMethod
DescriptionCall to indicate the run has had an abort.
Parameters
  • run - The test run.
  • msg - The message.
Returns
  • None
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/spec/Handler.lua line 119

Signaturecp.spec.Handler:checkVerbose(run) -> boolean
TypeMethod
DescriptionIndicates if either the handler or the individual Run is "verbose". If so, more messages may be output by the handler.
Parameters
  • run
Returns
  • None
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/spec/Handler.lua line 61

Signaturecp.spec.Handler:failed(run, msg) -> none
TypeMethod
DescriptionCall to indicate the run has failed.
Parameters
  • run - The test run.
  • msg - The message.
Returns
  • None
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/spec/Handler.lua line 107

Signaturecp.spec.Handler:filter(run, msg) -> none
TypeMethod
DescriptionCall to indicate the run is running due to being filtered.
Parameters
  • run - The test run.
  • msg - The message.
Returns
  • None
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/spec/Handler.lua line 143

Signaturecp.spec.Handler:passed(run) -> none
TypeMethod
DescriptionCall to indicate the run has passed.
Parameters
  • run - The test run.
Returns
  • None
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/spec/Handler.lua line 96

Signaturecp.spec.Handler:start(run) -> none
TypeMethod
DescriptionCall to indicate the run has started.
Parameters
  • run - The test run.
Returns
  • None
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/spec/Handler.lua line 74

Signaturecp.spec.Handler:stop(run) -> none
TypeMethod
DescriptionCall to indicate the run has completed.
Parameters
  • run - The test run.
Returns
  • None
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/spec/Handler.lua line 85

Signaturecp.spec.Handler:summary(run, report) -> none
TypeMethod
DescriptionCall to indicate the run has passed with the given report.
Parameters
  • run - The test run.
  • report - The test reports.
Returns
  • None
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/spec/Handler.lua line 155

Signaturecp.spec.Handler:verbose([isVerbose]) -> self
TypeMethod
DescriptionIndicate that the handler is (or is not) verbose. If not provided, this is set to true.
Parameters
  • isVerbose - (optional) If set to false, the handler will not be verbose. Defaults to true.
Returns
  • The Handler instance, for chaining.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/spec/Handler.lua line 47

Signaturecp.spec.Handler:waiting(run, timeout) -> none
TypeMethod
DescriptionCall to indicate that the run is waiting asynchronously.
Parameters
  • run - The test run.
  • timeout - The timeout, in seconds.
Returns
  • None
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/spec/Handler.lua line 131