Testrunner.tcl enhancements: (1) Attempt to build the SQLite tcl extension

if it is not already available.  (2) testrunner target "devtest" is added as
an alias for "mdevtest".  (3) Try to keep summary information at the end of
a test below 80-characters per line.  (4) Update the Makefile.in so that
the "clean" target removes the tcl extension built by item 1 above.

FossilOrigin-Name: aa5f10f21dbfb24ee54ca96bfb7b013ae29e26fec05b80681f19cc63d9face49
This commit is contained in:
drh
2024-09-05 15:28:15 +00:00
parent 21e7816e65
commit 4987c5c3c2
5 changed files with 50 additions and 16 deletions
+7 -2
View File
@@ -1279,10 +1279,15 @@ proc finalize_testing {} {
out of $nTest tests"
} else {
set cpuinfo {}
if {[catch {exec hostname} hname]==0} {set cpuinfo [string trim $hname]}
if {[catch {exec hostname} hname]==0} {
regsub {\.local$} $hname {} hname
set cpuinfo [string trim $hname]
}
append cpuinfo " $::tcl_platform(os)"
append cpuinfo " [expr {$::tcl_platform(pointerSize)*8}]-bit"
append cpuinfo " [string map {E -e} $::tcl_platform(byteOrder)]"
if {[string match big* $::tcl_platform(byteOrder)]} {
append cpuinfo " [string map {E -e} $::tcl_platform(byteOrder)]"
}
output2 "SQLite [sqlite3 -sourceid]"
output2 "$nErr errors out of $nTest tests on $cpuinfo"
}
+33 -4
View File
@@ -17,8 +17,14 @@ cd $dir
# recommend that the user build one.
#
proc find_interpreter {} {
global dir
set interpreter [file tail [info nameofexec]]
set rc [catch { package require sqlite3 }]
if {$rc} {
if {[file readable pkgIndex.tcl] && [catch {source pkgIndex.tcl}]==0} {
set rc [catch { package require sqlite3 }]
}
}
if {$rc} {
if { [string match -nocase testfixture* $interpreter]==0
&& [file executable ./testfixture]
@@ -31,8 +37,30 @@ proc find_interpreter {} {
}
}
if {$rc} {
puts stderr "Failed to find tcl package sqlite3"
puts stderr "Run \"make testfixture\" and then try again..."
puts "Cannot find tcl package sqlite3: Trying to build it now..."
if {$::tcl_platform(platform)=="windows"} {
set bat [open make-tcl-extension.bat w]
puts $bat "nmake /f Makefile.msc tclextension"
close $bat
catch {exec -ignorestderr -- make-tcl-extension.bat}
} else {
catch {exec make tclextension}
}
if {[file readable pkgIndex.tcl] && [catch {source pkgIndex.tcl}]==0} {
set rc [catch { package require sqlite3 }]
}
if {$rc==0} {
puts "The SQLite tcl extension was successfully built and loaded."
puts "Run \"make tclextension-install\" to avoid having to rebuild\
it in the future."
} else {
puts "Unable to build the SQLite tcl extension"
}
}
if {$rc} {
puts stderr "Cannot find a working instance of the SQLite tcl extension."
puts stderr "Run \"make tclextension\" or \"make testfixture\" and\
try again..."
exit 1
}
}
@@ -1166,6 +1194,7 @@ proc add_jobs_from_cmdline {patternlist} {
}
}
devtest -
mdevtest {
set config_set {
All-O0
@@ -1530,9 +1559,9 @@ proc run_testset {} {
SELECT pltfm, count(*) FROM jobs WHERE pltfm IS NOT NULL
ORDER BY 2 DESC LIMIT 1
} {puts $pltfm}
puts "$totalerr errors out of $totaltest tests in about $et $pltfm"
puts "$totalerr errors out of $totaltest tests in $et $pltfm"
trdb eval {
SELECT DISTINCT svers FROM jobs WHERE svers IS NOT NULL
SELECT DISTINCT substr(svers,1,80) FROM jobs WHERE svers IS NOT NULL
} {puts $svers}
}