Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

TestRun.h File Reference


Detailed Description

Test run management functions (user interface).

The TestRun module implements functions supporting the running of tests elements (suites and tests). This includes functions for running suites and tests, retrieving the number of tests/suites run, and managing callbacks during the run process.

The callback mechanism works as follows. The CUnit runtime system supports the registering and calling of functions at the start and end of each test, when all tests are complete, and when a suite initialialization function returns an error. This allows clients to perform actions associated with these events such as output formatting and reporting.

#include "CUnit.h"
#include "CUError.h"
#include "TestDB.h"

Go to the source code of this file.

Data Structures

struct  CU_FailureRecord
 Data type for holding assertion failure information (linked list). More...
struct  CU_RunSummary
 Data type for holding statistics and assertion failures for a test run. More...

Typedefs

typedef CU_FailureRecord CU_FailureRecord
 Data type for holding assertion failure information (linked list).
typedef CU_FailureRecordCU_pFailureRecord
 Pointer to CU_FailureRecord.
typedef CU_RunSummary CU_RunSummary
 Data type for holding statistics and assertion failures for a test run.
typedef CU_RunSummaryCU_pRunSummary
 Pointer to CU_RunSummary.
typedef void(* CU_TestStartMessageHandler )(const CU_pTest pTest, const CU_pSuite pSuite)
 Message handler called at the start of a test.
typedef void(* CU_TestCompleteMessageHandler )(const CU_pTest pTest, const CU_pSuite pSuite, const CU_pFailureRecord pFailure)
 Message handler called at the completion of a test.
typedef void(* CU_AllTestsCompleteMessageHandler )(const CU_pFailureRecord pFailure)
 Message handler called at the completion of a test run.
typedef void(* CU_SuiteInitFailureMessageHandler )(const CU_pSuite pSuite)
 Message handler called when a suite initializer fails.
typedef CU_FailureRecord _TestResult
typedef CU_pFailureRecord PTestResult

Functions

void CU_set_test_start_handler (CU_TestStartMessageHandler pTestStartMessage)
 Set the message handler to call before each test is run.
void CU_set_test_complete_handler (CU_TestCompleteMessageHandler pTestCompleteMessage)
 Set the message handler to call after each test is run.
void CU_set_all_test_complete_handler (CU_AllTestsCompleteMessageHandler pAllTestsCompleteMessage)
 Set the message handler to call after all tests have been run.
void CU_set_suite_init_failure_handler (CU_SuiteInitFailureMessageHandler pSuiteInitFailureMessage)
 Set the message handler to call when a suite initialization function returns an error.
CU_TestStartMessageHandler CU_get_test_start_handler (void)
 Retrieve the message handler called before each test is run.
CU_TestCompleteMessageHandler CU_get_test_complete_handler (void)
 Retrieve the message handler called after each test is run.
CU_AllTestsCompleteMessageHandler CU_get_all_test_complete_handler (void)
 Retrieve the message handler called after all tests are run.
CU_SuiteInitFailureMessageHandler CU_get_suite_init_failure_handler (void)
 Retrieve the message handler called when a suite initialization error occurs.
CU_ErrorCode CU_run_all_tests (void)
 Run all tests in all suites registered in the test registry.
CU_ErrorCode CU_run_suite (CU_pSuite pSuite)
 Run all tests in a specified suite.
CU_ErrorCode CU_run_test (CU_pSuite pSuite, CU_pTest pTest)
 Run a specific test in a specified suite.
unsigned int CU_get_number_of_suites_run (void)
 Retrieve the number of suites completed during the previous run.
unsigned int CU_get_number_of_suites_failed (void)
 Retrieve the number of suites which failed to initialize during the previous run.
unsigned int CU_get_number_of_tests_run (void)
 Retrieve the number of tests completed during the previous run.
unsigned int CU_get_number_of_tests_failed (void)
 Retrieve the number of tests which contained failed assertions during the previous run.
unsigned int CU_get_number_of_asserts (void)
 Retrieve the number of assertions processed during the last run.
unsigned int CU_get_number_of_successes (void)
 Retrieve the number of successful assertions during the last run.
unsigned int CU_get_number_of_failures (void)
 Retrieve the number of failed assertions during the last run.
unsigned int CU_get_number_of_failure_records (void)
 Retrieve the number failure records created during the previous run.
CU_pFailureRecord CU_get_failure_list (void)
 Retrieve the list of failures which occurred during the last test run.
CU_pRunSummary CU_get_run_summary (void)
 Retrieve the entire run summary for the last test run.
CU_pSuite CU_get_current_suite (void)
 Retrieve a pointer to the currently-running suite (NULL if none).
CU_pTest CU_get_current_test (void)
 Retrieve a pointer to the currently-running test (NULL if none).
BOOL CU_is_test_running (void)
 Returns TRUE if a test run is in progress, TRUE otherwise.
void CU_clear_previous_results (void)
 Initialize the run summary information stored from the previous test run.
BOOL CU_assertImplementation (BOOL bValue, unsigned int uiLine, char strCondition[], char strFile[], char strFunction[], BOOL bFatal)
 Assertion implementation function.
void test_cunit_TestRun (void)


Generated on Thu Apr 28 12:36:09 2005 for CUnit by  doxygen 1.3.9.1