1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Update testrunner.tcl to use environment variable %NUMBER_OF_PROCESSES% when running under tclsh on windows. Also modify the internal database schema used by testrunner.tcl to be compatible with old versions of SQLite.

FossilOrigin-Name: 6542ed3b9e028c44aca504eadca843ee9b2ba08f5f650523238dd1253f7e221b
This commit is contained in:
dan
2023-08-16 14:18:53 +00:00
parent fe18355267
commit af8980bdce
3 changed files with 35 additions and 22 deletions

View File

@ -110,16 +110,20 @@ proc guess_number_of_cores {} {
if {[catch {number_of_cores} ret]} {
set ret 4
if {$::tcl_platform(os)=="Darwin"} {
set cmd "sysctl -n hw.logicalcpu"
if {$::tcl_platform(platform)=="windows"} {
catch { set ret $::env(NUMBER_OF_PROCESSORS) }
} else {
set cmd "nproc"
}
catch {
set fd [open "|$cmd" r]
set ret [gets $fd]
close $fd
set ret [expr $ret]
if {$::tcl_platform(os)=="Darwin"} {
set cmd "sysctl -n hw.logicalcpu"
} else {
set cmd "nproc"
}
catch {
set fd [open "|$cmd" r]
set ret [gets $fd]
close $fd
set ret [expr $ret]
}
}
}
return $ret
@ -188,10 +192,8 @@ set TRG(schema) {
state TEXT CHECK( state IN ('', 'ready', 'running', 'done', 'failed') ),
time INTEGER, -- Time in ms
output TEXT, -- full output of test script
priority AS (((config='make')*3) + (config='build') + (slow*2)),
jobtype AS (
CASE WHEN config IN ('build', 'make') THEN config ELSE 'script' END
),
priority INTEGER,
jobtype TEXT CHECK( jobtype IN ('script', 'build', 'make') ),
PRIMARY KEY(build, config, filename)
);
@ -697,9 +699,20 @@ proc make_new_testset {} {
set state ""
}
set priority [expr {$slow*2}]
if {$c=="make"} { incr priority 3 }
if {$c=="build"} { incr priority 1 }
if {$c=="make" || $c=="build"} {
set jobtype $c
} else {
set jobtype "script"
}
trdb eval {
INSERT INTO script(build, config, filename, slow, state)
VALUES ($b, $c, $s, $slow, $state)
INSERT INTO script
(build, config, filename, slow, state, priority, jobtype)
VALUES ($b, $c, $s, $slow, $state, $priority, $jobtype)
}
}
}