Skip to content

Commit

Permalink
Fix option for forced run of disabled tests in test harness
Browse files Browse the repository at this point in the history
  • Loading branch information
ferzkopp committed Jul 7, 2014
1 parent 9b1b74e commit ac112e5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/test/SDL_test_harness.c
Expand Up @@ -219,11 +219,12 @@ void
* \param testSuite Suite containing the test case.
* \param testCase Case to execute.
* \param execKey Execution key for the fuzzer.
* \param forceTestRun Force test to run even if test was disabled in suite.
*
* \returns Test case result.
*/
int
SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, SDLTest_TestCaseReference *testCase, Uint64 execKey)
SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, SDLTest_TestCaseReference *testCase, Uint64 execKey, SDL_bool forceTestRun)
{
SDL_TimerID timer = 0;
int testCaseResult = 0;
Expand All @@ -236,13 +237,12 @@ SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, SDLTest_TestCaseReference
return TEST_RESULT_SETUP_FAILURE;
}

if (!testCase->enabled)
if (!testCase->enabled && forceTestRun == SDL_FALSE)
{
SDLTest_Log((char *)SDLTest_FinalResultFormat, "Test", testCase->name, "Skipped (Disabled)");
return TEST_RESULT_SKIPPED;
}


/* Initialize fuzzer */
SDLTest_FuzzerInit(execKey);

Expand Down Expand Up @@ -386,6 +386,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
char *suiteFilterName = NULL;
int testFilter = 0;
char *testFilterName = NULL;
SDL_bool forceTestRun = SDL_FALSE;
int testResult = 0;
int runResult = 0;
Uint32 totalTestFailedCount = 0;
Expand Down Expand Up @@ -536,7 +537,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
/* Override 'disabled' flag if we specified a test filter (i.e. force run for debugging) */
if (testFilter == 1 && !testCase->enabled) {
SDLTest_Log("Force run of disabled test since test filter was set");
testCase->enabled = 1;
forceTestRun = SDL_TRUE;
}

/* Take time - test start */
Expand Down Expand Up @@ -565,7 +566,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
}

SDLTest_Log("Test Iteration %i: execKey %" SDL_PRIu64, iterationCounter, execKey);
testResult = SDLTest_RunTest(testSuite, testCase, execKey);
testResult = SDLTest_RunTest(testSuite, testCase, execKey, forceTestRun);

if (testResult == TEST_RESULT_PASSED) {
testPassedCount++;
Expand Down

0 comments on commit ac112e5

Please sign in to comment.