MG Library

Library of Michael Galloy

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

mgunit/

mgtestcase__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 mgtestcase

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

ntests 0L

total number of tests

Routines

mgtestcase::setup

Override in subclasses to perform setup actions before each test.

mgtestcase::teardown

Override in subclasses to perform teardown actions after each test.

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

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

mgtestcase::run

Run the tests for this class (i.e.

mgtestcase::findTestnames

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

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

Get properties of the object.

mgtestcase::setLevel, level

Test suites can contain other test suites or test cases.

mgtestcase::cleanup

Free resources.

result = mgtestcase::init(test_runner=object)

Intialize test case.

mgtestcase__define

Define member variables.

Routine details

topmgtestcase::setup

mgtestcase::setup

Override in subclasses to perform setup actions before each test.

topmgtestcase::teardown

mgtestcase::teardown

Override in subclasses to perform teardown actions after each test.

topmgtestcase::runTest

result = mgtestcase::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

topmgtestcase::run

mgtestcase::run

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

topmgtestcase::findTestnames

mgtestcase::findTestnames

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

topmgtestcase::getProperty

mgtestcase::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"

topmgtestcase::setLevel

mgtestcase::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

topmgtestcase::cleanup

mgtestcase::cleanup

Free resources.

topmgtestcase::init

result = mgtestcase::init(test_runner=object)

Intialize test case.

Return value

1 for succcess, 0 for failure

Keywords

test_runner in required type=object

subclass of MGtestRunner

topmgtestcase__define

mgtestcase__define

Define member variables.

File attributes

Modification date: Tue Nov 20 11:24:27 2007
Lines: 210