blender/extern/sdlew/include/SDL2/SDL_test_harness.h
Sergey Sharybin 80d1d624d3 Support dynamic loading of SDL libraries
This is mainly to address old issue when one need to have SDL library installed
in order to use our official builds. Some hip distros already installs SDL,
but it's not quite the same across all the variety of the distros.

We also now switching to SDL-2.0, most of the distros have it in repositories
already, so it shouldn't be huge deal to install it if needed.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D878
2014-11-17 17:43:18 +05:00

68 lines
1.6 KiB
C

#ifndef _SDL_test_harness_h
#define _SDL_test_harness_h
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
//! Definitions for test case structures
#define TEST_ENABLED 1
#define TEST_DISABLED 0
//! Definition of all the possible test return values of the test case method
#define TEST_ABORTED -1
#define TEST_STARTED 0
#define TEST_COMPLETED 1
#define TEST_SKIPPED 2
//! Definition of all the possible test results for the harness
#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
//!< Function pointer to a test case setup function (run before every test)
typedef void (*SDLTest_TestCaseSetUpFp)(void *arg);
//!< Function pointer to a test case function
typedef int (*SDLTest_TestCaseFp)(void *arg);
//!< Function pointer to a test case teardown function (run after every test)
typedef void (*SDLTest_TestCaseTearDownFp)(void *arg);
typedef struct SDLTest_TestCaseReference {
SDLTest_TestCaseFp testCase;
char *name;
char *description;
int enabled;
} SDLTest_TestCaseReference;
typedef struct SDLTest_TestSuiteReference {
char *name;
SDLTest_TestCaseSetUpFp testSetUp;
const SDLTest_TestCaseReference **testCases;
SDLTest_TestCaseTearDownFp testTearDown;
} SDLTest_TestSuiteReference;
int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations);
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif