From: drh Date: Thu, 8 Jan 2015 02:15:11 +0000 (+0000) Subject: In releasetest.tcl: X-Git-Tag: version-3.8.8~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=edb31cd191404b4b488abaa7f57d7372eeb3b4ca;p=thirdparty%2Fsqlite.git In releasetest.tcl: (1) Add the Failure-Detection platform. (2) Re-add the --disable-shared argument on Default that was mistakenly removed by the previous commit. (3) Remove the -ftrapv tests, as we read that -ftrapv does not work in GCC. FossilOrigin-Name: 1f2fb77781a93427a2348f821b66dba7310c49b8 --- diff --git a/manifest b/manifest index 132f600c79..45138d6c8f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C In\sreleasetest.tcl:\sadd\soptions\s--veryquick\sand\spass-through\scompiler\noptimization\ssettings\s(ex:\s-O0).\s\sCollect\sthe\sSQLite\sversion\snumber\sfrom\nthe\smain.test\soutput\sand\sshow\sit\sduring\sthe\ssummary\sreport\sat\sthe\send. -D 2015-01-08T01:05:42.481 +C In\sreleasetest.tcl:\n(1)\sAdd\sthe\sFailure-Detection\splatform.\n(2)\sRe-add\sthe\s--disable-shared\sargument\son\sDefault\sthat\swas\smistakenly\n\s\s\s\sremoved\sby\sthe\sprevious\scommit.\n(3)\sRemove\sthe\s-ftrapv\stests,\sas\swe\sread\sthat\s-ftrapv\sdoes\snot\swork\sin\sGCC. +D 2015-01-08T02:15:11.082 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in f1c9525dccb991ad3095a7f8778b4ae869851130 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -238,7 +238,7 @@ F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 81712116e826b0089bb221b018929536b2b5406f F src/table.c e7a09215315a978057fb42c640f890160dbcc45e F src/tclsqlite.c c6a21c64da1490e14d53cdc2062d1e2e57942622 -F src/test1.c 041c4edf2f9c49a329add297e26ee86a83852f51 +F src/test1.c 71f67f0c9f98de15026203bcdb7436268465a866 F src/test2.c 98049e51a17dc62606a99a9eb95ee477f9996712 F src/test3.c 1c0e5d6f080b8e33c1ce8b3078e7013fdbcd560c F src/test4.c 9b32d22f5f150abe23c1830e2057c4037c45b3df @@ -699,7 +699,7 @@ F test/lock6.test ad5b387a3a8096afd3c68a55b9535056431b0cf5 F test/lock7.test 49f1eaff1cdc491cc5dee3669f3c671d9f172431 F test/lock_common.tcl 0c270b121d40959fa2f3add382200c27045b3d95 F test/lookaside.test 93f07bac140c5bb1d49f3892d2684decafdc7af2 -F test/main.test 6aa6c7a5468f5b16868e74ce1160b4947c58d83b +F test/main.test 16131264ea0c2b93b95201f0c92958e85f2ba11a F test/make-where7.tcl 05c16b5d4f5d6512881dfec560cb793915932ef9 F test/malloc.test 96939d2d1a6f39667bbebe5bc27c6525f2ab614e F test/malloc3.test e3b32c724b5a124b57cb0ed177f675249ad0c66a @@ -782,7 +782,7 @@ F test/pagesize.test 1dd51367e752e742f58e861e65ed7390603827a0 F test/pcache.test b09104b03160aca0d968d99e8cd2c5b1921a993d F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025 F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff -F test/permutations.test 3a58611f8b703d385015bbe1710c722ff900f2ee +F test/permutations.test fa2b4e56d1427dd3763053d78ce2f132376bb695 F test/pragma.test aa16dedfe01c02c8895169012f7dfde9c163f0d5 F test/pragma2.test aea7b3d82c76034a2df2b38a13745172ddc0bc13 F test/pragma3.test 6f849ccffeee7e496d2f2b5e74152306c0b8757c @@ -801,7 +801,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df F test/rdonly.test dd30a4858d8e0fbad2304c2bd74a33d4df36412a F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl 29111a0fd97b4b92a5f40c25c0102d94167ae57f +F test/releasetest.tcl 1e68ec50478dce13b374904668fb7e09409371fb F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1235,7 +1235,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 19982439418fbd36c91853cf9e09a66606f293fc -R e120388d83e06da397d9a5be14f3a4df +P e7e7bc1d9a5c19571e7d87ad345b98c27a826fbd +R c0ba3022e15ea8eeed124c3c8db015b7 U drh -Z 2b3b1e8376da1c06b0cff1703883fdf5 +Z 35451ec031f31c61639c4f2be05cb417 diff --git a/manifest.uuid b/manifest.uuid index a69406b825..47a6bf314b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e7e7bc1d9a5c19571e7d87ad345b98c27a826fbd \ No newline at end of file +1f2fb77781a93427a2348f821b66dba7310c49b8 \ No newline at end of file diff --git a/src/test1.c b/src/test1.c index 032e3f338c..9c0c572f7d 100644 --- a/src/test1.c +++ b/src/test1.c @@ -6604,6 +6604,60 @@ static int test_user_delete( } #endif /* SQLITE_USER_AUTHENTICATION */ +/* +** tclcmd: bad_behavior TYPE +** +** Do some things that should trigger a valgrind or -fsanitize=undefined +** warning. This is used to verify that errors and warnings output by those +** tools are detected by the test scripts. +** +** TYPE BEHAVIOR +** 1 Overflow a signed integer +** 2 Jump based on an uninitialized variable +** 3 Read after free +*/ +static int test_bad_behavior( + ClientData clientData, /* Pointer to an integer containing zero */ + Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ + int objc, /* Number of arguments */ + Tcl_Obj *CONST objv[] /* Command arguments */ +){ + int iType; + int xyz; + int i = *(int*)clientData; + int j; + int w[10]; + int *a; + if( objc!=2 ){ + Tcl_WrongNumArgs(interp, 1, objv, "TYPE"); + return TCL_ERROR; + } + if( Tcl_GetIntFromObj(interp, objv[1], &iType) ) return TCL_ERROR; + switch( iType ){ + case 1: { + xyz = 0x7fffff00 - i; + xyz += 0x100; + Tcl_SetObjResult(interp, Tcl_NewIntObj(xyz)); + break; + } + case 2: { + w[1] = 5; + if( w[i]>0 ) w[1]++; + Tcl_SetObjResult(interp, Tcl_NewIntObj(w[1])); + break; + } + case 3: { + a = malloc( sizeof(int)*10 ); + for(j=0; j<10; j++) a[j] = j; + free(a); + Tcl_SetObjResult(interp, Tcl_NewIntObj(a[i])); + break; + } + } + return TCL_OK; +} + + /* ** Register commands with the TCL interpreter. */ @@ -6620,6 +6674,7 @@ int Sqlitetest1_Init(Tcl_Interp *interp){ extern int sqlite3_max_blobsize; extern int sqlite3BtreeSharedCacheReport(void*, Tcl_Interp*,int,Tcl_Obj*CONST*); + static int iZero = 0; static struct { char *zName; Tcl_CmdProc *xProc; @@ -6672,6 +6727,7 @@ int Sqlitetest1_Init(Tcl_Interp *interp){ Tcl_ObjCmdProc *xProc; void *clientData; } aObjCmd[] = { + { "bad_behavior", test_bad_behavior, (void*)&iZero }, { "sqlite3_connection_pointer", get_sqlite_pointer, 0 }, { "sqlite3_bind_int", test_bind_int, 0 }, { "sqlite3_bind_zeroblob", test_bind_zeroblob, 0 }, diff --git a/test/main.test b/test/main.test index 62c0f708ae..3f35afe20c 100644 --- a/test/main.test +++ b/test/main.test @@ -520,5 +520,19 @@ if {$::tcl_platform(platform)=="unix" puts [db one {SELECT 'VERSION: ' || sqlite_version() || ' ' || sqlite_source_id();}] + +# Do deliberate failures if the TEST_FAILURE environment variable is set. +# This is done to verify that failure notifications are detected by the +# releasetest.tcl script, or possibly by other scripts involved in automatic +# testing. +# +if {[info exists ::env(TEST_FAILURE)]} { + set res 123 + if {$::env(TEST_FAILURE)==0} {set res 234} + do_test main-99.1 { + bad_behavior $::env(TEST_FAILURE) + set x 123 + } $res +} finish_test diff --git a/test/permutations.test b/test/permutations.test index 232e8f9704..6c7b563041 100644 --- a/test/permutations.test +++ b/test/permutations.test @@ -124,6 +124,14 @@ if {[info exists ::env(QUICKTEST_OMIT)]} { } } +# If the TEST_FAILURE environment variable is set, it means that we what to +# deliberately provoke test failures in order to test the test infrastructure. +# Only the main.test module is needed for this. +# +if {[info exists ::env(TEST_FAILURE)]} { + set allquicktests main.test +} + ############################################################################# # Start of tests # diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 7c93479dc9..3766dbd421 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -32,12 +32,7 @@ of the SQLite source tree. array set ::Configs { "Default" { -O2 - --disable-amalgamation - } - "Ftrapv" { - -O2 -ftrapv - -DSQLITE_MAX_ATTACHED=125 - -DSQLITE_TCL_DEFAULT_FULLMUTEX=1 + --disable-amalgamation --disable-shared } "Sanitize" { CC=clang -fsanitize=undefined @@ -88,6 +83,7 @@ array set ::Configs { -DSQLITE_ENABLE_MEMSYS3=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_ENABLE_STAT4 + -DSQLITE_MAX_ATTACHED=125 } "Device-One" { -O2 @@ -168,6 +164,9 @@ array set ::Configs { -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE } + Fail0 {-O0} + Fail2 {-O0} + Fail3 {-O0} } array set ::Platforms { @@ -181,7 +180,6 @@ array set ::Platforms { "Device-Two" test "No-lookaside" test "Devkit" test - "Ftrapv" test "Sanitize" {QUICKTEST_OMIT=func4.test,nan.test test} "Valgrind" valgrindtest "Default" "threadtest fulltest" @@ -205,6 +203,12 @@ array set ::Platforms { "Windows NT-intel" { "Default" "mptest fulltestonly" } + Failure-Detection { + Fail0 "TEST_FAILURE=0 test" + Sanitize "TEST_FAILURE=1 test" + Fail2 "TEST_FAILURE=2 valgrindtest" + Fail3 "TEST_FAILURE=3 valgrindtest" + } }