commit - 13d3265df55c9af2372c89b042d40272a7d1e14f
commit + c690e7b81fb4ca88ebe7970f8f6fa6d30f8438da
blob - 7f009af72b7716606c771639158763d05fd4000d
blob + 5683696daa291398786336627041302aeb81e24c
--- exercise
+++ exercise
# executing tests
-proc execute_test {countervar base path} {
+proc execute_test {countervar path} {
global opts
upvar $countervar counters
# Should the test result be integrated as a nested test suite?
set suite [string match $opts(-ps) [file tail $path]]
- # Change into the test's directory.
+ # Call files in current dir with "./".
set exe $path
- if {[set i [string last / $path]] != -1} {
- cd [file join $base [string range $path 0 $i]]
- set exe [string range $path [incr i] end]
- }
+ if {[string first / $exe] < 0} {set exe "./$exe"}
if {$suite} {
# Pass stderr through when calling test suites.
set scounters {}
if {[catch {
# Execute the test, attaching pipes to stdin and stdout.
- set pipe [open "|./$exe 2>$errfile" r+]
+ set pipe [open "|$exe 2>$errfile" r+]
# Consume the test's stdout. Ignore it for normal tests.
# Continually update the progress report for test suites.
set paths [expr {$argc == 0 ? "." : $argv}]
set files [find_files $paths]
- set dir [pwd]
dict set counters total [llength $files] ;# tentative total test count
;# might adjust when suites run
foreach file $files {
print_progress $counters
- execute_test counters $dir $file
+ execute_test counters $file
}
if {!$opts(-q)} {puts [summary $counters]}