mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Remove obsolete testfixture TCL commands formerly required by Windows
but now handled by Tcl itself. Update tests case accordingly. FossilOrigin-Name: 4f065fb638b24b33283518af8ad55f28a49cfac4086fa5e4568e2f3a6814962d
This commit is contained in:
18
manifest
18
manifest
@@ -1,5 +1,5 @@
|
||||
C Fix\sproblems\suncovered\swhile\stesting\sTcl9\son\sWindows.
|
||||
D 2024-07-31T13:00:18.912
|
||||
C Remove\sobsolete\stestfixture\sTCL\scommands\sformerly\srequired\sby\sWindows\nbut\snow\shandled\sby\sTcl\sitself.\s\sUpdate\stests\scase\saccordingly.
|
||||
D 2024-07-31T15:04:37.311
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
@@ -770,7 +770,7 @@ F src/status.c cb11f8589a6912af2da3bb1ec509a94dd8ef27df4d4c1a97e0bcf2309ece972b
|
||||
F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
|
||||
F src/tclsqlite.c 6242341191e43952a8ed466b1ee4993cad3a2b93ec3e4a5e826f0b06225a6716
|
||||
F src/tclsqlite.h 4ed60ea4084b2ea46e19ab13857b3f39d33250ebbf5b2df62b0999bb9b2766b7
|
||||
F src/test1.c b0ebd758a5ee92305510bc526448cde3b2015c4ac6e1b7b0c450ba2745cfda24
|
||||
F src/test1.c cb27cfe75c7df9d14a10fe34e1f1e2327c294984cc185595b4893c8e2af8ec08
|
||||
F src/test2.c 7ebc518e6735939d8979273a6f7b1d9b5702babf059f6ad62499f7f60a9eb9a3
|
||||
F src/test3.c e7573aa0f78ee4e070a4bc8c3493941c1aa64d5c66d4825c74c0f055451f432b
|
||||
F src/test4.c 13e57ae7ec7a959ee180970aef09deed141252fe9bb07c61054f0dfa4f1dfd5d
|
||||
@@ -1704,7 +1704,7 @@ F test/temptable.test d2c9b87a54147161bcd1822e30c1d1cd891e5b30
|
||||
F test/temptable2.test 76821347810ecc88203e6ef0dd6897b6036ac788e9dd3e6b04fd4d1631311a16
|
||||
F test/temptable3.test d11a0974e52b347e45ee54ef1923c91ed91e4637
|
||||
F test/temptrigger.test 38f0ca479b1822d3117069e014daabcaacefffcc
|
||||
F test/tester.tcl 80626ee1ce542f3171a2e64e5d944f9a37ff06386ac325dd8988445494f526b1
|
||||
F test/tester.tcl 640106bf8f7785d0ac67cda2837577eb9f2d936033bacedf9e705ca5451958ef
|
||||
F test/testrunner.tcl 757f79c68f82cad563441d80f02c492465f51cf537336c7b719c3ef45f348911
|
||||
F test/testrunner_data.tcl 3d36660cfd55ea5e20e661e8f94c0520feebcb437848f9b98b33c483cc479c0c
|
||||
F test/thread001.test a0985c117eab62c0c65526e9fa5d1360dd1cac5b03bde223902763274ce21899
|
||||
@@ -1962,7 +1962,7 @@ F test/vtabC.test 4528f459a13136f982e75614d120aef165f17292
|
||||
F test/vtabD.test 05b3f1d77117271671089e48719524b676842e96
|
||||
F test/vtabE.test 2a143fe75a11275781d1fd1988d86b66a3f69cb98f4add62e3da8fd0f637b45f
|
||||
F test/vtabF.test 1918844c7c902f6a16c8dacf1ec8f84886d6e78b
|
||||
F test/vtabH.test 2efb5a24b0bb50796b21eca23032cfb77abfa4b0c03938e38ce5897abac404ca
|
||||
F test/vtabH.test 8e338acba32207085b6fe9cb2a58f7b408e74c8e1a2964cbdaca903ac82213cc
|
||||
F test/vtabI.test 751b07636700dbdea328e4265b6077ccd6811a3f
|
||||
F test/vtabJ.test a6aef49d558af90fae10565b29501f82a95781cb4f797f2d13e2d19f9b6bc77b
|
||||
F test/vtabK.test 13293177528fada1235c0112db0d187d754af1355c5a39371abd365104e3afbf
|
||||
@@ -2041,7 +2041,7 @@ F test/wherelimit3.test 22d73e046870cf8bbe15573eda6b432b07ebe64a88711f9f849c6b36
|
||||
F test/widetab1.test c296a98e123762de79917350e45fa33fdf88577a2571eb3a64c8bf7e44ef74d1
|
||||
F test/win32heap.test 10fd891266bd00af68671e702317726375e5407561d859be1aa04696f2aeee74
|
||||
F test/win32lock.test e0924eb8daac02bf80e9da88930747bd44dd9b230b7759fed927b1655b467c9c
|
||||
F test/win32longpath.test 4baffc3acb2e5188a5e3a895b2b543ed09e62f7c72d713c1feebf76222fe9976
|
||||
F test/win32longpath.test 42210789bcfc5c0ac202643d6d0237db08df2c9218f2070d9a69e8af1eccf7d7
|
||||
F test/win32nolock.test ac4f08811a562e45a5755e661f45ca85892bdbbc
|
||||
F test/window1.test 79dc3b9a2226f622d7e104a1fc750d1c4c3c08d6147b59085bdbe05352947ffa
|
||||
F test/window2.tcl 492c125fa550cda1dd3555768a2303b3effbeceee215293adf8871efc25f1476
|
||||
@@ -2200,8 +2200,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P 066c8672ee85a6ce972de38fcd3793fc2c1ef4f21c3de2379746d0ff18df8dc0
|
||||
R c8830a3ba8018dbbcdef74f3842d2ce5
|
||||
P d5523c77fd0bcdc8344971a116d6ce9657f2b6daddeb7d936cd7607163a36744
|
||||
R 84a489b31a0c3218dd037a53107529be
|
||||
U drh
|
||||
Z fef8cf123496ca8dc33a3e7042cf9e2f
|
||||
Z c83bb23b49c74bc693e83c6e007c904e
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
@@ -1 +1 @@
|
||||
d5523c77fd0bcdc8344971a116d6ce9657f2b6daddeb7d936cd7607163a36744
|
||||
4f065fb638b24b33283518af8ad55f28a49cfac4086fa5e4568e2f3a6814962d
|
||||
|
144
src/test1.c
144
src/test1.c
@@ -8061,145 +8061,6 @@ static int SQLITE_TCLAPI win32_file_lock(
|
||||
CloseHandle(ev);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** exists_win32_path PATH
|
||||
**
|
||||
** Returns non-zero if the specified path exists, whose fully qualified name
|
||||
** may exceed 260 characters if it is prefixed with "\\?\".
|
||||
*/
|
||||
static int SQLITE_TCLAPI win32_exists_path(
|
||||
void *clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[]
|
||||
){
|
||||
if( objc!=2 ){
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "PATH");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(
|
||||
GetFileAttributesW( Tcl_GetUnicode(objv[1]))!=INVALID_FILE_ATTRIBUTES ));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** find_win32_file PATTERN
|
||||
**
|
||||
** Returns a list of entries in a directory that match the specified pattern,
|
||||
** whose fully qualified name may exceed 248 characters if it is prefixed with
|
||||
** "\\?\".
|
||||
*/
|
||||
static int SQLITE_TCLAPI win32_find_file(
|
||||
void *clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[]
|
||||
){
|
||||
HANDLE hFindFile = INVALID_HANDLE_VALUE;
|
||||
WIN32_FIND_DATAW findData;
|
||||
Tcl_Obj *listObj;
|
||||
DWORD lastErrno;
|
||||
if( objc!=2 ){
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "PATTERN");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
hFindFile = FindFirstFileW(Tcl_GetUnicode(objv[1]), &findData);
|
||||
if( hFindFile==INVALID_HANDLE_VALUE ){
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(GetLastError()));
|
||||
return TCL_ERROR;
|
||||
}
|
||||
listObj = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(listObj);
|
||||
do {
|
||||
Tcl_ListObjAppendElement(interp, listObj, Tcl_NewUnicodeObj(
|
||||
findData.cFileName, -1));
|
||||
Tcl_ListObjAppendElement(interp, listObj, Tcl_NewWideIntObj(
|
||||
findData.dwFileAttributes));
|
||||
} while( FindNextFileW(hFindFile, &findData) );
|
||||
lastErrno = GetLastError();
|
||||
if( lastErrno!=NO_ERROR && lastErrno!=ERROR_NO_MORE_FILES ){
|
||||
FindClose(hFindFile);
|
||||
Tcl_DecrRefCount(listObj);
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(GetLastError()));
|
||||
return TCL_ERROR;
|
||||
}
|
||||
FindClose(hFindFile);
|
||||
Tcl_SetObjResult(interp, listObj);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** delete_win32_file FILENAME
|
||||
**
|
||||
** Deletes the specified file, whose fully qualified name may exceed 260
|
||||
** characters if it is prefixed with "\\?\".
|
||||
*/
|
||||
static int SQLITE_TCLAPI win32_delete_file(
|
||||
void *clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[]
|
||||
){
|
||||
if( objc!=2 ){
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "FILENAME");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if( !DeleteFileW(Tcl_GetUnicode(objv[1])) ){
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(GetLastError()));
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_ResetResult(interp);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** make_win32_dir DIRECTORY
|
||||
**
|
||||
** Creates the specified directory, whose fully qualified name may exceed 248
|
||||
** characters if it is prefixed with "\\?\".
|
||||
*/
|
||||
static int SQLITE_TCLAPI win32_mkdir(
|
||||
void *clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[]
|
||||
){
|
||||
if( objc!=2 ){
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "DIRECTORY");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if( !CreateDirectoryW(Tcl_GetUnicode(objv[1]), NULL) ){
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(GetLastError()));
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_ResetResult(interp);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** remove_win32_dir DIRECTORY
|
||||
**
|
||||
** Removes the specified directory, whose fully qualified name may exceed 248
|
||||
** characters if it is prefixed with "\\?\".
|
||||
*/
|
||||
static int SQLITE_TCLAPI win32_rmdir(
|
||||
void *clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[]
|
||||
){
|
||||
if( objc!=2 ){
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "DIRECTORY");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if( !RemoveDirectoryW(Tcl_GetUnicode(objv[1])) ){
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj(GetLastError()));
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_ResetResult(interp);
|
||||
return TCL_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -9294,11 +9155,6 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
|
||||
{ "optimization_control", optimization_control,0},
|
||||
#if SQLITE_OS_WIN
|
||||
{ "lock_win32_file", win32_file_lock, 0 },
|
||||
{ "exists_win32_path", win32_exists_path, 0 },
|
||||
{ "find_win32_file", win32_find_file, 0 },
|
||||
{ "delete_win32_file", win32_delete_file, 0 },
|
||||
{ "make_win32_dir", win32_mkdir, 0 },
|
||||
{ "remove_win32_dir", win32_rmdir, 0 },
|
||||
#endif
|
||||
{ "tcl_objproc", runAsObjProc, 0 },
|
||||
|
||||
|
@@ -310,66 +310,6 @@ proc do_delete_file {force args} {
|
||||
}
|
||||
}
|
||||
|
||||
if {$::tcl_platform(platform) eq "windows"} {
|
||||
proc do_remove_win32_dir {args} {
|
||||
set nRetry [getFileRetries] ;# Maximum number of retries.
|
||||
set nDelay [getFileRetryDelay] ;# Delay in ms before retrying.
|
||||
|
||||
foreach dirName $args {
|
||||
# On windows, sometimes even a [remove_win32_dir] can fail just after
|
||||
# a directory is emptied. The cause is usually "tag-alongs" - programs
|
||||
# like anti-virus software, automatic backup tools and various explorer
|
||||
# extensions that keep a file open a little longer than we expect,
|
||||
# causing the delete to fail.
|
||||
#
|
||||
# The solution is to wait a short amount of time before retrying the
|
||||
# removal.
|
||||
#
|
||||
if {$nRetry > 0} {
|
||||
for {set i 0} {$i < $nRetry} {incr i} {
|
||||
set rc [catch {
|
||||
remove_win32_dir $dirName
|
||||
} msg]
|
||||
if {$rc == 0} break
|
||||
if {$nDelay > 0} { after $nDelay }
|
||||
}
|
||||
if {$rc} { error $msg }
|
||||
} else {
|
||||
remove_win32_dir $dirName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
proc do_delete_win32_file {args} {
|
||||
set nRetry [getFileRetries] ;# Maximum number of retries.
|
||||
set nDelay [getFileRetryDelay] ;# Delay in ms before retrying.
|
||||
|
||||
foreach fileName $args {
|
||||
# On windows, sometimes even a [delete_win32_file] can fail just after
|
||||
# a file is closed. The cause is usually "tag-alongs" - programs like
|
||||
# anti-virus software, automatic backup tools and various explorer
|
||||
# extensions that keep a file open a little longer than we expect,
|
||||
# causing the delete to fail.
|
||||
#
|
||||
# The solution is to wait a short amount of time before retrying the
|
||||
# delete.
|
||||
#
|
||||
if {$nRetry > 0} {
|
||||
for {set i 0} {$i < $nRetry} {incr i} {
|
||||
set rc [catch {
|
||||
delete_win32_file $fileName
|
||||
} msg]
|
||||
if {$rc == 0} break
|
||||
if {$nDelay > 0} { after $nDelay }
|
||||
}
|
||||
if {$rc} { error $msg }
|
||||
} else {
|
||||
delete_win32_file $fileName
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
proc execpresql {handle args} {
|
||||
trace remove execution $handle enter [list execpresql $handle]
|
||||
if {[info exists ::G(perm:presql)]} {
|
||||
|
@@ -128,10 +128,10 @@ if {$tcl_platform(platform)=="windows"} {
|
||||
set drive [string range [pwd] 0 1]
|
||||
set ::env(fstreeDrive) $drive
|
||||
}
|
||||
reset_db
|
||||
register_fs_module db
|
||||
if {$tcl_platform(platform)!="windows" || \
|
||||
[regexp -nocase -- {^[A-Z]:} $drive]} {
|
||||
reset_db
|
||||
register_fs_module db
|
||||
do_execsql_test 3.0 {
|
||||
SELECT name FROM fsdir WHERE dir = '.' AND name = 'test.db';
|
||||
SELECT name FROM fsdir WHERE dir = '.' AND name = '.'
|
||||
|
@@ -49,19 +49,19 @@ set longPath(1) \\\\?\\$path\\[pid]
|
||||
set uriPath(1a) %5C%5C%3F%5C$path\\[pid]
|
||||
set uriPath(1b) %5C%5C%3F%5C$rawPath/[pid]
|
||||
|
||||
make_win32_dir $longPath(1)
|
||||
file mkdir $longPath(1)
|
||||
|
||||
set longPath(2) $longPath(1)\\[string repeat X 255]
|
||||
set uriPath(2a) $uriPath(1a)\\[string repeat X 255]
|
||||
set uriPath(2b) $uriPath(1b)/[string repeat X 255]
|
||||
|
||||
make_win32_dir $longPath(2)
|
||||
file mkdir $longPath(2)
|
||||
|
||||
set longPath(3) $longPath(2)\\[string repeat Y 255]
|
||||
set uriPath(3a) $uriPath(2a)\\[string repeat Y 255]
|
||||
set uriPath(3b) $uriPath(2b)/[string repeat Y 255]
|
||||
|
||||
make_win32_dir $longPath(3)
|
||||
file mkdir $longPath(3)
|
||||
|
||||
set fileName $longPath(3)\\test.db
|
||||
|
||||
@@ -92,7 +92,6 @@ do_test 1.4 {
|
||||
} {5 6 7 8}
|
||||
|
||||
db3 close
|
||||
# puts " Database exists \{[exists_win32_path $fileName]\}"
|
||||
|
||||
sqlite3 db3 $fileName -vfs win32-longpath
|
||||
|
||||
@@ -115,7 +114,6 @@ do_test 1.6 {
|
||||
} {5 6 7 8 9 10 11 12}
|
||||
|
||||
db3 close
|
||||
# puts " Database exists \{[exists_win32_path $fileName]\}"
|
||||
|
||||
foreach tn {1a 1b 1c 1d 1e 1f} {
|
||||
sqlite3 db3 $uri($tn) -vfs win32-longpath -uri 1 -translatefilename 0
|
||||
@@ -129,11 +127,9 @@ foreach tn {1a 1b 1c 1d 1e 1f} {
|
||||
db3 close
|
||||
}
|
||||
|
||||
do_delete_win32_file $fileName
|
||||
# puts " Files remaining \{[find_win32_file $longPath(3)\\*]\}"
|
||||
|
||||
do_remove_win32_dir $longPath(3)
|
||||
do_remove_win32_dir $longPath(2)
|
||||
do_remove_win32_dir $longPath(1)
|
||||
file delete -force $fileName
|
||||
file delete -force $longPath(3)
|
||||
file delete -force $longPath(2)
|
||||
file delete -force $longPath(1)
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user