commit - f22b78bb4f965897447b30faa45acd815cba886b
commit + 39720f282faa2a1840de660fe7a9568dbf6b13a9
blob - 191bba64e131cbca60b8a7c34e94e4771dddc306
blob + ab3fdf9a8cb139197be9b873ea23fda844e5d281
--- exercise
+++ exercise
# config options
+set opts(-B) . ;# basedir
set opts(-pd) {*} ;# pattern for test search directories
set opts(-ps) {*.tests} ;# pattern for test suite executable files
set opts(-pt) {*.t} ;# pattern for test executable files
# Should the test result be integrated as a nested test suite?
set suite [string match $opts(-ps) [file tail $path]]
- # Call files in current dir with "./".
- set exe $path
- if {[string first / $exe] < 0} {set exe "./$exe"}
+ # Call files relative to basedir, or ".".
+ set exe [file join $opts(-B) $path]
if {$suite} {
# Pass stderr through when calling test suites.
}
proc find_files {paths} {
+ global opts
set dirs {}
set files {}
+ set workdir [pwd]
+ cd $opts(-B)
find_files_iter files dirs $paths
+ cd $workdir
return $files
}
# determine the set of test files to operate on
set paths [expr {$argc == 0 ? "." : $argv}]
- if {[info exists opts(-B)]} {
- set i 0
- foreach path $paths {
- lset paths $i [file join $opts(-B) $path]
- incr i
- }
- }
set files [find_files $paths]
# run the tests