SDL_test_harness.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef _SDL_test_harness_h
  2. #define _SDL_test_harness_h
  3. #include "begin_code.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. //! Definitions for test case structures
  8. #define TEST_ENABLED 1
  9. #define TEST_DISABLED 0
  10. //! Definition of all the possible test return values of the test case method
  11. #define TEST_ABORTED -1
  12. #define TEST_STARTED 0
  13. #define TEST_COMPLETED 1
  14. #define TEST_SKIPPED 2
  15. //! Definition of all the possible test results for the harness
  16. #define TEST_RESULT_PASSED 0
  17. #define TEST_RESULT_FAILED 1
  18. #define TEST_RESULT_NO_ASSERT 2
  19. #define TEST_RESULT_SKIPPED 3
  20. #define TEST_RESULT_SETUP_FAILURE 4
  21. //!< Function pointer to a test case setup function (run before every test)
  22. typedef void (*SDLTest_TestCaseSetUpFp)(void *arg);
  23. //!< Function pointer to a test case function
  24. typedef int (*SDLTest_TestCaseFp)(void *arg);
  25. //!< Function pointer to a test case teardown function (run after every test)
  26. typedef void (*SDLTest_TestCaseTearDownFp)(void *arg);
  27. typedef struct SDLTest_TestCaseReference {
  28. SDLTest_TestCaseFp testCase;
  29. char *name;
  30. char *description;
  31. int enabled;
  32. } SDLTest_TestCaseReference;
  33. typedef struct SDLTest_TestSuiteReference {
  34. char *name;
  35. SDLTest_TestCaseSetUpFp testSetUp;
  36. const SDLTest_TestCaseReference **testCases;
  37. SDLTest_TestCaseTearDownFp testTearDown;
  38. } SDLTest_TestSuiteReference;
  39. int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations);
  40. #ifdef __cplusplus
  41. }
  42. #endif
  43. #include "close_code.h"
  44. #endif