Kernel Toolkit 7.3 APIs Banner
Office of Information and Technology (OIT) Banner
[skip navigation]

EN^XTMUNIT(): Run Unit Tests

Reference Type: N/A; Not callable from outside a unit test, Category: Toolkit—M Unit Utility, ICR#: N/A

Description

The EN^XTMUNIT API runs unit tests. It is typically the first command within a suite of unit test routines, so that the entire suite of tests (multiple routines) can be run by executing the first routine of the suite. For example, the unit tests for testing M Unit can be run by:

    >D ^XTMZZUT1”

The EN^XTMUNIT API starts the unit testing process.

NOTE: None of the M Unit Utility Application Programming Interfaces (APIs), extrinsic functions, or sections of code in the M Unit are callable from outside a unit test, but are all part of a unit test. M UNIT is a self-contained application.

REF: For an overview and more details of the M Unit Utility, see the "Toolkit—M Unit Utility" section in the Kernel 8.0 & Kernel Toolkit 7.3 Developer's Guide.

Format

  D EN^XTMUNIT(rouname,[verbose,][break])

Input Parameters

rouname:

(required) provides the name of the routine where the testing should be started. That routine must have at least one test entry point (and possibly more) either specified as follows:

  • In the lines immediately following the XTENT tag as the third semi-colon piece on the line.

    Or:

  • IIt can have tags with @TEST as the first text of the comment for the tag line.
verbose:

(optional) If it evaluates to True (e.g., 1), it turns on verbose mode, which lists each individual test being run as well as its result.

break:

(optional) If it evaluates to True, it causes the M Unit test process to terminate upon a failure or error instead of continuing until all tests have been evaluated.

Output

returns:

Results of the unit tests.

TThe following sections of code in the XTMUNIT routine are additional test entry points added by the developer; however, they are not callable by the developer from inside or outside of the routine:

STARTUP

This section of code in the XTMUNIT routine runs before anything else. It is useful for setting up an environment or variable values that are common to all of the tests.

SHUTDOWN

This section of code in the XTMUNIT routine runs after everything else. It is useful for shutting down an environment or clearing variable values that are common to all of the tests. It can also be used for cleaning up global or file entries that are left as a result of testing.

SETUP

This section of code in the XTMUNIT routine runs before every test. It is useful for resetting an environment or variable values that are used by the tests.

TEARDOWN

This section of code in the XTMUNIT routine runs after every test. It is useful for cleaning up an environment or variable values that are used by the tests.

XTENT: List Unit Test Entry Points

This section of code in the XTMUNIT routine is used to store information required by the EN^XTMUNIT API to run a unit test. It provides a list of unit test entry points. Each entry describes a group of tests.

     ;;T4;Entry point using XTMENT
     ;;T5;Error count check
XTROU: List of Routines Containing Additional Tests
     ;;XTMZZUT2;
     ;;XTMZZUT3;

This section of code in the XTMUNIT routine is used to store information required by the EN^XTMUNIT API to run a unit test. It provides a list of routines containing additional tests. It extends a suite of tests beyond the limits of a single routine.