W3cubDocs

/Pony

PonyTest

[Source]

Main test framework actor that organises tests, collates information and prints results.

actor tag PonyTest

Constructors

create

[Source]

Create a PonyTest object and use it to run the tests from the given TestList

new tag create(
  env: Env val,
  list: TestList tag)
: PonyTest tag^

Parameters

Returns

Public Behaviours

apply

[Source]

Run the given test, subject to our filters and options.

be apply(
  test: UnitTest iso)

Parameters

Private Behaviours

_test_started

[Source]

A test has started running, update status info. The id parameter is the test identifier handed out when we created the test helper.

be _test_started(
  id: USize val)

Parameters

_test_complete

[Source]

A test has completed, restore its result and update our status info. The id parameter is the test identifier handed out when we created the test helper.

be _test_complete(
  id: USize val,
  pass: Bool val,
  log: Array[String val] val)

Parameters

_all_tests_applied

[Source]

All our tests have been handed to apply(), setup for finishing

be _all_tests_applied()

Private Functions

_find_group

[Source]

Find the group to use for the given group name, subject to the --sequential flag.

fun ref _find_group(
  group_name: String val)
: _Group tag

Parameters

Returns

_process_opts

[Source]

Process our command line options. All command line arguments given must be recognised and make sense. State for specified options is stored in object fields. We don't use the options package because we aren't already dependencies.

fun ref _process_opts()
: None val

Returns

_print_report

[Source]

The tests are all complete, print out the results.

fun box _print_report()
: None val

Returns

_plural

[Source]

Return a "s" or an empty string depending on whether the given number is 1. For use when printing possibly plural words, eg "test" or "tests".

fun box _plural(
  n: USize val)
: String val

Parameters

Returns

© 2016-2018, The Pony Developers
© 2014-2015, Causality Ltd.
Licensed under the BSD 2-Clause License.
https://stdlib.ponylang.io/ponytest-PonyTest