utils/mapitest/mapitest_suite.c File Reference

mapitest test suite functions More...

Functions

bool 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

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

run a specific test from a particular suite

Parameters:
mt the top-level mapitest structure
name the 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, 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:
suite pointer on the parent suite
name the test name
description the test description
run the 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_oxcnotif_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:
suite pointer to the parent test suite
name the test name
description the test description
run the test function
applicability a 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_test::next, and mapitest_suite::tests.

Referenced by mapitest_suite_add_test(), and module_oxcstor_init().

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

Find a suite given its name

Parameters:
mt top-level mapitest structure
name the 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 
) [read]

Initialize a mapitest suite

Parameters:
mt the top-level mapitest structure
name the suite name
description the suite description
online whether this suite requires online (server) access
Returns:
An allocated mapitest_suite pointer, otherwise NULL.

References mapitest_stat_init(), mapitest::mem_ctx, mapitest_suite::stat, and mapitest_suite::tests.

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_oxcnotif_init(), module_oxcprpt_init(), module_oxcstor_init(), module_oxctable_init(), module_oxomsg_init(), and module_oxorule_init().

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:
mt pointer on the top-level mapitest structure
suite pointer on the mapitest suite
name the name of the test to be run
Returns:
true on success, otherwise false

References mapitest_test::flags, mapitest_test::fn, mapitest_print_test_result(), mapitest_print_test_title_end(), mapitest_print_test_title_start(), mapitest_stat_add_result(), mapitest_stat_add_skipped_test(), 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/