summaryrefslogtreecommitdiffstats
path: root/tkimg/tests/all.tcl
blob: 3bb3c000cef48725a163786be7388dadabed218c (plain)
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
# all.tcl -- -*- tcl -*-
#
# This file contains a top-level script to run all of the Tcl
# tests.  Execute it by invoking "source all.test" when running tcltest
# in this directory.
#
# Copyright (c) 1998-2000 by Scriptics Corporation.
# Copyright (c) 2002         Andreas Kupries <andreas_kupries@users.sourceforge.net>
# All rights reserved.
#
# RCS: @(#) $Id: all.tcl,v 1.1.1.1 2016/01/25 21:20:47 joye Exp $

if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest
    namespace import ::tcltest::*
}

proc run_tests {} {
    set chan $::tcltest::outputChannel

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

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

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

    # source each of the specified tests
    foreach file [lsort [::tcltest::getMatchingFiles]] {
	set tail [file tail $file]
	puts $chan $tail
	if {[catch {source $file} msg]} {
	    puts $chan $msg
	}
    }

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