|
SDL
2.0
|
Include dependency graph for SDL_test_harness.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | SDLTest_TestCaseReference |
| struct | SDLTest_TestSuiteReference |
Macros | |
| #define | TEST_ENABLED 1 |
| #define | TEST_DISABLED 0 |
| #define | TEST_ABORTED -1 |
| #define | TEST_STARTED 0 |
| #define | TEST_COMPLETED 1 |
| #define | TEST_SKIPPED 2 |
| #define | TEST_RESULT_PASSED 0 |
| #define | TEST_RESULT_FAILED 1 |
| #define | TEST_RESULT_NO_ASSERT 2 |
| #define | TEST_RESULT_SKIPPED 3 |
| #define | TEST_RESULT_SETUP_FAILURE 4 |
Typedefs | |
| typedef void(* | SDLTest_TestCaseSetUpFp) (void *arg) |
| typedef int(* | SDLTest_TestCaseFp) (void *arg) |
| typedef void(* | SDLTest_TestCaseTearDownFp) (void *arg) |
Functions | |
| char * | SDLTest_GenerateRunSeed (const int length) |
| Generates a random run seed string for the harness. The generated seed will contain alphanumeric characters (0-9A-Z). More... | |
| int | SDLTest_RunSuites (SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations) |
| Execute a test suite using the given run seed and execution key. More... | |
Include file for SDL test framework.
This code is a part of the SDL2_test library, not the main SDL library.
Definition in file SDL_test_harness.h.
| #define TEST_ABORTED -1 |
Definition at line 51 of file SDL_test_harness.h.
| #define TEST_COMPLETED 1 |
Definition at line 53 of file SDL_test_harness.h.
| #define TEST_DISABLED 0 |
Definition at line 48 of file SDL_test_harness.h.
| #define TEST_ENABLED 1 |
Definition at line 47 of file SDL_test_harness.h.
| #define TEST_RESULT_FAILED 1 |
Definition at line 58 of file SDL_test_harness.h.
| #define TEST_RESULT_NO_ASSERT 2 |
Definition at line 59 of file SDL_test_harness.h.
| #define TEST_RESULT_PASSED 0 |
Definition at line 57 of file SDL_test_harness.h.
| #define TEST_RESULT_SETUP_FAILURE 4 |
Definition at line 61 of file SDL_test_harness.h.
| #define TEST_RESULT_SKIPPED 3 |
Definition at line 60 of file SDL_test_harness.h.
| #define TEST_SKIPPED 2 |
Definition at line 54 of file SDL_test_harness.h.
| #define TEST_STARTED 0 |
Definition at line 52 of file SDL_test_harness.h.
| typedef int(* SDLTest_TestCaseFp) (void *arg) |
Definition at line 67 of file SDL_test_harness.h.
Definition at line 64 of file SDL_test_harness.h.
Definition at line 70 of file SDL_test_harness.h.
| char* SDLTest_GenerateRunSeed | ( | const int | length | ) |
Generates a random run seed string for the harness. The generated seed will contain alphanumeric characters (0-9A-Z).
Note: The returned string needs to be deallocated by the caller.
| length | The length of the seed string to generate |
Generates a random run seed string for the harness. The generated seed will contain alphanumeric characters (0-9A-Z).
Note: The returned string needs to be deallocated by the caller.
| length | The length of the seed string to generate |
Definition at line 54 of file SDL_test_harness.c.
| int SDLTest_RunSuites | ( | SDLTest_TestSuiteReference * | testSuites[], |
| const char * | userRunSeed, | ||
| Uint64 | userExecKey, | ||
| const char * | filter, | ||
| int | testIterations | ||
| ) |
Execute a test suite using the given run seed and execution key.
| testSuites | Suites containing the test case. |
| userRunSeed | Custom run seed provided by user, or NULL to autogenerate one. |
| userExecKey | Custom execution key provided by user, or 0 to autogenerate one. |
| filter | Filter specification. NULL disables. Case sensitive. |
| testIterations | Number of iterations to run each test case. |
The filter string is matched to the suite name (full comparison) to select a single suite, or if no suite matches, it is matched to the test names (full comparison) to select a single test.
| testSuites | Suites containing the test case. |
| userRunSeed | Custom run seed provided by user, or NULL to autogenerate one. |
| userExecKey | Custom execution key provided by user, or 0 to autogenerate one. |
| filter | Filter specification. NULL disables. Case sensitive. |
| testIterations | Number of iterations to run each test case. |
Definition at line 370 of file SDL_test_harness.c.
References SDLTest_TestCaseReference::description, SDLTest_TestCaseReference::enabled, GetClock(), SDLTest_TestCaseReference::name, SDLTest_TestSuiteReference::name, NULL, SDL_ENOMEM, SDL_Error, SDL_FALSE, SDL_free, SDL_malloc, SDL_PRIu64, SDL_strcmp, SDL_TRUE, SDLTEST_FINAL_RESULT_FORMAT, SDLTest_GenerateExecKey(), SDLTest_GenerateRunSeed(), SDLTEST_INVALID_NAME_FORMAT, SDLTest_Log(), SDLTEST_LOG_SUMMARY_FORMAT, SDLTest_LogError(), SDLTest_RunTest(), TEST_RESULT_FAILED, TEST_RESULT_NO_ASSERT, TEST_RESULT_PASSED, TEST_RESULT_SKIPPED, SDLTest_TestSuiteReference::testCases, and testSuites.
Referenced by main().