3 # Run this script to test to see that the latest trunk changes can be
4 # merged into LTS branches without breaking anything.
8 # * Copy this script into a directory above the sqlite checkout
9 # * Run "fossil update trunk" and "fossil revert"
10 # * Run "tclsh ../merge-test.tcl" (in other words run this script)
14 # This script changes to each LTS branch to be tested, merges the latest
15 # trunk changes into the branch (without committing them) and then
16 # runs "make test". Any errors are stored in local files.
20 # Some LTS branches are not synced directly from trunk but rather from
21 # other LTS branches. These other branches cannot be tested because
22 # there is no good way to generate the intermediate merges.
24 ###############################################################################
26 # Run a shell command contained in arguments. Put the return code in
27 # global variable ::res and the output string in global variable ::result
29 proc safeexec
{args
} {
31 set res
[catch "exec $args" result
]
34 # Run the shell command contained in arguments. Print an error and exit
35 # if anything goes wrong.
37 proc mustbeok
{args
} {
39 set res
[catch "exec $args" result
]
47 # Write $content into a file named $filename. The file is overwritten if it
48 # already exist. The file is create if it does not already exist.
50 proc writefile
{filename content
} {
51 set fd
[open $filename wb
]
58 foreach {branch configopts
} {
59 begin-concurrent
{--enable-json
1}
60 begin-concurrent-pnu
{--enable-json
1}
62 reuse-schema
{--enable-all
}
65 set errorfile
${branch
}-error.txt
66 mustbeok fossil revert
67 mustbeok fossil up
$branch
68 safeexec fossil merge trunk
70 puts " merge failed - see $errorfile"
71 writefile
$errorfile $result
74 safeexec .
/configure
--enable-debug
{*}$configopts
76 puts " configure failed - see $errorfile"
77 writefile
$errorfile $result
80 safeexec make fuzzcheck sqlite3 testfixture
82 puts " build failed - see $errorfile"
83 writefile
$errorfile $result
88 puts " test failed - see $errorfile"
89 writefile
$errorfile $result
97 mustbeok fossil revert
98 mustbeok fossil up trunk
99 puts "reset back to trunk"