aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2010-09-28 07:52:11 +1000
committerSteve Bennett <steveb@workware.net.au>2010-10-15 11:02:55 +1000
commit417e0043f7612593d839d415039ee54c2603d28a (patch)
treeec29f05b14402a990d8196000f271dc641eea951
parent7f8193989dd032769e1b365404cbe103423571b5 (diff)
downloadjimtcl-417e0043f7612593d839d415039ee54c2603d28a.zip
jimtcl-417e0043f7612593d839d415039ee54c2603d28a.tar.gz
jimtcl-417e0043f7612593d839d415039ee54c2603d28a.tar.bz2
Source location for failed tests was wrong
That is, tests which didn't fail but did not give the expected result Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r--tests/testing.tcl16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/testing.tcl b/tests/testing.tcl
index 137e9ae..aca89b2 100644
--- a/tests/testing.tcl
+++ b/tests/testing.tcl
@@ -4,6 +4,14 @@ proc makeFile {contents name} {
close $f
}
+proc script_source {script} {
+ lassign [info source $script] f l
+ if {$f ne ""} {
+ puts "At : $f:$l"
+ return \t$f:$l
+ }
+}
+
proc error_source {} {
lassign [info stacktrace] p f l
if {$f ne ""} {
@@ -20,6 +28,8 @@ catch {
}
proc error_source {} {
}
+ proc script_source {script} {
+ }
}
proc section {name} {
@@ -50,7 +60,11 @@ proc test {id descr script expected} {
puts -nonewline "$id "
}
puts "ERR $descr"
- set source [error_source]
+ if {$rc == 0} {
+ set source [script_source $script]
+ } else {
+ set source [error_source]
+ }
puts "Expected: '$expected'"
puts "Got : '$result'"
incr ::test(numfail)