]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix fuzzcheck so that it responds correctly to the TEST_FAILURE environment
authordrh <drh@noemail.net>
Tue, 26 May 2015 18:58:32 +0000 (18:58 +0000)
committerdrh <drh@noemail.net>
Tue, 26 May 2015 18:58:32 +0000 (18:58 +0000)
variable.

FossilOrigin-Name: 76770c9e061e2eb106d7ea402eef888b98ba9d0e

manifest
manifest.uuid
test/fuzzcheck.c

index 46ac057018460273840870862c0a4fec8bf43568..be612ee54e6ec188f54a0eaeb87018ac8f2c5998 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C The\s"make\sfuzztest"\starget\snow\suses\sfuzzcheck\sinstead\sof\sfuzzershell.
-D 2015-05-26T18:15:08.927
+C Fix\sfuzzcheck\sso\sthat\sit\sresponds\scorrectly\sto\sthe\sTEST_FAILURE\senvironment\nvariable.
+D 2015-05-26T18:58:32.863
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 3feb7cbdad8898fe7a8a24355b4a753029c3ec3b
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -651,7 +651,7 @@ F test/fuzz2.test 76dc35b32b6d6f965259508508abce75a6c4d7e1
 F test/fuzz3.test efd384b896c647b61a2c1848ba70d42aad60a7b3
 F test/fuzz_common.tcl a87dfbb88c2a6b08a38e9a070dabd129e617b45b
 F test/fuzz_malloc.test 328f70aaca63adf29b4c6f06505ed0cf57ca7c26
-F test/fuzzcheck.c 69998e6430903af8f1904dfa8c7fc21c94d59ebc
+F test/fuzzcheck.c 348c2ac1ef3fde2eb7d312d5bf6fbf7ff42033b3
 F test/fuzzdata1.db b60254eeb6bc11474071b883059662a73c48da7f
 F test/fuzzdata2.db f03a420d3b822cc82e4f894ca957618fbe9c4973
 F test/fuzzdata3.db 57ae47d2a1c837fb8ddc10ce4ab56a04ad044cb4
@@ -1279,10 +1279,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 193364c81c301a41c16835108d23ad2ab84d9dd7
-R 72bebf492c55de7ece7f6fdbb9a7dd3f
-T *branch * test-using-fuzzcheck
-T *sym-test-using-fuzzcheck *
-T -sym-trunk *
+P 4a5f6f1f0128657fd8d4d99d0682edd5bac2a19e
+R 34618a877d8634e9a07e4ff5d1f155f6
 U drh
-Z 66f2916d8728b836edfc9ebde30c4bfc
+Z 0abf5657eb193b1248f700399402e06c
index 0f9ca58d3171149d279bf1c7abf08c6ed6c61c53..fd879aacbb3eb92fcd6878e6e39a8d4a061c0993 100644 (file)
@@ -1 +1 @@
-4a5f6f1f0128657fd8d4d99d0682edd5bac2a19e
\ No newline at end of file
+76770c9e061e2eb106d7ea402eef888b98ba9d0e
\ No newline at end of file
index 469bd6c987c76d2a0717e83acfa51dccd230240c..fe5eb2d9d57344bde60c301cd3a89d28aea009d6 100644 (file)
@@ -633,9 +633,11 @@ int main(int argc, char **argv){
   int iSrcDb;                  /* Loop over all source databases */
   int nTest = 0;               /* Total number of tests performed */
   char *zDbName = "";          /* Appreviated name of a source database */
+  const char *zFailCode = 0;   /* Value of the TEST_FAILURE environment variable */
 
   iBegin = timeOfDay();
   g.zArgv0 = argv[0];
+  zFailCode = getenv("TEST_FAILURE");
   for(i=1; i<argc; i++){
     const char *z = argv[i];
     if( z[0]=='-' ){
@@ -829,6 +831,22 @@ int main(int argc, char **argv){
         reformatVfs();
         nTest++;
         g.zTestName[0] = 0;
+
+        /* Simulate an error if the TEST_FAILURE environment variable is "5".
+        ** This is used to verify that automated test script really do spot
+        ** errors that occur in this test program.
+        */
+        if( zFailCode ){
+          if( zFailCode[0]=='5' && zFailCode[1]==0 ){
+            fatalError("simulated failure");
+          }else if( zFailCode[0]!=0 ){
+            /* If TEST_FAILURE is something other than 5, just exit the test
+            ** early */
+            printf("\nExit early due to TEST_FAILURE being set\n");
+            iSrcDb = nSrcDb-1;
+            goto sourcedb_cleanup;
+          }
+        }
       }
     }
     if( !quietFlag && !verboseFlag ){
@@ -837,6 +855,7 @@ int main(int argc, char **argv){
   
     /* Clean up at the end of processing a single source database
     */
+  sourcedb_cleanup:
     blobListFree(g.pFirstSql);
     blobListFree(g.pFirstDb);
     reformatVfs();