include/SDL_test_harness.h
changeset 6721 53b71f45a53a
parent 6717 2acd95060548
child 6756 398073b195bb
equal deleted inserted replaced
6720:5d20f1296bca 6721:53b71f45a53a
    47 
    47 
    48 //! Definitions for test case structures
    48 //! Definitions for test case structures
    49 #define TEST_ENABLED  1
    49 #define TEST_ENABLED  1
    50 #define TEST_DISABLED 0
    50 #define TEST_DISABLED 0
    51 
    51 
    52 //! Definitions of assert results
       
    53 #define ASSERT_PASS		1
       
    54 #define ASSERT_FAIL		0
       
    55 
       
    56 //! Definition of all the possible test return values of the test case method
    52 //! Definition of all the possible test return values of the test case method
    57 #define TEST_ABORTED		-1
    53 #define TEST_ABORTED		-1
    58 #define TEST_COMPLETED		 0
    54 #define TEST_COMPLETED		 0
    59 #define TEST_SKIPPED		 1
    55 #define TEST_SKIPPED		 1
    60 
    56 
    61 //! Definition of all the possible test results for the harness
    57 //! Definition of all the possible test results for the harness
    62 #define TEST_RESULT_PASSED			0
    58 #define TEST_RESULT_PASSED				0
    63 #define TEST_RESULT_FAILED			1
    59 #define TEST_RESULT_FAILED				1
    64 #define TEST_RESULT_NO_ASSERT			2
    60 #define TEST_RESULT_NO_ASSERT			2
    65 #define TEST_RESULT_SKIPPED			3
    61 #define TEST_RESULT_SKIPPED				3
    66 #define TEST_RESULT_KILLED			4
    62 #define TEST_RESULT_SETUP_FAILURE		4
    67 #define TEST_RESULT_SETUP_FAILURE		5
       
    68 
    63 
    69 //!< Function pointer to a test case setup function (run before every test)
    64 //!< Function pointer to a test case setup function (run before every test)
    70 typedef void (*SDLTest_TestCaseSetUpFp)(void *arg);
    65 typedef void (*SDLTest_TestCaseSetUpFp)(void *arg);
    71 
    66 
    72 //!< Function pointer to a test case function
    67 //!< Function pointer to a test case function
    90 } SDLTest_TestCaseReference;
    85 } SDLTest_TestCaseReference;
    91 
    86 
    92 /**
    87 /**
    93  * Holds information about a test suite (multiple test cases).
    88  * Holds information about a test suite (multiple test cases).
    94  */
    89  */
    95 typedef struct TestSuiteReference {
    90 typedef struct SDLTest_TestSuiteReference {
    96 	/*!< "PlatformSuite" */
    91 	/*!< "PlatformSuite" */
    97 	char *name;
    92 	char *name;
    98 	/*!< The function that is run before each test. NULL skips. */
    93 	/*!< The function that is run before each test. NULL skips. */
    99 	SDLTest_TestCaseSetUpFp testSetUp;
    94 	SDLTest_TestCaseSetUpFp testSetUp;
   100 	/*!< The test cases that are run as part of the suite. Last item should be NULL. */
    95 	/*!< The test cases that are run as part of the suite. Last item should be NULL. */
   101 	const SDLTest_TestCaseReference **testCases;
    96 	const SDLTest_TestCaseReference **testCases;
   102 	/*!< The function that is run after each test. NULL skips. */
    97 	/*!< The function that is run after each test. NULL skips. */
   103 	SDLTest_TestCaseTearDownFp testTearDown;
    98 	SDLTest_TestCaseTearDownFp testTearDown;
   104 } TestSuiteReference;
    99 } SDLTest_TestSuiteReference;
   105 
   100 
   106 /* Ends C function definitions when using C++ */
   101 /* Ends C function definitions when using C++ */
   107 #ifdef __cplusplus
   102 #ifdef __cplusplus
   108 /* *INDENT-OFF* */
   103 /* *INDENT-OFF* */
   109 }
   104 }