if { ! [info exists CHECK_COVERAGE] } { set CHECK_COVERAGE no }
proc write_test_config { base_dir config } {
- put_file [file join $base_dir test.conf] \
+ set config_text \
[regsub -all -line -- {^[ \t]+} [uplevel 1 subst [list $config]] ""]
+ put_file [file join $base_dir test.conf] $config_text
+
+ # ensure that directories named in the configuration exist
+ foreach line [split $config_text "\n"] {
+ if { [regexp {dir\s*=\s*(\S+)} $line -> dir] } {
+ file mkdir $dir
+ }
+ }
}
proc make_test_environment { base_dir } {