Tcl

TCL - Testing with <code>tcltest</code>
Login

Home

This directory contains a tutorial for tcltest.
There are also Unit Tests for the fnest package and related programs.

Check if tcltest is installed

Normally tcltest is installed with Tcl, but the check is easy:

    echo package require tcltest2 | tclsh

No output : good to go

Error message : can't find package tcltest - Check your installation.

tcltest - run a single test in a file, using -match

./fcgi.test -match fcgi-20

tcltest - troubleshooting

Solution to error when running <MY_SUBDIR>/all.tcl from parent directory:

From the CREATING TEST SUITES WITH TCLTEST section of the tcltest man page:

Alternative:

    package require tcltest 2.5
    namespace import ::tcltest::*
    set TCLTEST_DIR [file dirname [file normalize [info script]]]
    configure -testdir $TCLTEST_DIR
    runAllTests

Links

Man page: https://www.tcl.tk/man/tcl/TclCmd/tcltest.html

Tutorial:

Other tutorials: