I want to create a mod-1.tm file that contains some functions.
However, I also want to include some tests.
If I use:
package require mod
I don't want any tests run.
But if I use:
$ tclsh mod-1.tm
or
$ tclsh mod-1.tm arg1 arg2
I want the tests to be run.
How can I do this?
I want to create a mod-1.tm file that contains some functions.
However, I also want to include some tests.
If I use:
package require mod
I don't want any tests run.
But if I use:
$ tclsh mod-1.tm
or
$ tclsh mod-1.tm arg1 arg2
I want the tests to be run.
How can I do this?
On 12/20/2025 9:20 PM, Mark Summerfield wrote:
I want to create a mod-1.tm file that contains some functions.
However, I also want to include some tests.
If I use:
package require mod
I don't want any tests run.
But if I use:
$ tclsh mod-1.tm
or
$ tclsh mod-1.tm arg1 arg2
I want the tests to be run.
How can I do this?
The global argv0 should be different, in the 2 tclsh cases, it should be mod-1.tm while if you are doing the package require mod, in some other file, run as say, tclsh myapp.tcl, then argv0 would be myapp.tcl.
-e
| Sysop: | DaiTengu |
|---|---|
| Location: | Appleton, WI |
| Users: | 1,096 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 365:59:52 |
| Calls: | 14,034 |
| Calls today: | 2 |
| Files: | 187,081 |
| D/L today: |
1,724 files (524M bytes) |
| Messages: | 2,478,508 |