1# all.tcl -- 2# 3# This file contains a top-level script to run all of the Tcl 4# tests. Execute it by invoking "source all.test" when running tcltest 5# in this directory. 6# 7# Copyright (c) 2004 Gordon D. Carrie. All rights reserved. 8# 9# Licensed under the Open Software License version 2.1 10# 11# Please address questions and feedback to user0@tkgeomap.org 12# 13# @(#) $Id: all.tcl,v 1.4 2004/09/22 21:57:51 tkgeomap Exp $ 14 15if {[lsearch [namespace children] ::tcltest] == -1} { 16 package require tcltest 17 namespace import ::tcltest::* 18} 19 20set ::tcltest::testSingleFile false 21set ::tcltest::testsDirectory [file dir [info script]] 22 23# We need to ensure that the testsDirectory is absolute 24::tcltest::normalizePath ::tcltest::testsDirectory 25 26puts stdout "Tcl $tcl_patchLevel tests running in interp: [info nameofexecutable]" 27puts stdout "Tests running in working dir: $::tcltest::testsDirectory" 28if {[llength $::tcltest::skip] > 0} { 29 puts stdout "Skipping tests that match: $::tcltest::skip" 30} 31if {[llength $::tcltest::match] > 0} { 32 puts stdout "Only running tests that match: $::tcltest::match" 33} 34 35if {[llength $::tcltest::skipFiles] > 0} { 36 puts stdout "Skipping test files that match: $::tcltest::skipFiles" 37} 38if {[llength $::tcltest::matchFiles] > 0} { 39 puts stdout "Only sourcing test files that match: $::tcltest::matchFiles" 40} 41 42set timeCmd {clock format [clock seconds]} 43puts stdout "Tests began at [eval $timeCmd]" 44 45# source each of the specified tests 46foreach file [lsort [::tcltest::getMatchingFiles]] { 47 set tail [file tail $file] 48 puts stdout $tail 49 if {[catch {source $file} msg]} { 50 puts stdout $msg 51 } 52} 53 54# cleanup 55puts stdout "\nTests ended at [eval $timeCmd]" 56::tcltest::cleanupTests 1 57return 58 59