
if {[llength $argv] != 2} {
    puts stderr "usage: $argv0 testsdir testfile"
    exit 1
}
set testsdir [lindex $argv 0]
set testfile [lindex $argv 1]
if {[glob -tails -directory $testsdir $testfile] ne $testfile} {
    puts stderr "Unknown test file '$argv'"
    exit 1
}

set argv [list]

package require tcltest

proc tcltest::test {name args} {
    global testnames

    lappend testnames $name
}
set testnames [list]
namespace import -force tcltest::*
set tcltest::testSingleFile false
outputChannel [open /dev/null w+]

source $testsdir/$testfile
puts $testnames
