Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

prog::testinit

Initialize tests

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Syntax

prog::testinit()
prog::testinit(string)
prog::testinit(expected_time, <All>)
prog::testinit(string, expected_time, <All>)
prog::testinit(arch = expected_time, …, <All>)
prog::testinit(string, arch = expected_time, …, <All>)

Description

The function prog::testinit initializes automatic tests (see prog::test).

The second argument expected_time determines the time, that the test should need.

    Note:   This time is not the real time, but a time factor that is given by prog::testexit at the end of a complete test.

This time factor is computed to be independent of the real speed of the used machine.

In general (without option All) the base for the time factor is the sum of all times for the evaluation of the first arguments of each call of prog::test.

The time factor can be useful to detect differences of the run time of tests, e.g., when the system or programs where changed.

For tests which run time depends on the architecture of the computer, the expected test time factor can be given apart for each test system as equation arch = time_factor.

The string arch must be one of the results returned by the function sysname. time_factor is the time factor given by prog::testexit at the end of the complete test on the reference system.

Examples

Example 1

Initialize a test that should need a run time factor of 2.0:

prog::testinit("test1", 2.0):

Initialize a test that should need a run time factor of 2.8, where the time is measured between prog::testinit and prog::testexit:

prog::testinit("test2", 2.8, All):

Initialize a test that should need a run time factor of 12.0 on Linux® and 15.5 on Windows®:

prog::testinit("test3", "glnxa64" = 12.0, "win32" = 15.5):

Parameters

string

String: a test name

expected_time

Expected test time factor (see below) in seconds as floating point number

arch

The computer architecture name as string (see sysname)

Options

All

The base for the time factor is the whole time between the command prog::testinit and prog::testexit.

Return Values

prog::testinit returns the void object null().

See Also

MuPAD Functions

Was this topic helpful?