ecl-logo Documentation

RunUnitTest

RunUnitTest[symbol]summary

returns the test summary from executing all unit tests for symbol.

RunUnitTest[context]summaries

returns an assocation of test summaries for each symbol in context.

RunUnitTest[fileName]summaries

returns an association of test summaries for each symbol whose tests are defined in fileName.

RunUnitTest[symbols]summaries

returns an association of test summaries for each of the given symbols.

RunUnitTest[contexts]groupSummaries

returns an association of contexts -> symbols in each context -> test summaries for each symbol in that context.

RunUnitTest[fileNames]groupSummaries

returns an association of fileNames -> symbols in each test file -> test summary for each symbol in that test file.

RunUnitTest[association]summaries

returns an association of test summaries for each of the keys given in association.

Details

  • Association & OutputFormat options are ignored in the overload for a list of contexts/files in order to consistently return nested Associations.
  • Input
    Output
    General Options

Examples

Basic Examples  (4)

For a symbol with tests, returns result summary information:

For a list of symbols, returns an association of symbols to result summaries:

For a context, runs the unit tests for all symbols in that context and returns an association of their result summaries:

For a single file, runs unit tests for all symbols whose unit tests are defined in that file:

Additional Examples  (2)

Run a list of arbitrary tests under a given heading:

If a FatalFailure is encountered, do not run any further tests:

Options  (21)

Association  (2)

Association->False when given an Association as input, returns only the summaries in a list:

Association->False when given a list of symbols, returns only the summaries in a list:

Category  (2)

Run only the Tests for the given symbol:

Run only the Messages or Basic Examples for the given symbol:

DisplayFunction  (1)

Control how inputs are converted to strings for verbose printing:

Exclude  (1)

Exclude option filters out symbols to be run from given list of symbols (or strings):

OutputFormat  (8)

OutputFormat->SingleBoolean when given an Association as input, returns a single True/False:

OutputFormat->Boolean when given an Association as input, returns pass/fail as the value instead of the test summary:

OutputFormat->Boolean when given a list of symbols, returns the pass/fail results instead of the summaries:

OutputFormat->SingleBoolean when given a list of symbols, returns a single pass/fail result:

OutputFormat->Boolean when given a single symbol, returns a single pass/fail result:

OutputFormat->SingleBoolean when given a single symbol, returns a single pass/fail result:

OutputFormat->Boolean when given a context, returns the pass/fail results instead of the summaries:

OutputFormat->SingleBoolean when given a context, returns the pass/fail results instead of the summaries:

ShowExpression  (1)

ShowExpression->False && SummaryNotebook->True hides Test expressions from result window display:

SubCategory  (1)

Run only the Tests for the given symbol:

SummaryNotebook  (2)

SummaryNotebook->True (when Verbose->True|Failures) prints test results as they are run in a separate, formatted window:

SummaryNotebook->False (when Verbose->True|Failures) prints a simple text display inline of tests as they are run:

Verbose  (3)

Verbose->True dynamically prints results of each Test as they are run:

Verbose->Failures & SummaryNotebook->True dynamically prints results of each Test as they are run, displaying output of failed tests only:

Verbose->False does not print any output during Test runs: