0
0
mirror of https://github.com/sqlite/sqlite.git synced 2024-11-21 11:19:14 +01:00

Add the merge-test.tcl script to ease verification of LTS branches.

FossilOrigin-Name: f958ffbc61c693b71538cc3aa5f95ce0f0b5d4906efbb0c075f543e19883a669
This commit is contained in:
drh 2021-05-27 16:31:04 +00:00
parent 342cb33b23
commit 48a296c589
3 changed files with 106 additions and 6 deletions

View File

@ -1,5 +1,5 @@
C Improved\scomment\son\sthe\sprpagateConstants()\sroutine.\s\sNo\schanges\sto\sexecutable\ncode.
D 2021-05-27T14:09:01.854
C Add\sthe\smerge-test.tcl\sscript\sto\sease\sverification\sof\sLTS\sbranches.
D 2021-05-27T16:31:04.311
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -1842,6 +1842,7 @@ F tool/libvers.c caafc3b689638a1d88d44bc5f526c2278760d9b9
F tool/loadfts.c c3c64e4d5e90e8ba41159232c2189dba4be7b862
F tool/logest.c 11346aa019e2e77a00902aa7d0cabd27bd2e8cca
F tool/max-limits.c cbb635fbb37ae4d05f240bfb5b5270bb63c54439
F tool/merge-test.tcl de76b62f2de2a92d4c1ca4f976bce0aea6899e0229e250479b229b2a1914b176
F tool/mkautoconfamal.sh f62353eb6c06ab264da027fd4507d09914433dbdcab9cb011cdc18016f1ab3b8
F tool/mkccode.tcl 86463e68ce9c15d3041610fedd285ce32a5cf7a58fc88b3202b8b76837650dbe x
F tool/mkctimec.tcl 06b0d503ee0e6c2d4abe83563b43d4925a12e31ec9fb3249ce39661f53fbd1ce
@ -1917,7 +1918,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 4eb80b0cc61526c1ff7478b1b855b29fa4326daee61facd1d85e4297bb32ac9d
R 816e0d4f9adc95e1495d0ff38bde7776
P d61a875df48d8baab3ada0174c8e0312a9268bbd11bf104b4385eff9e2744266
R 5e30c1492c2c1677fa63079c20b0d339
U drh
Z 0be2b6d4391de9cac15cfbee3096d192
Z bcd233e14e52403e9c9befb82a37b462

View File

@ -1 +1 @@
d61a875df48d8baab3ada0174c8e0312a9268bbd11bf104b4385eff9e2744266
f958ffbc61c693b71538cc3aa5f95ce0f0b5d4906efbb0c075f543e19883a669

99
tool/merge-test.tcl Normal file
View File

@ -0,0 +1,99 @@
#!/usr/bin/tcl
#
# Run this script to test to see that the latest trunk changes can be
# merged into LTS branches without breaking anything.
#
# To Use:
#
# * Copy this script into a directory above the sqlite checkout
# * Run "fossil update trunk" and "fossil revert"
# * Run "tclsh ../merge-test.tcl" (in other words run this script)
#
# Operation:
#
# This script changes to each LTS branch to be tested, merges the latest
# trunk changes into the branch (without committing them) and then
# runs "make test". Any errors are stored in local files.
#
# Limitations:
#
# Some LTS branches are not synced directly from trunk but rather from
# other LTS branches. These other branches cannot be tested because
# there is no good way to generate the intermediate merges.
#
###############################################################################
# Run a shell command contained in arguments. Put the return code in
# global variable ::res and the output string in global variable ::result
#
proc safeexec {args} {
global res result
set res [catch "exec $args" result]
}
# Run the shell command contained in arguments. Print an error and exit
# if anything goes wrong.
#
proc mustbeok {args} {
global res result
set res [catch "exec $args" result]
if {$res} {
puts "FAILED: $args"
puts $result
exit 1
}
}
# Write $content into a file named $filename. The file is overwritten if it
# already exist. The file is create if it does not already exist.
#
proc writefile {filename content} {
set fd [open $filename wb]
puts $fd $content
close $fd
}
# Run the merge-test
#
foreach {branch configopts} {
begin-concurrent {--enable-json1}
begin-concurrent-pnu {--enable-json1}
wal2 {--enable-all}
reuse-schema {--enable-all}
} {
puts $branch
set errorfile ${branch}-error.txt
mustbeok fossil revert
mustbeok fossil up $branch
safeexec fossil merge trunk
if {$res} {
puts " merge failed - see $errorfile"
writefile $errorfile $result
} else {
puts " merge ok"
safeexec ./configure --enable-debug {*}$configopts
if {$res} {
puts " configure failed - see $errorfile"
writefile $errorfile $result
} else {
puts " configure ok"
safeexec make fuzzcheck sqlite3 testfixture
if {$res} {
puts " build failed - see $errorfile"
writefile $errorfile $result
} else {
puts " build ok"
safeexec make test
if {$res} {
puts " test failed - see $errorfile"
writefile $errorfile $result
} else {
puts " test ok"
}
}
}
}
}
mustbeok fossil revert
mustbeok fossil up trunk
puts "reset back to trunk"