MGunit documentation

Unit testing for IDL

single page | use frames     summary     class     fields     routine details     file attributes

./

mguttestcase__define.pro

Subclass MGtestCase to actually write tests. Any function method whose name starts with "test" will be considered a test. Tests are executed and results are reported to the test runner object.

Class description for mguttestcase

Properties

npass get
testnames get
nfail get
test_runner init
ntests get

Fields

npass 0L

number of passing tests

testnames ptr_new()

pointer to string array of method names that start with "test"

nfail 0L

number of failing tests

testRunner obj_new()

subclass of MGtestRunner

level 0L

number of layers down from the top-containing suite

time 0.0000000D

time for the current test to run

ntests 0L

total number of tests

Routines

mguttestcase::setup

Override in subclasses to perform setup actions before each test.

mguttestcase::teardown

Override in subclasses to perform teardown actions after each test.

result = mguttestcase::runTest(testname [, message=string])

This is a safe place to actually run a single test.

mguttestcase::_runSetup [, /fail]

Run setup method before each test.

mguttestcase::_runTeardown [, /fail]

Run teardown method before each test.

mguttestcase::_removePrefix, msg, prefix

Removes the given prefix from the msg if present.

mguttestcase::run

Run the tests for this class (i.e.

mguttestcase::findTestnames

Find the name and number of tests (i.e.

mguttestcase::getProperty [, npass=integer] [, nfail=integer] [, ntests=integer] [, testnames=strarr]

Get properties of the object.

mguttestcase::setLevel, level

Test suites can contain other test suites or test cases.

mguttestcase::cleanup

Free resources.

result = mguttestcase::init(test_runner=object)

Intialize test case.

mguttestcase__define

Define member variables.

Routine details

topmguttestcase::setup

mguttestcase::setup

Override in subclasses to perform setup actions before each test.

topmguttestcase::teardown

mguttestcase::teardown

Override in subclasses to perform teardown actions after each test.

topmguttestcase::runTest

result = mguttestcase::runTest(testname [, message=string])

This is a safe place to actually run a single test. Any errors that occur are assumed to be from the test and recorded as a failure for it.

Return value

boolean

Parameters

testname in required type=string

name of method

Keywords

message out optional type=string

error message if test failed

topmguttestcase::_runSetup

mguttestcase::_runSetup [, /fail]

Run setup method before each test.

Keywords

fail out optional type=boolean

set to a named variable to determine if the setup method failed

topmguttestcase::_runTeardown

mguttestcase::_runTeardown [, /fail]

Run teardown method before each test.

Keywords

fail out optional type=boolean

set to a named variable to determine if the teardown method failed

topmguttestcase::_removePrefix

mguttestcase::_removePrefix, msg, prefix

Removes the given prefix from the msg if present.

Parameters

msg in required type=string

string to remove prefix from, may be undefined

prefix in required type=string

prefix to remove from msg

topmguttestcase::run

mguttestcase::run

Run the tests for this class (i.e. methods with names that start with "test").

topmguttestcase::findTestnames

mguttestcase::findTestnames

Find the name and number of tests (i.e. methods with names that start with "test").

topmguttestcase::getProperty

mguttestcase::getProperty [, npass=integer] [, nfail=integer] [, ntests=integer] [, testnames=strarr]

Get properties of the object.

Keywords

npass out optional type=integer

number of passing tests

nfail out optional type=integer

number of failing tests

ntests out optional type=integer

number of tests

testnames out optional type=strarr

array of method names which begin with "test"

topmguttestcase::setLevel

mguttestcase::setLevel, level

Test suites can contain other test suites or test cases. The level is the number of layers down from the top most test suite (level 0).

Parameters

level in required type=integer

new level of object

topmguttestcase::cleanup

mguttestcase::cleanup

Free resources.

topmguttestcase::init

result = mguttestcase::init(test_runner=object)

Intialize test case.

Return value

1 for succcess, 0 for failure

Keywords

test_runner in required type=object

subclass of MGutTestRunner

topmguttestcase__define

mguttestcase__define

Define member variables.

File attributes

Modification date: Wed Apr 22 23:28:57 2009
Lines: 330
Docformat: rst rst