Adding elementary support for fuzzing.
authorMarkus Kauppila
Sun, 24 Jul 2011 18:21:53 +0300
changeset 57806d294a397a27
parent 5779 783229e9c08d
child 5781 7ff8df8e36f2
Adding elementary support for fuzzing.
New options: --seed [VALUE] --exec-key [EXEC-KEY] --iterations VALUE
test/test-automation/Makefile.am
test/test-automation/SDL_test.c
test/test-automation/SDL_test.h
test/test-automation/logger.h
test/test-automation/plain_logger.c
test/test-automation/plain_logger.h
test/test-automation/runner.c
test/test-automation/testdummy/testdummy.c
test/test-automation/testrect/testrect.c
test/test-automation/xml_logger.c
test/test-automation/xml_logger.h
     1.1 --- a/test/test-automation/Makefile.am	Thu Jul 21 14:22:17 2011 +0300
     1.2 +++ b/test/test-automation/Makefile.am	Sun Jul 24 18:21:53 2011 +0300
     1.3 @@ -1,16 +1,20 @@
     1.4  ACLOCAL_AMFLAGS = -I acinclude -I build-scripts
     1.5  
     1.6  SUBDIRS = testdummy testrect testplatform testaudio testsurface
     1.7 +runnerdir = .
     1.8  
     1.9  bin_PROGRAMS = runner
    1.10 -runner_SOURCES = runner.c support.c 
    1.11 +runner_SOURCES = runner.c support.c
    1.12 +##nobase_runner_HEADERS = fuzzer.h logger.h plain_logger.h  xml_logger.h xml.h
    1.13  runner_CLAGS = -W -Wall -Wextra -g `sdl-config --cflags` -DSDL_NO_COMPAT
    1.14  runner_LDADD = libtest.la
    1.15 -runner_LDFLAGS = `sdl-config --libs` 
    1.16 +runner_LDFLAGS = `sdl-config --libs`
    1.17 +## -I .libs/libtest.so
    1.18  
    1.19  lib_LTLIBRARIES = libtest.la
    1.20  libtest_la_SOURCES = SDL_test.c logger_helpers.c plain_logger.c xml_logger.c xml.c \
    1.21 -	common/common.c common/img_blit.c common/img_blitblend.c common/img_face.c common/img_primitives.c common/img_primitivesblend.c
    1.22 +	common/common.c common/img_blit.c common/img_blitblend.c common/img_face.c common/img_primitives.c common/img_primitivesblend.c \
    1.23 +	fuzzer/utl_crc32.c fuzzer/utl_md5.c fuzzer/utl_random.c fuzzer/fuzzer.c
    1.24  libtest_la_CLAGS = -fPIC -g
    1.25  libtest_la_LDFLAGS = `sdl-config --libs`
    1.26  
     2.1 --- a/test/test-automation/SDL_test.c	Thu Jul 21 14:22:17 2011 +0300
     2.2 +++ b/test/test-automation/SDL_test.c	Sun Jul 24 18:21:53 2011 +0300
     2.3 @@ -23,6 +23,7 @@
     2.4  #include <time.h>
     2.5  
     2.6  #include "logger.h"
     2.7 +#include "fuzzer/fuzzer.h"
     2.8  
     2.9  #include "SDL_test.h"
    2.10  
    2.11 @@ -36,8 +37,13 @@
    2.12  int _testAssertsPassed;
    2.13  
    2.14  void
    2.15 -_InitTestEnvironment()
    2.16 +_InitTestEnvironment(const int execKey)
    2.17  {
    2.18 +	// The execKey gets corrupted while passing arguments
    2.19 +	// hence the global variable to circumvent the problem
    2.20 +	InitFuzzer(globalExecKey);
    2.21 +
    2.22 +
    2.23  	_testReturnValue = TEST_RESULT_PASS;
    2.24  	_testAssertsFailed = 0;
    2.25  	_testAssertsPassed = 0;
    2.26 @@ -53,6 +59,8 @@
    2.27  		_testReturnValue = TEST_RESULT_NO_ASSERT;
    2.28  	}
    2.29  
    2.30 +	DeinitFuzzer();
    2.31 +
    2.32  	return _testReturnValue;
    2.33  }
    2.34  
    2.35 @@ -61,6 +69,7 @@
    2.36  	return _testAssertsFailed;
    2.37  }
    2.38  
    2.39 +
    2.40  void
    2.41  AssertEquals(int expected, int actual, char *message, ...)
    2.42  {
     3.1 --- a/test/test-automation/SDL_test.h	Thu Jul 21 14:22:17 2011 +0300
     3.2 +++ b/test/test-automation/SDL_test.h	Sun Jul 24 18:21:53 2011 +0300
     3.3 @@ -26,6 +26,7 @@
     3.4  #include "common/common.h"
     3.5  #include "common/images.h"
     3.6  
     3.7 +#include "fuzzer/fuzzer.h"
     3.8  
     3.9  extern int _testReturnValue;
    3.10  extern int _testAssertsFailed;
    3.11 @@ -68,7 +69,7 @@
    3.12   *  Initialized the test environment such as asserts. Must be called at
    3.13   *  the beginning of every test case, before doing anything else.
    3.14   */
    3.15 -void _InitTestEnvironment();
    3.16 +void _InitTestEnvironment(const int execKey);
    3.17  
    3.18  /*!
    3.19   *  Deinitializes the test environment and
     4.1 --- a/test/test-automation/logger.h	Thu Jul 21 14:22:17 2011 +0300
     4.2 +++ b/test/test-automation/logger.h	Sun Jul 24 18:21:53 2011 +0300
     4.3 @@ -37,7 +37,7 @@
     4.4  		                time_t endTime, double totalRuntime);
     4.5  
     4.6  typedef	void (*TestStartedFp)(const char *testName, const char *suiteName,
     4.7 -                              const char *testDescription, time_t startTime);
     4.8 +                              const char *testDescription, int execKey, time_t startTime);
     4.9  typedef	void (*TestEndedFp)(const char *testName, const char *suiteName, int testResult,
    4.10                              time_t endTime, double totalRuntime);
    4.11  
    4.12 @@ -67,4 +67,9 @@
    4.13  extern AssertSummaryFp AssertSummary;
    4.14  extern LogFp Log;
    4.15  
    4.16 +extern int globalExecKey;
    4.17 +//! Run seed for harness
    4.18 +extern const char *runSeed;
    4.19 +
    4.20 +
    4.21  #endif
     5.1 --- a/test/test-automation/plain_logger.c	Thu Jul 21 14:22:17 2011 +0300
     5.2 +++ b/test/test-automation/plain_logger.c	Sun Jul 24 18:21:53 2011 +0300
     5.3 @@ -80,9 +80,10 @@
     5.4  }
     5.5  
     5.6  void
     5.7 -PlainTestStarted(const char *testName, const char *suiteName, const char *testDescription, time_t startTime)
     5.8 +PlainTestStarted(const char *testName, const char *suiteName,
     5.9 +				const char *testDescription, int execKey, time_t startTime)
    5.10  {
    5.11 -	Output(indentLevel++, "Executing test: %s (in %s)", testName, suiteName);
    5.12 +	Output(indentLevel++, "Executing test: %s (in %s). Execution key: %d", testName, suiteName, execKey);
    5.13  }
    5.14  
    5.15  void
     6.1 --- a/test/test-automation/plain_logger.h	Thu Jul 21 14:22:17 2011 +0300
     6.2 +++ b/test/test-automation/plain_logger.h	Sun Jul 24 18:21:53 2011 +0300
     6.3 @@ -55,10 +55,11 @@
     6.4   * \param testName Name of the test that'll be executed
     6.5   * \param suiteName Name of the suite of the test
     6.6   * \param testDescription Description of the test
     6.7 + * \param execKey Execution key for fuzzing
     6.8   * \param startTime When the test started to execute
     6.9   */
    6.10  void PlainTestStarted(const char *testName, const char *suiteName,
    6.11 -                      const char *testDescription, time_t startTime);
    6.12 +                      const char *testDescription, int execKey, time_t startTime);
    6.13  
    6.14  /*!
    6.15   * Prints information about the test test that was just executed
     7.1 --- a/test/test-automation/runner.c	Thu Jul 21 14:22:17 2011 +0300
     7.2 +++ b/test/test-automation/runner.c	Sun Jul 24 18:21:53 2011 +0300
     7.3 @@ -28,6 +28,9 @@
     7.4  
     7.5  #include <sys/types.h>
     7.6  
     7.7 +#include "fuzzer/fuzzer.h"
     7.8 +
     7.9 +
    7.10  #include "config.h"
    7.11  
    7.12  #include "SDL_test.h"
    7.13 @@ -82,12 +85,24 @@
    7.14  
    7.15  //! Name for user-supplied XSL style sheet name
    7.16  char xsl_stylesheet_name[NAME_BUFFER_SIZE];
    7.17 -
    7.18 +//! User-suppled timeout value for tests
    7.19  int universal_timeout = -1;
    7.20  
    7.21  //! Default directory of the test suites
    7.22  #define DEFAULT_TEST_DIRECTORY "tests/"
    7.23  
    7.24 +int globalExecKey = -1;
    7.25 +const char *runSeed = "seed";
    7.26 +
    7.27 +int userExecKey = 0;
    7.28 +
    7.29 +//! How man time a test will be invocated
    7.30 +int testInvocationCount = 1;
    7.31 +
    7.32 +// \todo move this upper!! (and add comments)
    7.33 +int totalTestFailureCount = 0, totalTestPassCount = 0, totalTestSkipCount = 0;
    7.34 +int testFailureCount = 0, testPassCount = 0, testSkipCount = 0;
    7.35 +
    7.36  
    7.37  /*!
    7.38   * Holds information about test suite such as it's name
    7.39 @@ -674,8 +689,12 @@
    7.40   * \param test result
    7.41   */
    7.42  int
    7.43 -RunTest(TestCase *testCase)
    7.44 +RunTest(TestCase *testCase, const int execKey)
    7.45  {
    7.46 +	if(!testCase) {
    7.47 +		return -1;
    7.48 +	}
    7.49 +
    7.50  	int runnable = CheckTestRequirements(testCase);
    7.51  	if(runnable != 1) {
    7.52  		return TEST_RESULT_SKIPPED;
    7.53 @@ -719,15 +738,15 @@
    7.54   * \return The return value of the test. Zero means success, non-zero failure.
    7.55   */
    7.56  int
    7.57 -ExecuteTest(TestCase *testItem) {
    7.58 +ExecuteTest(TestCase *testItem, const int execKey) {
    7.59  	int retVal = -1;
    7.60  
    7.61  	if(execute_inproc) {
    7.62 -		retVal = RunTest(testItem);
    7.63 +		retVal = RunTest(testItem, execKey);
    7.64  	} else {
    7.65  		int childpid = fork();
    7.66  		if(childpid == 0) {
    7.67 -			exit(RunTest(testItem));
    7.68 +			exit(RunTest(testItem, execKey));
    7.69  		} else {
    7.70  			int stat_lock = -1;
    7.71  			int child = wait(&stat_lock);
    7.72 @@ -736,6 +755,20 @@
    7.73  		}
    7.74  	}
    7.75  
    7.76 +	if(retVal == TEST_RESULT_SKIPPED) {
    7.77 +		testSkipCount++;
    7.78 +		totalTestSkipCount++;
    7.79 +	}
    7.80 +	else if(retVal) {
    7.81 +		totalTestFailureCount++;
    7.82 +		testFailureCount++;
    7.83 +	}
    7.84 +	else {
    7.85 +		totalTestPassCount++;
    7.86 +		testPassCount++;
    7.87 +	}
    7.88 +
    7.89 +	// return the value for logger
    7.90  	return retVal;
    7.91  }
    7.92  
    7.93 @@ -890,6 +923,40 @@
    7.94  
    7.95      	  universal_timeout = atoi(timeoutString);
    7.96        }
    7.97 +      else if(SDL_strcmp(arg, "--seed") == 0) {
    7.98 +    	  if( (i + 1) < argc)  {
    7.99 +    		  runSeed = argv[++i];
   7.100 +    	  }  else {
   7.101 +    		  printf("runner: seed value is missing\n");
   7.102 +    		  PrintUsage();
   7.103 +    		  exit(1);
   7.104 +    	  }
   7.105 +    	  //!\todo should the seed be copied to a buffer?
   7.106 +      }
   7.107 +      else if(SDL_strcmp(arg, "--iterations") == 0) {
   7.108 +    	  char *iterationsString = NULL;
   7.109 +    	  if( (i + 1) < argc)  {
   7.110 +    		  iterationsString = argv[++i];
   7.111 +    	  }  else {
   7.112 +    		  printf("runner: iterations value is missing\n");
   7.113 +    		  PrintUsage();
   7.114 +    		  exit(1);
   7.115 +    	  }
   7.116 +
   7.117 +    	  testInvocationCount = atoi(iterationsString);
   7.118 +      }
   7.119 +      else if(SDL_strcmp(arg, "--exec-key") == 0) {
   7.120 +    	  char *execKeyString = NULL;
   7.121 +    	  if( (i + 1) < argc)  {
   7.122 +    		  execKeyString = argv[++i];
   7.123 +    	  }  else {
   7.124 +    		  printf("runner: execkey value is missing\n");
   7.125 +    		  PrintUsage();
   7.126 +    		  exit(1);
   7.127 +    	  }
   7.128 +
   7.129 +    	  userExecKey = atoi(execKeyString);
   7.130 +      }
   7.131        else if(SDL_strcmp(arg, "--test") == 0 || SDL_strcmp(arg, "-t") == 0) {
   7.132      	  only_selected_test = 1;
   7.133      	  char *testName = NULL;
   7.134 @@ -976,10 +1043,12 @@
   7.135  {
   7.136  	ParseOptions(argc, argv);
   7.137  
   7.138 +	CRC32_CTX crcContext;
   7.139 +	utl_crc32Init(&crcContext);
   7.140 +
   7.141  	// print: Testing against SDL version fuu (rev: bar) if verbose == true
   7.142  
   7.143 -	int totalTestFailureCount = 0, totalTestPassCount = 0, totalTestSkipCount = 0;
   7.144 -	int testFailureCount = 0, testPassCount = 0, testSkipCount = 0;
   7.145 +
   7.146  	char *testSuiteName = NULL;
   7.147  	int suiteCounter = 0;
   7.148  
   7.149 @@ -1021,54 +1090,56 @@
   7.150  	char *currentSuiteName = NULL;
   7.151  	int suiteStartTime = SDL_GetTicks();
   7.152  
   7.153 +	int notFirstSuite = 0;
   7.154 +	int startNewSuite = 1;
   7.155  	TestCase *testItem = NULL;
   7.156  	for(testItem = testCases; testItem; testItem = testItem->next) {
   7.157 -		if(currentSuiteName == NULL) {
   7.158 -			currentSuiteName = testItem->suiteName;
   7.159 -			SuiteStarted(currentSuiteName, time(0));
   7.160 -
   7.161 -			testFailureCount = testPassCount = testSkipCount = 0;
   7.162 +		if(currentSuiteName && strncmp(currentSuiteName, testItem->suiteName, NAME_BUFFER_SIZE) != 0) {
   7.163 +			startNewSuite = 1;
   7.164 +		}
   7.165  
   7.166 -			suiteCounter++;
   7.167 -		}
   7.168 -		else if(strncmp(currentSuiteName, testItem->suiteName, NAME_BUFFER_SIZE) != 0) {
   7.169 -			const double suiteRuntime = (SDL_GetTicks() - suiteStartTime) / 1000.0f;
   7.170 +		if(startNewSuite) {
   7.171 +			if(notFirstSuite) {
   7.172 +				const double suiteRuntime = (SDL_GetTicks() - suiteStartTime) / 1000.0f;
   7.173  
   7.174 -			SuiteEnded(testPassCount, testFailureCount, testSkipCount, time(0),
   7.175 -						suiteRuntime);
   7.176 +				SuiteEnded(testPassCount, testFailureCount, testSkipCount, time(0),
   7.177 +							suiteRuntime);
   7.178 +			}
   7.179  
   7.180  			suiteStartTime = SDL_GetTicks();
   7.181  
   7.182  			currentSuiteName = testItem->suiteName;
   7.183  			SuiteStarted(currentSuiteName, time(0));
   7.184 +			testFailureCount = testPassCount = testSkipCount = 0;
   7.185 +			suiteCounter++;
   7.186  
   7.187 -			testFailureCount = testPassCount = testSkipCount = 0;
   7.188 -
   7.189 -			suiteCounter++;
   7.190 +			startNewSuite = 0;
   7.191 +			notFirstSuite = 1;
   7.192  		}
   7.193  
   7.194 -		TestStarted(testItem->testName, testItem->suiteName,
   7.195 -                    testItem->description, time(0));
   7.196 -
   7.197 -		const Uint32 testTimeStart = SDL_GetTicks();
   7.198 +		int currentIteration = testInvocationCount;
   7.199 +		while(currentIteration > 0) {
   7.200 +			if(userExecKey != 0) {
   7.201 +				globalExecKey = userExecKey;
   7.202 +			} else {
   7.203 +				const int execKey = GenerateExecKey(crcContext, runSeed, testItem->suiteName,
   7.204 +											  testItem->testName, currentIteration);
   7.205 +				globalExecKey = execKey;
   7.206 +			}
   7.207  
   7.208 -		int retVal = ExecuteTest(testItem);
   7.209 -		if(retVal == 3) {
   7.210 -			testSkipCount++;
   7.211 -			totalTestSkipCount++;
   7.212 +			TestStarted(testItem->testName, testItem->suiteName,
   7.213 +						testItem->description, globalExecKey, time(0));
   7.214 +
   7.215 +			const Uint32 testTimeStart = SDL_GetTicks();
   7.216 +
   7.217 +			int retVal = ExecuteTest(testItem, globalExecKey);
   7.218 +
   7.219 +			const double testTotalRuntime = (SDL_GetTicks() - testTimeStart) / 1000.0f;
   7.220 +
   7.221 +			TestEnded(testItem->testName, testItem->suiteName, retVal, time(0), testTotalRuntime);
   7.222 +
   7.223 +			currentIteration--;
   7.224  		}
   7.225 -		else if(retVal) {
   7.226 -			totalTestFailureCount++;
   7.227 -			testFailureCount++;
   7.228 -		}
   7.229 -		else {
   7.230 -			totalTestPassCount++;
   7.231 -			testPassCount++;
   7.232 -		}
   7.233 -
   7.234 -		const double testTotalRuntime = (SDL_GetTicks() - testTimeStart) / 1000.0f;
   7.235 -
   7.236 -		TestEnded(testItem->testName, testItem->suiteName, retVal, time(0), testTotalRuntime);
   7.237  	}
   7.238  
   7.239  	if(currentSuiteName) {
   7.240 @@ -1082,11 +1153,13 @@
   7.241  	const Uint32 endTicks = SDL_GetTicks();
   7.242  	const double totalRunTime = (endTicks - startTicks) / 1000.0f;
   7.243  
   7.244 -	RunEnded(totalTestPassCount + totalTestFailureCount, suiteCounter,
   7.245 +	RunEnded(totalTestPassCount + totalTestFailureCount + totalTestSkipCount, suiteCounter,
   7.246  			 totalTestPassCount, totalTestFailureCount, totalTestSkipCount, time(0), totalRunTime);
   7.247  
   7.248  	// Some SDL subsystem might be init'ed so shut them down
   7.249  	SDL_Quit();
   7.250  
   7.251 +	utl_crc32Done(&crcContext);
   7.252 +
   7.253  	return (totalTestFailureCount ? 1 : 0);
   7.254  }
     8.1 --- a/test/test-automation/testdummy/testdummy.c	Thu Jul 21 14:22:17 2011 +0300
     8.2 +++ b/test/test-automation/testdummy/testdummy.c	Sun Jul 24 18:21:53 2011 +0300
     8.3 @@ -29,6 +29,7 @@
     8.4  #include <SDL/SDL.h>
     8.5  
     8.6  #include "../SDL_test.h"
     8.7 +//#include "fuzzer/fuzzer.h"
     8.8  
     8.9  /* Test case references */
    8.10  static const TestCaseReference test1 =
    8.11 @@ -89,6 +90,18 @@
    8.12  dummycase1(void *arg)
    8.13  {
    8.14  	AssertEquals(5, 5, "Assert message");
    8.15 +
    8.16 +	for(; 0 ;) {
    8.17 +		int min = 50;
    8.18 +		int max = 69;
    8.19 +		int random =  RandomPositiveIntegerInRange(min, max);
    8.20 +		if(random < min || random > max ) {
    8.21 +			AssertFail("Generated incorrect integer");
    8.22 +		}
    8.23 +		Log(0, "%d", random);
    8.24 +	}
    8.25 +
    8.26 +	//Log(0, "Random: %s", RandomAsciiString());
    8.27  }
    8.28  
    8.29  void
     9.1 --- a/test/test-automation/testrect/testrect.c	Thu Jul 21 14:22:17 2011 +0300
     9.2 +++ b/test/test-automation/testrect/testrect.c	Sun Jul 24 18:21:53 2011 +0300
     9.3 @@ -12,9 +12,14 @@
     9.4  static const TestCaseReference test1 =
     9.5  		(TestCaseReference){ "rect_testIntersectRectAndLine", "description", TEST_ENABLED, 0, 0 };
     9.6  
     9.7 +static const TestCaseReference test2 =
     9.8 +		(TestCaseReference){ "rect_testIntersectRectAndLineFuzzed", "Tests rect to line intersection with fuzzed values", TEST_ENABLED, 0, 0 };
     9.9 +
    9.10 +
    9.11 +
    9.12  /* Test suite */
    9.13  extern const TestCaseReference *testSuite[] =  {
    9.14 -	&test1, NULL
    9.15 +	&test1, &test2, NULL
    9.16  };
    9.17  
    9.18  TestCaseReference **QueryTestSuite() {
    9.19 @@ -23,6 +28,9 @@
    9.20  
    9.21  /*!
    9.22   * \brief Tests SDL_IntersectRectAndLine()
    9.23 + *
    9.24 + * \sa
    9.25 + * http://wiki.libsdl.org/moin.cgi/SDL_IntersectRectAndLine
    9.26   */
    9.27  int rect_testIntersectRectAndLine (void *arg)
    9.28  {
    9.29 @@ -131,3 +139,29 @@
    9.30          "diagonal line to upper right was incorrectly clipped: %d,%d - %d,%d",
    9.31          x1, y1, x2, y2);
    9.32  }
    9.33 +
    9.34 +/*!
    9.35 + * \brief Tests SDL_IntersectRectAndLine()
    9.36 + *
    9.37 + * \sa
    9.38 + * http://wiki.libsdl.org/moin.cgi/SDL_IntersectRectAndLine
    9.39 + */
    9.40 +int rect_testIntersectRectAndLineFuzzed(void *arg)
    9.41 +{
    9.42 +	SDL_Rect rect = { 0, 0, RandomInteger(), RandomInteger() };
    9.43 +    int x1, y1;
    9.44 +    int x2, y2;
    9.45 +    SDL_bool clipped;
    9.46 +
    9.47 +    x1 = -RandomInteger();
    9.48 +    y1 = RandomInteger();
    9.49 +    x2 = -RandomInteger();
    9.50 +    y2 = RandomInteger();
    9.51 +    clipped = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2);
    9.52 +
    9.53 +    AssertTrue( !clipped,
    9.54 +                /*&& x1 == -10 && y1 == 0 && x2 == -10 && y2 == 31, */
    9.55 +                "line outside to the left was incorrectly clipped: %d,%d - %d,%d",
    9.56 +                x1, y1, x2, y2);
    9.57 +}
    9.58 +
    10.1 --- a/test/test-automation/xml_logger.c	Thu Jul 21 14:22:17 2011 +0300
    10.2 +++ b/test/test-automation/xml_logger.c	Sun Jul 24 18:21:53 2011 +0300
    10.3 @@ -35,6 +35,7 @@
    10.4  const char *parametersElementName = "parameters";
    10.5  const char *parameterElementName = "parameter";
    10.6  const char *startTimeElementName = "startTime";
    10.7 +const char *execKeyElementName = "executionKey";
    10.8  const char *numSuitesElementName = "numSuites";
    10.9  const char *numTestElementName = "numTests";
   10.10  const char *numPassedTestsElementName = "numPassedTests";
   10.11 @@ -310,7 +311,7 @@
   10.12  
   10.13  void
   10.14  XMLTestStarted(const char *testName, const char *suiteName,
   10.15 -			  const char *testDescription, time_t startTime)
   10.16 +			  const char *testDescription, int execKey, time_t startTime)
   10.17  {
   10.18  	char * output = XMLOpenElement(testElementName);
   10.19  	XMLOutputter(indentLevel++, YES, output);
   10.20 @@ -335,6 +336,17 @@
   10.21  	output = XMLCloseElement(descriptionElementName);
   10.22  	XMLOutputter(--indentLevel, YES, output);
   10.23  
   10.24 +	// log exec key
   10.25 +	output = XMLOpenElement(execKeyElementName);
   10.26 +	XMLOutputter(indentLevel++, NO, output);
   10.27 +
   10.28 +	output = XMLAddContent(IntToString(execKey));
   10.29 +	XMLOutputter(indentLevel, NO, output);
   10.30 +
   10.31 +	output = XMLCloseElement(execKeyElementName);
   10.32 +	XMLOutputter(--indentLevel, YES, output);
   10.33 +
   10.34 +	// log start time
   10.35  	output = XMLOpenElement(startTimeElementName);
   10.36  	XMLOutputter(indentLevel++, NO, output);
   10.37  
    11.1 --- a/test/test-automation/xml_logger.h	Thu Jul 21 14:22:17 2011 +0300
    11.2 +++ b/test/test-automation/xml_logger.h	Sun Jul 24 18:21:53 2011 +0300
    11.3 @@ -53,9 +53,11 @@
    11.4   * \param testName Name of the test that'll be executed
    11.5   * \param suiteName Name of the suite of the test
    11.6   * \param testDescription Description of the test
    11.7 + * \param execKey Execution key for fuzzing
    11.8   * \param startTime When the test started to execute
    11.9   */
   11.10 -void XMLTestStarted(const char *testName, const char *suiteName, const char *testDescription, time_t startTime);
   11.11 +void XMLTestStarted(const char *testName, const char *suiteName,
   11.12 +					const char *testDescription, int execKey, time_t startTime);
   11.13  
   11.14  /*!
   11.15   * Prints information about the test test that was just executed in XML