5 # tclsh soak1.tcl local-makefile.mk ?target? ?scenario?
7 # This generates many variations on local-makefile.mk (by modifing
8 # the OPT = lines) and runs them will fulltest, one by one. The
9 # constructed makefiles are named "soak1.mk".
11 # If ?target? is provided, that is the makefile target that is run.
12 # The default is "fulltest"
14 # If ?scenario? is provided, it is the name of a single scenario to
15 # be run. All other scenarios are skipped.
17 set localmake
[lindex $argv 0]
18 set target
[lindex $argv 1]
19 set scene
[lindex $argv 2]
20 if {$target==""} {set target fulltest
}
21 if {$scene==""} {set scene all
}
23 set in
[open $localmake]
24 set maketxt
[read $in]
26 regsub -all {\\\n} $maketxt {} maketxt
27 #set makefilename "soak1-[expr {int(rand()*1000000000)}].mk"
28 set makefilename
"soak1.mk"
32 proc generate_makefile
{pattern
} {
33 global makefilename maketxt
34 set out
[open $makefilename w
]
36 foreach line
[split $maketxt \n] {
37 if {[regexp {^
*#? *OPTS[ =+]} $line]} {
39 puts $out "OPTS += -DSQLITE_NO_SYNC=1"
41 puts $out "OPTS += -D$x"
54 proc scenario
{id title pattern
} {
55 global makefilename target scene
56 if {$scene!="all" && $scene!=$id && $scene!=$title} return
57 puts "**************** $title ***************"
58 generate_makefile
$pattern
59 exec make
-f $makefilename clean
>@stdout
2>@stdout
60 exec make
-f $makefilename $target >@stdout
2>@stdout
63 ###############################################################################
64 # Add new scenarios here
66 scenario
0 {Default
} {}
71 scenario
2 {Everything
} {
74 SQLITE_ENABLE_MEMORY_MANAGEMENT
=1
75 SQLITE_ENABLE_COLUMN_METADATA
=1
76 SQLITE_ENABLE_LOAD_EXTENSION
=1 HAVE_DLOPEN
=1
77 SQLITE_ENABLE_MEMORY_MANAGEMENT
=1
79 scenario
3 {Customer-1
} {
80 SQLITE_DEBUG
=1 SQLITE_MEMDEBUG
=1
81 SQLITE_THREADSAFE
=1 SQLITE_OS_UNIX
=1
83 SQLITE_DEFAULT_AUTOVACUUM
=1
84 SQLITE_DEFAULT_PAGE_SIZE
=1024
85 SQLITE_MAX_PAGE_SIZE
=4096
86 SQLITE_DEFAULT_CACHE_SIZE
=64
87 SQLITE_DEFAULT_TEMP_CACHE_SIZE
=32
89 SQLITE_OMIT_PROGRESS_CALLBACK
=1
90 SQLITE_OMIT_LOAD_EXTENSION
=1
91 SQLITE_OMIT_VIRTUALTABLE
=1
92 SQLITE_ENABLE_IOTRACE
=1
94 scenario
4 {Small-Cache
} {
95 SQLITE_DEBUG
=1 SQLITE_MEMDEBUG
=1
96 SQLITE_THREADSAFE
=1 SQLITE_OS_UNIX
=1
97 SQLITE_DEFAULT_AUTOVACUUM
=1
98 SQLITE_DEFAULT_PAGE_SIZE
=1024
99 SQLITE_MAX_PAGE_SIZE
=2048
100 SQLITE_DEFAULT_CACHE_SIZE
=13
101 SQLITE_DEFAULT_TEMP_CACHE_SIZE
=11