# 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

  • default

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

  • Handler

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

  • aborted
  • checkVerbose
  • failed
  • filter
  • passed
  • start
  • stop
  • summary
  • verbose
  • waiting

# API Documentation

# Functions

# default

Signature cp.spec.Handler.default([handler]) -> cp.spec.Handler
Type Function
Description Gets 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.
Notes None
Examples None
Source src/extensions/cp/spec/Handler.lua line 16

# Constructors

# Handler

Signature cp.spec.Handler() -> cp.spec.Handler
Type Constructor
Description Creates a new Handler
Parameters
  • None
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/spec/Handler.lua line 36

# Methods

# aborted

Signature cp.spec.Handler:aborted(run, msg) -> none
Type Method
Description Call to indicate the run has had an abort.
Parameters
  • run - The test run.
  • msg - The message.
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/spec/Handler.lua line 119

# checkVerbose

Signature cp.spec.Handler:checkVerbose(run) -> boolean
Type Method
Description Indicates if either the handler or the individual Run is "verbose". If so, more messages may be output by the handler.
Parameters
  • run
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/spec/Handler.lua line 61

# failed

Signature cp.spec.Handler:failed(run, msg) -> none
Type Method
Description Call to indicate the run has failed.
Parameters
  • run - The test run.
  • msg - The message.
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/spec/Handler.lua line 107

# filter

Signature cp.spec.Handler:filter(run, msg) -> none
Type Method
Description Call to indicate the run is running due to being filtered.
Parameters
  • run - The test run.
  • msg - The message.
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/spec/Handler.lua line 143

# passed

Signature cp.spec.Handler:passed(run) -> none
Type Method
Description Call to indicate the run has passed.
Parameters
  • run - The test run.
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/spec/Handler.lua line 96

# start

Signature cp.spec.Handler:start(run) -> none
Type Method
Description Call to indicate the run has started.
Parameters
  • run - The test run.
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/spec/Handler.lua line 74

# stop

Signature cp.spec.Handler:stop(run) -> none
Type Method
Description Call to indicate the run has completed.
Parameters
  • run - The test run.
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/spec/Handler.lua line 85

# summary

Signature cp.spec.Handler:summary(run, report) -> none
Type Method
Description Call to indicate the run has passed with the given report.
Parameters
  • run - The test run.
  • report - The test reports.
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/spec/Handler.lua line 155

# verbose

Signature cp.spec.Handler:verbose([isVerbose]) -> self
Type Method
Description Indicate 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.
Notes None
Examples None
Source src/extensions/cp/spec/Handler.lua line 47

# waiting

Signature cp.spec.Handler:waiting(run, timeout) -> none
Type Method
Description Call to indicate that the run is waiting asynchronously.
Parameters
  • run - The test run.
  • timeout - The timeout, in seconds.
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/spec/Handler.lua line 131