aboutsummaryrefslogtreecommitdiff
path: root/tcltest.tcl
AgeCommit message (Collapse)AuthorFilesLines
2023-07-04tcltest: rework constraint systemSteve Bennett1-26/+96
Now 'constraint cmd|package' is like 'needs' but sets a constraint The command to 'needs cmd' and 'constraint cmd' can now take a subcommand to check. Add 'constraint|needs eval|expr' to make some constraint checks simpler. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-06-21core: Display errors in a more "pythonesque" waySteve Bennett1-21/+25
A typical error message now looks like this: t4.tcl:2: Error: syntax error in expression: "blah" Traceback (most recent call last): File "t4.tcl", line 14 c 1 2 3 File "t4.tcl", line 10, in c b a c File "t4.tcl", line 6, in b a A14 File "t4.tcl", line 2, in a expr blah This is produced by stackdump (that can be replaced), called by errorInfo. Note that now stacktraces (stacktrace, info stacktrace, $opts(-errorinfo)) include the running command at each level in addition to proc, file, line. In order for scripts to detect this new format, a new entry tcl_platform entry has been added: tcl_platform(stackFormat) = 4 (to signify 4 elements per frame) In addition, instead of building the error stack frame as the stack is unwound in response to an error, instead the entire current stack trace is captured by stacktrace. This means that the trace extends beyond the try/catch right back to the initial interpreter command. The 'stacktrace' command is now implemented in C based on the same code that generates the error stacktrace. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2023-05-06jim: info frame improvementsSteve Bennett1-10/+37
always include 'proc' even if introspection disabled correctly set 'proc' at the eval frame level that is currently running in the given proc. This makes it easier to produce an accurate level stacktrace even across uplevel, etc. Update stacktrace to use the new info frame. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-12-26core: commands that take an index now use integer expressionsSteve Bennett1-2/+2
This means that instead of just [list index 2+1], we can now do [list index end-$n*2+1] This applies to: lindex, linsert, lreplace, lset, lrange, lsort, regexp, regsub string index,first,last,range Also add tests for both direct integer expressions and indexes. Still needs doc update. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-11-08build: Fix build and tests for out-of-tree buildSteve Bennett1-4/+20
Loadable modules and tests Fixes #179 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-04-17tcltest: Add support for the -template optionSteve Bennett1-6/+38
When set, failed tests output a complete test command that would succeed. This is useful when creating new tests. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-09-21tcltest: Support 'needs package xxx'Steve Bennett1-0/+6
Makes it easy to skip all tests if the package isn't available Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-09-01Support lambda even if references are disabledSteve Bennett1-1/+1
It's convenient to support a non-gc lambda, even if references are disabled. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-09-28tcltest: print test description on SKIP if verboseSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-09-28tcltest: do a better job of cleanup up after testsSteve Bennett1-8/+23
In particular, glob2.test was leaving a lot of litter Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-08-26If possible, run tests within a sub-interpreterSteve Bennett1-0/+6
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2015-08-26tcltest: Fix reference to wrong variable nameEvan Hunter1-1/+1
2015-04-06Avoid error in tcltest.tcl if $::argv0 is unsetSteve Bennett1-4/+7
Can happen if running interactively or via -e Reported-by: Stuart Cassoff <stwo@bell.net> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-11-28glob: add additional testsSteve Bennett1-9/+29
Import some additional tests from the Tcl test suite. Add more Tcl compatibility to tcltest.tcl Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-10-15Install tcltest compatibility packageSteve Bennett1-0/+258
Allow 3rd party tests to be written and use: package require tcltest Signed-off-by: Steve Bennett <steveb@workware.net.au>