File: testshell

package info (click to toggle)
tcltrf 2.1.4-dfsg3-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 9,628 kB
  • sloc: ansic: 73,134; sh: 3,155; tcl: 1,343; makefile: 176; exp: 22
file content (66 lines) | stat: -rw-r--r-- 1,921 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/local/bin/tclsh
# -*- tcl -*-
# Generic test application for all test suites
#
# This file contains a top-level script to run all of the tests
# in an extension.  Execute it by invoking "tclsh testshell -testdir ... -load".
#
# Derived from tcl 8.2/all.tcl, Copyright (c) 1998-1999 by Scriptics Corporation.
# Copyright (c) 1999 by andreas Kupries <andreas_kupries@users.sourceforge.net>
#
# All rights reserved.
# 
# CVS $Id: testshell,v 1.1 2002/08/27 03:51:05 tcl Exp $

if {[lsearch [namespace children] ::tcltest] == -1} {
    # Initialize autoloader, then load the commands and initialize
    # the package (constraints and command line argument processing).

    package require tcltest
    namespace import ::tcltest::*
}

# Directory containing the tests specified via '-testDir'.
# Scripts to load the commands to test in '-load' / '-loadfile'.

set ::tcltest::testSingleFile false

puts stdout "Tests running in interp:       [info nameofexecutable]"
puts stdout "Tests running in working dir:  $::tcltest::testsDirectory"

if {[llength $::tcltest::skip] > 0} {
    puts stdout "Skipping tests that match:  $::tcltest::skip"
}
if {[llength $::tcltest::match] > 0} {
    puts stdout "Only running tests that match:  $::tcltest::match"
}

if {[llength $::tcltest::skipFiles] > 0} {
    puts stdout "Skipping test files that match:  $::tcltest::skipFiles"
}
if {[llength $::tcltest::matchFiles] > 0} {
    puts stdout "Only sourcing test files that match:  $::tcltest::matchFiles"
}


::tcltest::loadTestedCommands

set timeCmd {clock format [clock seconds]}
puts stdout "Tests began at [eval $timeCmd]"

# Source each of the specified tests

foreach file [lsort [::tcltest::getMatchingFiles]] {
    set tail [file tail $file]
    puts stdout $tail

    if {[catch {source $file} msg]} {
	puts stdout $msg
    }
}

# cleanup
puts stdout "\nTests ended at [eval $timeCmd]"
::tcltest::cleanupTests 1
return