Work around using (regexp) in the (ifcapable) function of the test suite. So that simpler versions of tcl can call it. (CVS 4713)

FossilOrigin-Name: 3aa5606bd4bd750a365454f42ab07826320f5b98
This commit is contained in:
danielk1977 2008-01-16 08:24:46 +00:00
parent 8cc7432280
commit db4e8867a4
3 changed files with 30 additions and 10 deletions

View File

@ -1,5 +1,5 @@
C Fix\sfor\sa\scouple\sof\sminor\smemory\sleaks.\s(CVS\s4712) C Work\saround\susing\s(regexp)\sin\sthe\s(ifcapable)\sfunction\sof\sthe\stest\ssuite.\sSo\sthat\ssimpler\sversions\sof\stcl\scan\scall\sit.\s(CVS\s4713)
D 2008-01-15T02:22:24 D 2008-01-16T08:24:46
F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
F Makefile.in 30789bf70614bad659351660d76b8e533f3340e9 F Makefile.in 30789bf70614bad659351660d76b8e533f3340e9
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@ -445,7 +445,7 @@ F test/table.test 13b1c2e2fb4727b35ee1fb7641fc469214fd2455
F test/tableapi.test 92651a95c23cf955e92407928e640536402fa3cc F test/tableapi.test 92651a95c23cf955e92407928e640536402fa3cc
F test/tclsqlite.test 3fac87cb1059c46b8fa8a60b553f4f1adb0fb6d9 F test/tclsqlite.test 3fac87cb1059c46b8fa8a60b553f4f1adb0fb6d9
F test/temptable.test 19b851b9e3e64d91e9867619b2a3f5fffee6e125 F test/temptable.test 19b851b9e3e64d91e9867619b2a3f5fffee6e125
F test/tester.tcl 669599b9f84ecdba979ebf202fde11dfa405fe1a F test/tester.tcl 9ec2de42f310d5c85945a793d118b595b62526dc
F test/thread001.test 8fbd9559da0bbdc273e00318c7fd66c162020af7 F test/thread001.test 8fbd9559da0bbdc273e00318c7fd66c162020af7
F test/thread002.test 2c4ad2c386f60f6fe268cd91c769ee35b3c1fd0b F test/thread002.test 2c4ad2c386f60f6fe268cd91c769ee35b3c1fd0b
F test/thread1.test 776c9e459b75ba905193b351926ac4019b049f35 F test/thread1.test 776c9e459b75ba905193b351926ac4019b049f35
@ -606,7 +606,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
P 187f41f54d7cfbaa9f6ce3be4d213a454b600749 P a13d3e953f1a3e451e8708a8ef064aa1d72cb4e9
R 94d8fffe25a18201bc94ce39941579d6 R 58a662df8c8fdddfe7a6980f15d2e446
U drh U danielk1977
Z 79adf324172785bd88656a478d418020 Z 1556b8cb2220031cd0813fc8b184cf26

View File

@ -1 +1 @@
a13d3e953f1a3e451e8708a8ef064aa1d72cb4e9 3aa5606bd4bd750a365454f42ab07826320f5b98

View File

@ -11,7 +11,7 @@
# This file implements some common TCL routines used for regression # This file implements some common TCL routines used for regression
# testing the SQLite library # testing the SQLite library
# #
# $Id: tester.tcl,v 1.98 2008/01/08 16:03:50 drh Exp $ # $Id: tester.tcl,v 1.99 2008/01/16 08:24:46 danielk1977 Exp $
set tcl_precision 15 set tcl_precision 15
@ -316,11 +316,31 @@ proc integrity_check {name} {
} }
} }
proc fix_ifcapable_expr {expr} {
set ret ""
set state 0
for {set i 0} {$i < [string length $expr]} {incr i} {
set char [string range $expr $i $i]
set newstate [expr {[string is alnum $char] || $char eq "_"}]
if {$newstate && !$state} {
append ret {$::sqlite_options(}
}
if {!$newstate && $state} {
append ret )
}
append ret $char
set state $newstate
}
if {$state} {append ret )}
return $ret
}
# Evaluate a boolean expression of capabilities. If true, execute the # Evaluate a boolean expression of capabilities. If true, execute the
# code. Omit the code if false. # code. Omit the code if false.
# #
proc ifcapable {expr code {else ""} {elsecode ""}} { proc ifcapable {expr code {else ""} {elsecode ""}} {
regsub -all {[a-z_0-9]+} $expr {$::sqlite_options(&)} e2 #regsub -all {[a-z_0-9]+} $expr {$::sqlite_options(&)} e2
set e2 [fix_ifcapable_expr $expr]
if ($e2) { if ($e2) {
set c [catch {uplevel 1 $code} r] set c [catch {uplevel 1 $code} r]
} else { } else {