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: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 54 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 14:24:40 |
| Calls: | 742 |
| Files: | 1,218 |
| D/L today: |
3 files (2,681K bytes) |
| Messages: | 183,842 |
| Posted today: | 1 |