Fix option for forced run of disabled tests in test harness
authorAndreas Schiffler <aschiffler@ferzkopp.net>
Sun, 06 Jul 2014 20:41:39 -0700
changeset 8975180271d72b1e
parent 8974 f813b8b10b55
child 8976 1a5d959d7b32
Fix option for forced run of disabled tests in test harness
src/test/SDL_test_harness.c
     1.1 --- a/src/test/SDL_test_harness.c	Fri Jul 04 17:20:22 2014 -0700
     1.2 +++ b/src/test/SDL_test_harness.c	Sun Jul 06 20:41:39 2014 -0700
     1.3 @@ -219,11 +219,12 @@
     1.4  * \param testSuite Suite containing the test case.
     1.5  * \param testCase Case to execute.
     1.6  * \param execKey Execution key for the fuzzer.
     1.7 +* \param forceTestRun Force test to run even if test was disabled in suite.
     1.8  *
     1.9  * \returns Test case result.
    1.10  */
    1.11  int
    1.12 -SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, SDLTest_TestCaseReference *testCase, Uint64 execKey)
    1.13 +SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, SDLTest_TestCaseReference *testCase, Uint64 execKey, SDL_bool forceTestRun)
    1.14  {
    1.15      SDL_TimerID timer = 0;
    1.16      int testCaseResult = 0;
    1.17 @@ -236,13 +237,12 @@
    1.18          return TEST_RESULT_SETUP_FAILURE;
    1.19      }
    1.20  
    1.21 -    if (!testCase->enabled)
    1.22 +	if (!testCase->enabled && forceTestRun == SDL_FALSE)
    1.23      {
    1.24          SDLTest_Log((char *)SDLTest_FinalResultFormat, "Test", testCase->name, "Skipped (Disabled)");
    1.25          return TEST_RESULT_SKIPPED;
    1.26      }
    1.27  
    1.28 -
    1.29      /* Initialize fuzzer */
    1.30      SDLTest_FuzzerInit(execKey);
    1.31  
    1.32 @@ -386,6 +386,7 @@
    1.33      char *suiteFilterName = NULL;
    1.34      int testFilter = 0;
    1.35      char *testFilterName = NULL;
    1.36 +	SDL_bool forceTestRun = SDL_FALSE;
    1.37      int testResult = 0;
    1.38      int runResult = 0;
    1.39      Uint32 totalTestFailedCount = 0;
    1.40 @@ -536,7 +537,7 @@
    1.41                      /* Override 'disabled' flag if we specified a test filter (i.e. force run for debugging) */
    1.42                      if (testFilter == 1 && !testCase->enabled) {
    1.43                          SDLTest_Log("Force run of disabled test since test filter was set");
    1.44 -                        testCase->enabled = 1;
    1.45 +						forceTestRun = SDL_TRUE;
    1.46                      }
    1.47  
    1.48                      /* Take time - test start */
    1.49 @@ -565,7 +566,7 @@
    1.50                          }
    1.51  
    1.52                          SDLTest_Log("Test Iteration %i: execKey %" SDL_PRIu64, iterationCounter, execKey);
    1.53 -                        testResult = SDLTest_RunTest(testSuite, testCase, execKey);
    1.54 +						testResult = SDLTest_RunTest(testSuite, testCase, execKey, forceTestRun);
    1.55  
    1.56                          if (testResult == TEST_RESULT_PASSED) {
    1.57                              testPassedCount++;