mapitest_suite.c File Reference

mapitest test suite functions More...

Functions

void mapitest_run_all (struct mapitest *mt)
 
bool mapitest_run_test (struct mapitest *mt, const char *name)
 
uint32_t mapitest_suite_add_test (struct mapitest_suite *suite, const char *name, const char *description, bool(*run)(struct mapitest *test))
 
uint32_t mapitest_suite_add_test_flagged (struct mapitest_suite *suite, const char *name, const char *description, bool(*run)(struct mapitest *test), enum TestApplicabilityFlags applicability)
 
struct mapitest_suitemapitest_suite_find (struct mapitest *mt, const char *name)
 
struct mapitest_suitemapitest_suite_init (struct mapitest *mt, const char *name, const char *description, bool online)
 
uint32_t mapitest_suite_register (struct mapitest *mt, struct mapitest_suite *suite)
 
bool mapitest_suite_run_test (struct mapitest *mt, struct mapitest_suite *suite, const char *name)
 

Detailed Description

mapitest test suite functions

Function Documentation

void mapitest_run_all ( struct mapitest mt)

all tests from all suites

Parameters
mtthe top-level mapitest structure
Returns
true on success, otherwise -1

References mapitest::mapi_suite, mapitest_print_module_title_end(), mapitest_print_module_title_start(), mapitest_suite::name, mapitest_suite::next, mapitest_suite::online, mapitest::online, and mapitest::session.

Referenced by main().

bool mapitest_run_test ( struct mapitest mt,
const char *  name 
)

run a specific test from a particular suite

Parameters
mtthe top-level mapitest structure
namethe mapitest test name
Returns
true on success, otherwise -1

References mapitest::mapi_suite, mapitest_suite_run_test(), mapitest_test::name, mapitest_test::next, mapitest_suite::next, mapitest_suite::online, mapitest::online, mapitest::session, and mapitest_suite::tests.

Referenced by main().

uint32_t mapitest_suite_add_test ( struct mapitest_suite suite,
const char *  name,
const char *  description,
bool(*)(struct mapitest *test)  run 
)

add a test to the mapitest suite with description

Parameters
suitepointer on the parent suite
namethe test name
descriptionthe test description
runthe test function
Returns
MAPITEST_SUCCESS on success, otherwise MAPITEST_ERROR
See Also
mapitest_suite_init, mapitest_suite_register
mapitest_suite_add_test_flagged for an alternative function allowing the test to only be run under some conditions.

References ApplicableToAllVersions, and mapitest_suite_add_test_flagged().

Referenced by module_errorchecks_init(), module_lcid_init(), module_mapidump_init(), module_noserver_init(), module_nspi_init(), module_oxcfold_init(), module_oxcfxics_init(), module_oxcmsg_init(), module_oxcperm_init(), module_oxcprpt_init(), module_oxcstor_init(), module_oxctable_init(), module_oxomsg_init(), and module_oxorule_init().

uint32_t mapitest_suite_add_test_flagged ( struct mapitest_suite suite,
const char *  name,
const char *  description,
bool(*)(struct mapitest *test)  run,
enum TestApplicabilityFlags  applicability 
)

add a test to the mapitest suite with description and flags

This is very similar to mapitest_suite_add_test(), except it allows a test to have special applicability (e.g. to only run when a particular server configuration is available).

Parameters
suitepointer to the parent test suite
namethe test name
descriptionthe test description
runthe test function
applicabilitya set of applicability flags
Returns
MAPITEST_SUCCESS on success, otherwise MAPITEST_ERROR
See Also
mapitest_suite_init, mapitest_suite_register, mapitest_suite_add_test

References mapitest_test::description, mapitest_test::flags, mapitest_test::fn, mapitest_test::name, mapitest_suite::name, mapitest_test::next, and mapitest_suite::tests.

Referenced by mapitest_suite_add_test(), module_lzxpress_init(), module_oxcmsg_init(), module_oxcnotif_init(), module_oxcprpt_init(), module_oxcstor_init(), and module_oxctable_init().

struct mapitest_suite* mapitest_suite_find ( struct mapitest mt,
const char *  name 
)

Find a suite given its name

Parameters
mttop-level mapitest structure
namethe suite name to be searched
Returns
Pointer on a suite on success, otherwise NULL

References mapitest::mapi_suite, mapitest_suite::name, and mapitest_suite::next.

struct mapitest_suite* mapitest_suite_init ( struct mapitest mt,
const char *  name,
const char *  description,
bool  online 
)
uint32_t mapitest_suite_register ( struct mapitest mt,
struct mapitest_suite suite 
)
bool mapitest_suite_run_test ( struct mapitest mt,
struct mapitest_suite suite,
const char *  name 
)

run a test from a suite given its name

Parameters
mtpointer on the top-level mapitest structure
suitepointer on the mapitest suite
namethe name of the test to be run
Returns
true on success, otherwise false

References mapitest_test::name, mapitest_test::next, and mapitest_suite::tests.

Referenced by mapitest_run_test().


Creative Commons License
Creative Commons Attribution icon Creative Commons Share Alike icon
This content is licensed under the Creative Commons
Attribution ShareAlike License v. 3.0:
http://creativecommons.org/licenses/by-sa/3.0/