2 ################################################################################
5 # Description: This is the test driver program. It is responsible for running
6 # all tests based on category, etc.
7 # Author: Andrew@DeFaria.com
8 # Created: Fri Jun 6 15:37:15 PDT 2003
11 # (c) Copyright 2003, Andrew@DeFaria.com, all rights reserved
13 ################################################################################
14 # Source in the Testing package
15 set test_base "/dview/defaria_default/Tools/testing"
16 source "$test_base/bin/TestPkg.tcl"
18 namespace import Test::*
26 Display "Usage: tester \[-u\] \[-v\] \[-d\] \[-c <class>\] \[-t <test>\] <IP Address>"
30 Display "\t-u\tUsage (this screen)"
31 Display "\t-v\tTurn on verbose mode"
32 Display "\t-d\tTurn on debug mode"
33 Display "\t-c\tRun only <class> tests"
34 Display "\t-t\tRun only <test>"
39 proc ExecTestCase {test class} {
43 cd "$test_base/tests/$class"
45 if {[catch {source $test}]} {
46 Warning "Internal problems executing test $test"
47 # If debug is on then re-source the test to see the errors
48 # if {$Test::debug == 1} {
49 # Debug "Re-sourcing test..."
55 proc ExecTestClass {class} {
58 cd "$test_base/tests/$class"
60 if {[catch {set tests [lsort [glob *.exp]]}]} {
61 Warning "No tests in class $class"
63 set nbr_tests [llength $tests]
65 if {$nbr_tests == 1} {
66 Log ">>\tStart $class class of tests ($nbr_tests test)"
68 Log ">>\tStart $class class of tests ($nbr_tests tests)"
72 ExecTestCase $test $class
75 Log ">>\tEnd $class class of tests"
81 proc ExecAllTests {} {
86 foreach class [exec "ls"] {
87 if {[file isdirectory $class]} {
93 proc GetParms {argv argc} {
94 # Other machines to try:
104 while {$index < $argc} {
105 set arg [lindex $argv $index]
114 set class [lindex $argv $index]
119 set test [lindex $argv $index]
142 if {$machine == ""} {
143 # Warning "Defaulting to machine $Test::machine"
144 set machine $Test::machine
148 if {[file isdirectory "$test_base/tests/$class"] == 0} {
149 Error "Class $class not found ($test_base/$class)"
155 Error "You must specify the test class when performing individual test case runs"
157 if {[file exists "$test_base/tests/$class/$test"] == 0} {
158 Error "Test $test not found ($test_base/$class/$test)"
168 ExecTestCase $test $class