From: mistachkin Date: Wed, 18 Jan 2017 22:16:34 +0000 (+0000) Subject: Make the vtabH-3.1 test more portable and robust. X-Git-Tag: version-3.17.0~100 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7059138a0811ea83b98753b632742a4aa71e7c4d;p=thirdparty%2Fsqlite.git Make the vtabH-3.1 test more portable and robust. FossilOrigin-Name: d3c91c1fb345fbcbfc60a897bebf771c795430c9 --- diff --git a/manifest b/manifest index 4727a38a08..68a0430236 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\shandling\sof\sinitial\shidden\sand/or\ssystem\sfiles\sin\sthe\sopendir()\simplementation\sfor\sWindows.\s\sNo\schanges\sto\snon-test\scode. -D 2017-01-18T22:16:20.672 +C Make\sthe\svtabH-3.1\stest\smore\sportable\sand\srobust. +D 2017-01-18T22:16:34.363 F Makefile.in 41bd4cad981487345c4a84081074bcdb876e4b2e F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc b8ca53350ae545e3562403d5da2a69cec79308da @@ -1383,7 +1383,7 @@ F test/vtabC.test 4528f459a13136f982e75614d120aef165f17292 F test/vtabD.test 05b3f1d77117271671089e48719524b676842e96 F test/vtabE.test d5024aa42754962f6bb0afd261681686488e7afe F test/vtabF.test 1918844c7c902f6a16c8dacf1ec8f84886d6e78b -F test/vtabH.test 97f61b0253260831af6232163f7852e2653baed6 +F test/vtabH.test a99d22d77e7ad367ea95df7c7c953320980bf63f F test/vtabI.test 751b07636700dbdea328e4265b6077ccd6811a3f F test/vtab_alter.test 9e374885248f69e251bdaacf480b04a197f125e5 F test/vtab_err.test 0d4d8eb4def1d053ac7c5050df3024fd47a3fbd8 @@ -1547,7 +1547,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 681d96eb822e606da53700867191d4738bda20c8 -R 728f11ac297b564a808bf2eb4a24c6c8 +P 26dd42b462dc621b8b0a2295fc91d3e61ac732b6 +R ea3d0fbdb25858ca04efea2603f3e30f U mistachkin -Z 724393d72bdc7af5ff5eea47dd7cb77d +Z 79e95e457c2d340f3ec156d2b8c6aa1c diff --git a/manifest.uuid b/manifest.uuid index a40c13f3d9..93490dc381 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -26dd42b462dc621b8b0a2295fc91d3e61ac732b6 \ No newline at end of file +d3c91c1fb345fbcbfc60a897bebf771c795430c9 \ No newline at end of file diff --git a/test/vtabH.test b/test/vtabH.test index f2a116f350..678557385a 100644 --- a/test/vtabH.test +++ b/test/vtabH.test @@ -121,29 +121,43 @@ if {$tcl_platform(platform)!="windows" || \ SELECT name FROM fsdir WHERE dir = '.' AND name = '.' } {test.db .} + proc sort_files { names {nocase false} } { + if {$nocase && $::tcl_platform(platform) eq "windows"} { + return [lsort -dictionary -nocase $names] + } else { + return [lsort $names] + } + } + proc list_root_files {} { if {$::tcl_platform(platform) eq "windows"} { - set res [list] - foreach name [glob -directory $::env(fstreeDrive)/ -- *] { + set res [list]; set dir $::env(fstreeDrive)/; set names [list] + eval lappend names [glob -nocomplain -directory $dir -- *] + foreach name $names { if {[string index [file tail $name] 0] eq "."} continue + if {[file attributes $name -hidden]} continue + if {[file attributes $name -system]} continue lappend res $name } - return $res + return [sort_files $res true] } else { - return [string map {/ {}} [glob /*]] + return [sort_files [string map {/ {}} [glob -nocomplain -- /*]]] } } proc list_files { pattern } { if {$::tcl_platform(platform) eq "windows"} { - set res [list] - foreach name [glob -nocomplain $pattern] { + set res [list]; set names [list] + eval lappend names [glob -nocomplain -- $pattern] + foreach name $names { if {[string index [file tail $name] 0] eq "."} continue + if {[file attributes $name -hidden]} continue + if {[file attributes $name -system]} continue lappend res $name } - return $res + return [sort_files $res] } else { - return [glob -nocomplain $pattern] + return [sort_files [glob -nocomplain -- $pattern]] } } @@ -153,18 +167,19 @@ if {$tcl_platform(platform)!="windows" || \ # set res [list] set root_files [list_root_files] - set num_root_files [llength $root_files] - set lim_root_files [expr {$num_root_files > 5 ? 5 : $num_root_files}] - foreach p [lrange $root_files 0 [expr {$lim_root_files - 1}]] { + foreach p $root_files { if {$::tcl_platform(platform) eq "windows"} { - if {[regexp {\$} $p]} {incr lim_root_files -1} else {lappend res $p} + if {![regexp {\$} $p]} {lappend res $p} } else { lappend res "/$p" } } - do_execsql_test 3.1 [subst { - SELECT path FROM fstree WHERE path NOT GLOB '*\$*' LIMIT $lim_root_files; - }] $res + set num_root_files [llength $root_files] + do_test 3.1 { + sort_files [execsql { + SELECT path FROM fstree WHERE path NOT GLOB '*\$*' LIMIT $num_root_files; + }] true + } [sort_files $res true] # Read all entries in the current directory. # @@ -182,7 +197,7 @@ if {$tcl_platform(platform)!="windows" || \ set res [contents $pwd] do_execsql_test 3.2 { SELECT path FROM fstree WHERE path GLOB $pwd ORDER BY 1 - } [lsort $res] + } [sort_files $res] # Add some sub-directories and files to the current directory. #