Tcl Library Source Code

Check-in [f6eb7e4e99]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added info about branches and version number incrementing. Tweaked install tooling notes.
Timelines: family | ancestors | descendants | both | doc-overhaul
Files: files | file ages | folders
SHA3-256: f6eb7e4e99c69b238bba149df7193af4d0da76269c5ebdf4eb5b3d9317919cc2
User & Date: aku 2019-03-12 05:49:48
Context
2019-03-17
19:59
Squash and replace unwanted smart quotes. check-in: 590e67f11c user: aku tags: doc-overhaul
2019-03-12
05:49
Added info about branches and version number incrementing. Tweaked install tooling notes. check-in: f6eb7e4e99 user: aku tags: doc-overhaul
04:59
Filled in test writing and install support sections of the devguide. check-in: 9e39cdbfe8 user: aku tags: doc-overhaul
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to devdoc/parts/d_branchflow.inc.




































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
[subsection Branches]

An important part of working with a
[term {Distributed Version Control System}] ([term DVCS]) like
[uri https://www.fossil-scm.org/ fossil]
is the management and use of branches.

[para] For Tcllib the main branch of the collection is
[term trunk]. In [term git] this branch would be called [term master],
and this exactly the case in the
[uri https://github.com/tcltk/tcllib/ {github mirror}] of Tcllib.

[para] In support of debugging, like searching for when an issue
appeared via bisection, each commit on this branch must pass the
entire testsuite of the collection.

[para] As fossil has no mechanism to enfore this this is handled on
the honor system for developers and maintainers.

[para] To make the task easier Tcllib comes with a tool
([file sak.tcl]) providing a number of commands in support. These
commands are explained in the following sections of this guide.

[para] While it is possible and allowed to commit directly to trunk
remember the above regarding the testsuite, and the coming notes about
other possible issues with a commit.

[para] Because of this it is (strongly) recommended to perform any
development on a nicely named (nick of dev, ticket reference if any,
keywords applicable to the work, ...) non-trunk branch. Outside of the
trunk developers are allowed to commit intermediate broken states of
their work. Only at the end, when the branch is considered ready for
merging will it be necessary to perform full validation.

[subsection {Version numbers}]

In Tcllib all changes to a package have to come with an increment of
its version number. With what part is incremented (patchlevel, minor,
major version) dependent on the kind of change made. With multiple
changes in a commit the highest "wins".

[para] When working in a development branch the version change can be
defered until it is time to merge, and then has to cover all the
changes in the branch.

[para] Below a list of the kinds of changes and their association
version increments:

[list_begin definitions]
[def [term {D - documentation}]] No increment
[def [term {T - testsuite}]] No increment
[def [term {B - bugfix}]] Patchlevel
[def [term {I - implementation tweak}]] Patchlevel
[def [term {P - performance tweak}]] Patchlevel
[def [term {E - backward-compatible extension}]] Minor
[def [term {API - incompatible change}]] Major
[list_end]

[para] Note, a commit containing a version increment has to mention
the kind of change which caused it in the commit message, as well as
the new version number.

[para] Note further that the version number of a package currently
exists in 3 places. An increment has to update all of them:

[list_begin enumerated]
[enum] The package implementation.
[enum] The package index ([file pkgIndex.tcl])
[enum] The package documentation.
[list_end]

[para] The [file sak.tcl] command [cmd {validate version}] helps
finding discrepancies between the first two.

All the other [cmd validate] methods are also of interest to any
developer. Invoke it with

[example {
    sak.tcl help validate
}]

to see their documentation.

Changes to devdoc/parts/d_installation.inc.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
A last thing to consider when adding a new package to the collection
is installation.

[para] How to [emph use] the tool, the [file installer.tcl] script is
doumented in
[term {Tcllib - The Installer's Guide}].

[para] Here we document how to extend the installer so that it may
install the new package(s).

[para] In most cases only a single file has to be modified,
[file support/installation/modules.tcl] holding one command per module
and application to install.

[para] The commands are:

[list_begin definitions]

[call [cmd Module] [arg name] \
      	   [arg code-action] \
      	   [arg doc-action] \
	   [arg example-action]]


|
<
|

|
|

|



|







1
2
3
4

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
A last thing to consider when adding a new package to the collection
is installation.

[para] How to [emph use] the [file installer.tcl] script is documented

in [term {Tcllib - The Installer's Guide}].

[para] Here we document how to extend said installer so that it may
install new package(s) and/or application(s).

[para] In most cases only a single file has to be modified, the
[file support/installation/modules.tcl] holding one command per module
and application to install.

[para] The relevant commands are:

[list_begin definitions]

[call [cmd Module] [arg name] \
      	   [arg code-action] \
      	   [arg doc-action] \
	   [arg example-action]]

Changes to devdoc/tcllib_devguide.man.

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
[comment {===================================================================}]
[section Commitments]
[subsection Contributor][include parts/d_contrib.inc]
[subsection Maintainer][include parts/d_maintain.inc]

[comment {===================================================================}]
[section {Branching and Workflow}]
[include parts/d_branchflow.inc]x

[comment {===================================================================}]
[section {Structural Overview}]
[include parts/d_dirlayout.inc]

[comment {===================================================================}]
[section {Testsuite Tooling}]






|







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
[comment {===================================================================}]
[section Commitments]
[subsection Contributor][include parts/d_contrib.inc]
[subsection Maintainer][include parts/d_maintain.inc]

[comment {===================================================================}]
[section {Branching and Workflow}]
[include parts/d_branchflow.inc]

[comment {===================================================================}]
[section {Structural Overview}]
[include parts/d_dirlayout.inc]

[comment {===================================================================}]
[section {Testsuite Tooling}]

Changes to embedded/www/tcllib/files/devdoc/tcllib_devguide.html.

110
111
112
113
114
115
116
117





118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
...
239
240
241
242
243
244
245





































































246

247

248
249
250
251
252
253
254
255
256
...
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
...
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
...
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
...
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
...
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
...
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
...
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
<li class="doctools_section"><a href="#section1">Description</a></li>
<li class="doctools_section"><a href="#section2">Commitments</a>
<ul>
<li class="doctools_subsection"><a href="#subsection1">Contributor</a></li>
<li class="doctools_subsection"><a href="#subsection2">Maintainer</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section3">Branching and Workflow</a></li>





<li class="doctools_section"><a href="#section4">Structural Overview</a>
<ul>
<li class="doctools_subsection"><a href="#subsection3">Main Directories</a></li>
<li class="doctools_subsection"><a href="#subsection4">More Directories</a></li>
<li class="doctools_subsection"><a href="#subsection5">Top Files</a></li>
<li class="doctools_subsection"><a href="#subsection6">File Types</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section5">Testsuite Tooling</a>
<ul>
<li class="doctools_subsection"><a href="#subsection7">Invoke the testsuites of a specific module</a></li>
<li class="doctools_subsection"><a href="#subsection8">Invoke the testsuites of all modules</a></li>
<li class="doctools_subsection"><a href="#subsection9">Detailed Test Logs</a></li>
<li class="doctools_subsection"><a href="#subsection10">Shell Selection</a></li>
<li class="doctools_subsection"><a href="#subsection11">Help</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section6">Documentation Tooling</a>
<ul>
<li class="doctools_subsection"><a href="#subsection12">Generate documentation for a specific module</a></li>
<li class="doctools_subsection"><a href="#subsection13">Generate documentation for all modules</a></li>
<li class="doctools_subsection"><a href="#subsection14">Available output formats, help</a></li>
<li class="doctools_subsection"><a href="#subsection15">Validation without output</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section7">Notes On Writing A Testsuite</a></li>
<li class="doctools_section"><a href="#section8">Installation Tooling</a></li>
</ul>
</div>
<div id="synopsis" class="doctools_section"><h2><a name="synopsis">Synopsis</a></h2>
................................................................................
</ol>
</li>
<li><p>Follow the <span class="sectref"><a href="#section3">Branching and Workflow</a></span> of this guide.</p></li>
</ol>
</div>
</div>
<div id="section3" class="doctools_section"><h2><a name="section3">Branching and Workflow</a></h2>





































































<p>x</p>

</div>

<div id="section4" class="doctools_section"><h2><a name="section4">Structural Overview</a></h2>
<div id="subsection3" class="doctools_subsection"><h3><a name="subsection3">Main Directories</a></h3>
<p>The main directories in the Tcllib toplevel directory and of interest
to a developer are:</p>
<dl class="doctools_definitions">
<dt>&quot;<b class="file">modules</b>&quot;</dt>
<dd><p>Each child directory represents one or more packages.
In the case of the latter the packages are usually related in some
way. Examples are &quot;<b class="file">base64</b>&quot;, &quot;<b class="file">math</b>&quot;, and &quot;<b class="file">struct</b>&quot;, with
................................................................................
into sub-directories.</p></dd>
<dt>&quot;<b class="file">examples</b>&quot;</dt>
<dd><p>Each child directory &quot;<b class="file">foo</b>&quot; contains one or more example
application for the packages in &quot;<b class="file">modules/foo</b>&quot;. These examples are
generally not polished enough to be considered for installation.</p></dd>
</dl>
</div>
<div id="subsection4" class="doctools_subsection"><h3><a name="subsection4">More Directories</a></h3>
<dl class="doctools_definitions">
<dt>&quot;<b class="file">config</b>&quot;</dt>
<dd><p>This directory contains files supporting the unix build system,
i.e. &quot;<b class="file">configure</b>&quot; and &quot;<b class="file">Makefile.in</b>&quot;.</p></dd>
<dt>&quot;<b class="file">devdoc</b>&quot;</dt>
<dd><p>This directories contains the doctools sources for the global
documentation, like this document and its sibling guides.</p></dd>
................................................................................
This is the documentation which will be installed.</p></dd>
<dt>&quot;<b class="file">support</b>&quot;</dt>
<dd><p>This directory contains the sources of internal packages and utilities
used in the implementation of the &quot;<b class="file">installer.tcl</b>&quot; and
&quot;<b class="file">sak.tcl</b>&quot; scripts/tools.</p></dd>
</dl>
</div>
<div id="subsection5" class="doctools_subsection"><h3><a name="subsection5">Top Files</a></h3>
<dl class="doctools_definitions">
<dt>&quot;<b class="file">aclocal.m4</b>&quot;</dt>
<dd></dd>
<dt>&quot;<b class="file">configure</b>&quot;</dt>
<dd></dd>
<dt>&quot;<b class="file">configure.in</b>&quot;</dt>
<dd></dd>
................................................................................
<dd></dd>
<dt>&quot;<b class="file">tcllib.tap</b>&quot;</dt>
<dd></dd>
<dt>&quot;<b class="file">tcllib.yml</b>&quot;</dt>
<dd><p>????</p></dd>
</dl>
</div>
<div id="subsection6" class="doctools_subsection"><h3><a name="subsection6">File Types</a></h3>
<p>The most common file types, by file extension, are:</p>
<dl class="doctools_definitions">
<dt>&quot;<b class="file">.tcl</b>&quot;</dt>
<dd><p>Tcl code for a package, application, or example.</p></dd>
<dt>&quot;<b class="file">.man</b>&quot;</dt>
<dd><p>Doctools-formatted documentation, usually for a package.</p></dd>
<dt>&quot;<b class="file">.test</b>&quot;</dt>
................................................................................
<p>Testsuites in Tcllib are based on Tcl's standard test package
<b class="package">tcltest</b>, plus utilities found in the directory
&quot;<b class="file">modules/devtools</b>&quot;</p>
<p>Tcllib developers invoke the suites through the
<b class="cmd">test run</b> method of the &quot;<b class="file">sak.tcl</b>&quot; tool, with other methods
of <b class="cmd"><a href="../../../index.html#test">test</a></b> providing management operations, for example setting a
list of standard Tcl shells to use.</p>
<div id="subsection7" class="doctools_subsection"><h3><a name="subsection7">Invoke the testsuites of a specific module</a></h3>
<p>Invoke either</p>
<pre class="doctools_example">  ./sak.tcl test run FOO </pre>
<p>or</p>
<pre class="doctools_example">  ./sak.tcl test run modules/FOO </pre>
<p>to invoke the testsuites found in a specific module &quot;<b class="file">FOO</b>&quot;.</p>
</div>
<div id="subsection8" class="doctools_subsection"><h3><a name="subsection8">Invoke the testsuites of all modules</a></h3>
<p>Invoke the tool without a module name, i.e.</p>
<pre class="doctools_example">  ./sak.tcl test run </pre>
<p>to invoke the testsuites of all modules.</p>
</div>
<div id="subsection9" class="doctools_subsection"><h3><a name="subsection9">Detailed Test Logs</a></h3>
<p>In all the previous examples the test runner will write a combination
of progress display and testsuite log to the standard output, showing
for each module only the tests that passed or failed and how many of
each in a summary at the end.</p>
<p>To get a detailed log, it is necessary to invoke the test
runner with additional options.</p>
<p>For one:</p>
................................................................................
</pre>
<p>This writes the detailed log to the standard output, instead of the
short log.</p>
<p>Regardless of form, the detailed log contains a list of all test
cases executed, which failed, and how they failed (expected versus
actual results).</p>
</div>
<div id="subsection10" class="doctools_subsection"><h3><a name="subsection10">Shell Selection</a></h3>
<p>By default the test runner will use all the Tcl shells specified via
<b class="cmd">test add</b> to invoke the specified testsuites, if any. If no
such are specified it will fall back to the Tcl shell used to ran the
tool itself.</p>
<p>Use option <b class="option">--shell</b> to explicitly specify the Tcl shell
to use, like</p>
<pre class="doctools_example">
  ./sak.tcl test run --shell /path/to/tclsh ...
</pre>
</div>
<div id="subsection11" class="doctools_subsection"><h3><a name="subsection11">Help</a></h3>
<p>Invoke the tool as</p>
<pre class="doctools_example">  ./sak.tcl help test </pre>
<p>to see the detailed help for all methods of <b class="cmd"><a href="../../../index.html#test">test</a></b>, and the
associated options.</p>
</div>
</div>
<div id="section6" class="doctools_section"><h2><a name="section6">Documentation Tooling</a></h2>
................................................................................
Its supporting packages are a part of Tcllib, see the directories
&quot;<b class="file">modules/doctools</b>&quot; and &quot;<b class="file">modules/dtplite</b>&quot;. The latter is
an application package, with the actual application
&quot;<b class="file">apps/dtplite</b>&quot; a light wrapper around it.</p>
<p>Tcllib developers gain access to these through the <b class="cmd">doc</b>
method of the &quot;<b class="file">sak.tcl</b>&quot; tool, another (internal) wrapper around
the &quot;<b class="file">modules/dptlite</b>&quot; application package.</p>
<div id="subsection12" class="doctools_subsection"><h3><a name="subsection12">Generate documentation for a specific module</a></h3>
<p>Invoke either</p>
<pre class="doctools_example">  ./sak.tcl doc html FOO </pre>
<p>or</p>
<pre class="doctools_example">  ./sak.tcl doc html modules/FOO </pre>
<p>to generate HTML for the documentation found in the module &quot;<b class="file">FOO</b>&quot;.
Instead of <b class="const">html</b> any other supported format can be used here,
of course.</p>
<p>The generated formatted documentation will be placed into a
directory &quot;<b class="file">doc</b>&quot; in the current working directory.</p>
</div>
<div id="subsection13" class="doctools_subsection"><h3><a name="subsection13">Generate documentation for all modules</a></h3>
<p>Invoke the tool without a module name, i.e.</p>
<pre class="doctools_example">  ./sak.tcl doc html </pre>
<p>to generate HTML for the documentation found in all modules.
Instead of <b class="const">html</b> any other supported format can be used here,
of course.</p>
<p>The generated formatted documentation will be placed into a
directory &quot;<b class="file">doc</b>&quot; in the current working directory.</p>
</div>
<div id="subsection14" class="doctools_subsection"><h3><a name="subsection14">Available output formats, help</a></h3>
<p>Invoke the tool as</p>
<pre class="doctools_example">  ./sak.tcl help doc </pre>
<p>to see the entire set of supported output formats which can be
generated.</p>
</div>
<div id="subsection15" class="doctools_subsection"><h3><a name="subsection15">Validation without output</a></h3>
<p>Note the special format <b class="const">validate</b>.</p>
<p>Using this value as the name of the format to generate forces
the tool to simply check that the documentation is syntactically
correct, without generating actual output.</p>
<p>Invoke it as either</p>
<pre class="doctools_example">  ./sak.tcl doc validate (modules/)FOO </pre>
<p>or</p>
................................................................................
implementation while writing the tests. Like writing a test for a
condition like <i class="term">startnode not in input graph</i> serving as
reminder to put a check for this condition into the code.</p>
</div>
<div id="section8" class="doctools_section"><h2><a name="section8">Installation Tooling</a></h2>
<p>A last thing to consider when adding a new package to the collection
is installation.</p>
<p>How to <em>use</em> the tool, the &quot;<b class="file">installer.tcl</b>&quot; script is
doumented in
<i class="term"><a href="tcllib_installer.html">Tcllib - The Installer's Guide</a></i>.</p>
<p>Here we document how to extend the installer so that it may
install the new package(s).</p>
<p>In most cases only a single file has to be modified,
&quot;<b class="file">support/installation/modules.tcl</b>&quot; holding one command per module
and application to install.</p>
<p>The commands are:</p>
<dl class="doctools_definitions">
<dt><a name="1"><b class="cmd"><a href="../../../index.html#module">Module</a></b> <i class="arg">name</i> <i class="arg">code-action</i> <i class="arg">doc-action</i> <i class="arg">example-action</i></a></dt>
<dd><p>Install the packages of module <i class="arg">name</i>, found in
&quot;<b class="file">modules/<i class="arg">name</i></b>&quot;.</p>
<p>The <i class="arg">code-action</i> is responsible for installing the
packages and their index. The system currently provides</p>
<dl class="doctools_definitions">






|
>
>
>
>
>


|
|
|
|




|
|
|
|
|




|
|
|
|







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>

>

|







 







|







 







|







 







|







 







|






|




|







 







|










|







 







|










|








|





|







 







|
<
|
|
|
|


|







110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
...
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
...
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
...
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
...
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
...
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
...
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
...
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
...
640
641
642
643
644
645
646
647

648
649
650
651
652
653
654
655
656
657
658
659
660
661
<li class="doctools_section"><a href="#section1">Description</a></li>
<li class="doctools_section"><a href="#section2">Commitments</a>
<ul>
<li class="doctools_subsection"><a href="#subsection1">Contributor</a></li>
<li class="doctools_subsection"><a href="#subsection2">Maintainer</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section3">Branching and Workflow</a>
<ul>
<li class="doctools_subsection"><a href="#subsection3">Branches</a></li>
<li class="doctools_subsection"><a href="#subsection4">Version numbers</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section4">Structural Overview</a>
<ul>
<li class="doctools_subsection"><a href="#subsection5">Main Directories</a></li>
<li class="doctools_subsection"><a href="#subsection6">More Directories</a></li>
<li class="doctools_subsection"><a href="#subsection7">Top Files</a></li>
<li class="doctools_subsection"><a href="#subsection8">File Types</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section5">Testsuite Tooling</a>
<ul>
<li class="doctools_subsection"><a href="#subsection9">Invoke the testsuites of a specific module</a></li>
<li class="doctools_subsection"><a href="#subsection10">Invoke the testsuites of all modules</a></li>
<li class="doctools_subsection"><a href="#subsection11">Detailed Test Logs</a></li>
<li class="doctools_subsection"><a href="#subsection12">Shell Selection</a></li>
<li class="doctools_subsection"><a href="#subsection13">Help</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section6">Documentation Tooling</a>
<ul>
<li class="doctools_subsection"><a href="#subsection14">Generate documentation for a specific module</a></li>
<li class="doctools_subsection"><a href="#subsection15">Generate documentation for all modules</a></li>
<li class="doctools_subsection"><a href="#subsection16">Available output formats, help</a></li>
<li class="doctools_subsection"><a href="#subsection17">Validation without output</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section7">Notes On Writing A Testsuite</a></li>
<li class="doctools_section"><a href="#section8">Installation Tooling</a></li>
</ul>
</div>
<div id="synopsis" class="doctools_section"><h2><a name="synopsis">Synopsis</a></h2>
................................................................................
</ol>
</li>
<li><p>Follow the <span class="sectref"><a href="#section3">Branching and Workflow</a></span> of this guide.</p></li>
</ol>
</div>
</div>
<div id="section3" class="doctools_section"><h2><a name="section3">Branching and Workflow</a></h2>
<div id="subsection3" class="doctools_subsection"><h3><a name="subsection3">Branches</a></h3>
<p>An important part of working with a
<i class="term">Distributed Version Control System</i> (<i class="term">DVCS</i>) like
<a href="https://www.fossil-scm.org/">fossil</a>
is the management and use of branches.</p>
<p>For Tcllib the main branch of the collection is
<i class="term">trunk</i>. In <i class="term">git</i> this branch would be called <i class="term">master</i>,
and this exactly the case in the
<a href="https://github.com/tcltk/tcllib/">github mirror</a> of Tcllib.</p>
<p>In support of debugging, like searching for when an issue
appeared via bisection, each commit on this branch must pass the
entire testsuite of the collection.</p>
<p>As fossil has no mechanism to enfore this this is handled on
the honor system for developers and maintainers.</p>
<p>To make the task easier Tcllib comes with a tool
(&quot;<b class="file">sak.tcl</b>&quot;) providing a number of commands in support. These
commands are explained in the following sections of this guide.</p>
<p>While it is possible and allowed to commit directly to trunk
remember the above regarding the testsuite, and the coming notes about
other possible issues with a commit.</p>
<p>Because of this it is (strongly) recommended to perform any
development on a nicely named (nick of dev, ticket reference if any,
keywords applicable to the work, ...) non-trunk branch. Outside of the
trunk developers are allowed to commit intermediate broken states of
their work. Only at the end, when the branch is considered ready for
merging will it be necessary to perform full validation.</p>
</div>
<div id="subsection4" class="doctools_subsection"><h3><a name="subsection4">Version numbers</a></h3>
<p>In Tcllib all changes to a package have to come with an increment of
its version number. With what part is incremented (patchlevel, minor,
major version) dependent on the kind of change made. With multiple
changes in a commit the highest &quot;wins&quot;.</p>
<p>When working in a development branch the version change can be
defered until it is time to merge, and then has to cover all the
changes in the branch.</p>
<p>Below a list of the kinds of changes and their association
version increments:</p>
<dl class="doctools_definitions">
<dt><i class="term">D - documentation</i></dt>
<dd><p>No increment</p></dd>
<dt><i class="term">T - testsuite</i></dt>
<dd><p>No increment</p></dd>
<dt><i class="term">B - bugfix</i></dt>
<dd><p>Patchlevel</p></dd>
<dt><i class="term">I - implementation tweak</i></dt>
<dd><p>Patchlevel</p></dd>
<dt><i class="term">P - performance tweak</i></dt>
<dd><p>Patchlevel</p></dd>
<dt><i class="term">E - backward-compatible extension</i></dt>
<dd><p>Minor</p></dd>
<dt><i class="term">API - incompatible change</i></dt>
<dd><p>Major</p></dd>
</dl>
<p>Note, a commit containing a version increment has to mention
the kind of change which caused it in the commit message, as well as
the new version number.</p>
<p>Note further that the version number of a package currently
exists in 3 places. An increment has to update all of them:</p>
<ol class="doctools_enumerated">
<li><p>The package implementation.</p></li>
<li><p>The package index (&quot;<b class="file">pkgIndex.tcl</b>&quot;)</p></li>
<li><p>The package documentation.</p></li>
</ol>
<p>The &quot;<b class="file">sak.tcl</b>&quot; command <b class="cmd">validate version</b> helps
finding discrepancies between the first two.
All the other <b class="cmd">validate</b> methods are also of interest to any
developer. Invoke it with</p>
<pre class="doctools_example">
    sak.tcl help validate
</pre>
<p>to see their documentation.</p>
</div>
</div>
<div id="section4" class="doctools_section"><h2><a name="section4">Structural Overview</a></h2>
<div id="subsection5" class="doctools_subsection"><h3><a name="subsection5">Main Directories</a></h3>
<p>The main directories in the Tcllib toplevel directory and of interest
to a developer are:</p>
<dl class="doctools_definitions">
<dt>&quot;<b class="file">modules</b>&quot;</dt>
<dd><p>Each child directory represents one or more packages.
In the case of the latter the packages are usually related in some
way. Examples are &quot;<b class="file">base64</b>&quot;, &quot;<b class="file">math</b>&quot;, and &quot;<b class="file">struct</b>&quot;, with
................................................................................
into sub-directories.</p></dd>
<dt>&quot;<b class="file">examples</b>&quot;</dt>
<dd><p>Each child directory &quot;<b class="file">foo</b>&quot; contains one or more example
application for the packages in &quot;<b class="file">modules/foo</b>&quot;. These examples are
generally not polished enough to be considered for installation.</p></dd>
</dl>
</div>
<div id="subsection6" class="doctools_subsection"><h3><a name="subsection6">More Directories</a></h3>
<dl class="doctools_definitions">
<dt>&quot;<b class="file">config</b>&quot;</dt>
<dd><p>This directory contains files supporting the unix build system,
i.e. &quot;<b class="file">configure</b>&quot; and &quot;<b class="file">Makefile.in</b>&quot;.</p></dd>
<dt>&quot;<b class="file">devdoc</b>&quot;</dt>
<dd><p>This directories contains the doctools sources for the global
documentation, like this document and its sibling guides.</p></dd>
................................................................................
This is the documentation which will be installed.</p></dd>
<dt>&quot;<b class="file">support</b>&quot;</dt>
<dd><p>This directory contains the sources of internal packages and utilities
used in the implementation of the &quot;<b class="file">installer.tcl</b>&quot; and
&quot;<b class="file">sak.tcl</b>&quot; scripts/tools.</p></dd>
</dl>
</div>
<div id="subsection7" class="doctools_subsection"><h3><a name="subsection7">Top Files</a></h3>
<dl class="doctools_definitions">
<dt>&quot;<b class="file">aclocal.m4</b>&quot;</dt>
<dd></dd>
<dt>&quot;<b class="file">configure</b>&quot;</dt>
<dd></dd>
<dt>&quot;<b class="file">configure.in</b>&quot;</dt>
<dd></dd>
................................................................................
<dd></dd>
<dt>&quot;<b class="file">tcllib.tap</b>&quot;</dt>
<dd></dd>
<dt>&quot;<b class="file">tcllib.yml</b>&quot;</dt>
<dd><p>????</p></dd>
</dl>
</div>
<div id="subsection8" class="doctools_subsection"><h3><a name="subsection8">File Types</a></h3>
<p>The most common file types, by file extension, are:</p>
<dl class="doctools_definitions">
<dt>&quot;<b class="file">.tcl</b>&quot;</dt>
<dd><p>Tcl code for a package, application, or example.</p></dd>
<dt>&quot;<b class="file">.man</b>&quot;</dt>
<dd><p>Doctools-formatted documentation, usually for a package.</p></dd>
<dt>&quot;<b class="file">.test</b>&quot;</dt>
................................................................................
<p>Testsuites in Tcllib are based on Tcl's standard test package
<b class="package">tcltest</b>, plus utilities found in the directory
&quot;<b class="file">modules/devtools</b>&quot;</p>
<p>Tcllib developers invoke the suites through the
<b class="cmd">test run</b> method of the &quot;<b class="file">sak.tcl</b>&quot; tool, with other methods
of <b class="cmd"><a href="../../../index.html#test">test</a></b> providing management operations, for example setting a
list of standard Tcl shells to use.</p>
<div id="subsection9" class="doctools_subsection"><h3><a name="subsection9">Invoke the testsuites of a specific module</a></h3>
<p>Invoke either</p>
<pre class="doctools_example">  ./sak.tcl test run FOO </pre>
<p>or</p>
<pre class="doctools_example">  ./sak.tcl test run modules/FOO </pre>
<p>to invoke the testsuites found in a specific module &quot;<b class="file">FOO</b>&quot;.</p>
</div>
<div id="subsection10" class="doctools_subsection"><h3><a name="subsection10">Invoke the testsuites of all modules</a></h3>
<p>Invoke the tool without a module name, i.e.</p>
<pre class="doctools_example">  ./sak.tcl test run </pre>
<p>to invoke the testsuites of all modules.</p>
</div>
<div id="subsection11" class="doctools_subsection"><h3><a name="subsection11">Detailed Test Logs</a></h3>
<p>In all the previous examples the test runner will write a combination
of progress display and testsuite log to the standard output, showing
for each module only the tests that passed or failed and how many of
each in a summary at the end.</p>
<p>To get a detailed log, it is necessary to invoke the test
runner with additional options.</p>
<p>For one:</p>
................................................................................
</pre>
<p>This writes the detailed log to the standard output, instead of the
short log.</p>
<p>Regardless of form, the detailed log contains a list of all test
cases executed, which failed, and how they failed (expected versus
actual results).</p>
</div>
<div id="subsection12" class="doctools_subsection"><h3><a name="subsection12">Shell Selection</a></h3>
<p>By default the test runner will use all the Tcl shells specified via
<b class="cmd">test add</b> to invoke the specified testsuites, if any. If no
such are specified it will fall back to the Tcl shell used to ran the
tool itself.</p>
<p>Use option <b class="option">--shell</b> to explicitly specify the Tcl shell
to use, like</p>
<pre class="doctools_example">
  ./sak.tcl test run --shell /path/to/tclsh ...
</pre>
</div>
<div id="subsection13" class="doctools_subsection"><h3><a name="subsection13">Help</a></h3>
<p>Invoke the tool as</p>
<pre class="doctools_example">  ./sak.tcl help test </pre>
<p>to see the detailed help for all methods of <b class="cmd"><a href="../../../index.html#test">test</a></b>, and the
associated options.</p>
</div>
</div>
<div id="section6" class="doctools_section"><h2><a name="section6">Documentation Tooling</a></h2>
................................................................................
Its supporting packages are a part of Tcllib, see the directories
&quot;<b class="file">modules/doctools</b>&quot; and &quot;<b class="file">modules/dtplite</b>&quot;. The latter is
an application package, with the actual application
&quot;<b class="file">apps/dtplite</b>&quot; a light wrapper around it.</p>
<p>Tcllib developers gain access to these through the <b class="cmd">doc</b>
method of the &quot;<b class="file">sak.tcl</b>&quot; tool, another (internal) wrapper around
the &quot;<b class="file">modules/dptlite</b>&quot; application package.</p>
<div id="subsection14" class="doctools_subsection"><h3><a name="subsection14">Generate documentation for a specific module</a></h3>
<p>Invoke either</p>
<pre class="doctools_example">  ./sak.tcl doc html FOO </pre>
<p>or</p>
<pre class="doctools_example">  ./sak.tcl doc html modules/FOO </pre>
<p>to generate HTML for the documentation found in the module &quot;<b class="file">FOO</b>&quot;.
Instead of <b class="const">html</b> any other supported format can be used here,
of course.</p>
<p>The generated formatted documentation will be placed into a
directory &quot;<b class="file">doc</b>&quot; in the current working directory.</p>
</div>
<div id="subsection15" class="doctools_subsection"><h3><a name="subsection15">Generate documentation for all modules</a></h3>
<p>Invoke the tool without a module name, i.e.</p>
<pre class="doctools_example">  ./sak.tcl doc html </pre>
<p>to generate HTML for the documentation found in all modules.
Instead of <b class="const">html</b> any other supported format can be used here,
of course.</p>
<p>The generated formatted documentation will be placed into a
directory &quot;<b class="file">doc</b>&quot; in the current working directory.</p>
</div>
<div id="subsection16" class="doctools_subsection"><h3><a name="subsection16">Available output formats, help</a></h3>
<p>Invoke the tool as</p>
<pre class="doctools_example">  ./sak.tcl help doc </pre>
<p>to see the entire set of supported output formats which can be
generated.</p>
</div>
<div id="subsection17" class="doctools_subsection"><h3><a name="subsection17">Validation without output</a></h3>
<p>Note the special format <b class="const">validate</b>.</p>
<p>Using this value as the name of the format to generate forces
the tool to simply check that the documentation is syntactically
correct, without generating actual output.</p>
<p>Invoke it as either</p>
<pre class="doctools_example">  ./sak.tcl doc validate (modules/)FOO </pre>
<p>or</p>
................................................................................
implementation while writing the tests. Like writing a test for a
condition like <i class="term">startnode not in input graph</i> serving as
reminder to put a check for this condition into the code.</p>
</div>
<div id="section8" class="doctools_section"><h2><a name="section8">Installation Tooling</a></h2>
<p>A last thing to consider when adding a new package to the collection
is installation.</p>
<p>How to <em>use</em> the &quot;<b class="file">installer.tcl</b>&quot; script is documented

in <i class="term"><a href="tcllib_installer.html">Tcllib - The Installer's Guide</a></i>.</p>
<p>Here we document how to extend said installer so that it may
install new package(s) and/or application(s).</p>
<p>In most cases only a single file has to be modified, the
&quot;<b class="file">support/installation/modules.tcl</b>&quot; holding one command per module
and application to install.</p>
<p>The relevant commands are:</p>
<dl class="doctools_definitions">
<dt><a name="1"><b class="cmd"><a href="../../../index.html#module">Module</a></b> <i class="arg">name</i> <i class="arg">code-action</i> <i class="arg">doc-action</i> <i class="arg">example-action</i></a></dt>
<dd><p>Install the packages of module <i class="arg">name</i>, found in
&quot;<b class="file">modules/<i class="arg">name</i></b>&quot;.</p>
<p>The <i class="arg">code-action</i> is responsible for installing the
packages and their index. The system currently provides</p>
<dl class="doctools_definitions">

Changes to idoc/man/files/devdoc/tcllib_devguide.n.

377
378
379
380
381
382
383






















































































384





385
386
387
388
389
390
391
...
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
Coordination and discussion with ticket submitter during
the development and/or application of bug fixes\&.
.RE
.IP [4]
Follow the \fBBranching and Workflow\fR of this guide\&.
.PP
.SH "BRANCHING AND WORKFLOW"






















































































x





.SH "STRUCTURAL OVERVIEW"
.SS "MAIN DIRECTORIES"
The main directories in the Tcllib toplevel directory and of interest
to a developer are:
.TP
"\fImodules\fR"
Each child directory represents one or more packages\&.
................................................................................
implementation while writing the tests\&. Like writing a test for a
condition like \fIstartnode not in input graph\fR serving as
reminder to put a check for this condition into the code\&.
.SH "INSTALLATION TOOLING"
A last thing to consider when adding a new package to the collection
is installation\&.
.PP
How to \fIuse\fR the tool, the "\fIinstaller\&.tcl\fR" script is
doumented in
\fITcllib - The Installer's Guide\fR\&.
.PP
Here we document how to extend the installer so that it may
install the new package(s)\&.
.PP
In most cases only a single file has to be modified,
"\fIsupport/installation/modules\&.tcl\fR" holding one command per module
and application to install\&.
.PP
The commands are:
.TP
\fBModule\fR \fIname\fR \fIcode-action\fR \fIdoc-action\fR \fIexample-action\fR
Install the packages of module \fIname\fR, found in
"\fImodules/\fIname\fR\fR"\&.
.sp
The \fIcode-action\fR is responsible for installing the
packages and their index\&. The system currently provides






>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>







 







|
<
|

|
|

|



|







377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
...
865
866
867
868
869
870
871
872

873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
Coordination and discussion with ticket submitter during
the development and/or application of bug fixes\&.
.RE
.IP [4]
Follow the \fBBranching and Workflow\fR of this guide\&.
.PP
.SH "BRANCHING AND WORKFLOW"
.SS BRANCHES
An important part of working with a
\fIDistributed Version Control System\fR (\fIDVCS\fR) like
\fIfossil\fR [https://www\&.fossil-scm\&.org/]
is the management and use of branches\&.
.PP
For Tcllib the main branch of the collection is
\fItrunk\fR\&. In \fIgit\fR this branch would be called \fImaster\fR,
and this exactly the case in the
\fIgithub mirror\fR [https://github\&.com/tcltk/tcllib/] of Tcllib\&.
.PP
In support of debugging, like searching for when an issue
appeared via bisection, each commit on this branch must pass the
entire testsuite of the collection\&.
.PP
As fossil has no mechanism to enfore this this is handled on
the honor system for developers and maintainers\&.
.PP
To make the task easier Tcllib comes with a tool
("\fIsak\&.tcl\fR") providing a number of commands in support\&. These
commands are explained in the following sections of this guide\&.
.PP
While it is possible and allowed to commit directly to trunk
remember the above regarding the testsuite, and the coming notes about
other possible issues with a commit\&.
.PP
Because of this it is (strongly) recommended to perform any
development on a nicely named (nick of dev, ticket reference if any,
keywords applicable to the work, \&.\&.\&.) non-trunk branch\&. Outside of the
trunk developers are allowed to commit intermediate broken states of
their work\&. Only at the end, when the branch is considered ready for
merging will it be necessary to perform full validation\&.
.SS "VERSION NUMBERS"
In Tcllib all changes to a package have to come with an increment of
its version number\&. With what part is incremented (patchlevel, minor,
major version) dependent on the kind of change made\&. With multiple
changes in a commit the highest "wins"\&.
.PP
When working in a development branch the version change can be
defered until it is time to merge, and then has to cover all the
changes in the branch\&.
.PP
Below a list of the kinds of changes and their association
version increments:
.TP
\fID - documentation\fR
No increment
.TP
\fIT - testsuite\fR
No increment
.TP
\fIB - bugfix\fR
Patchlevel
.TP
\fII - implementation tweak\fR
Patchlevel
.TP
\fIP - performance tweak\fR
Patchlevel
.TP
\fIE - backward-compatible extension\fR
Minor
.TP
\fIAPI - incompatible change\fR
Major
.PP
.PP
Note, a commit containing a version increment has to mention
the kind of change which caused it in the commit message, as well as
the new version number\&.
.PP
Note further that the version number of a package currently
exists in 3 places\&. An increment has to update all of them:
.IP [1]
The package implementation\&.
.IP [2]
The package index ("\fIpkgIndex\&.tcl\fR")
.IP [3]
The package documentation\&.
.PP
.PP
The "\fIsak\&.tcl\fR" command \fBvalidate version\fR helps
finding discrepancies between the first two\&.
All the other \fBvalidate\fR methods are also of interest to any
developer\&. Invoke it with
.CS


    sak\&.tcl help validate

.CE
to see their documentation\&.
.SH "STRUCTURAL OVERVIEW"
.SS "MAIN DIRECTORIES"
The main directories in the Tcllib toplevel directory and of interest
to a developer are:
.TP
"\fImodules\fR"
Each child directory represents one or more packages\&.
................................................................................
implementation while writing the tests\&. Like writing a test for a
condition like \fIstartnode not in input graph\fR serving as
reminder to put a check for this condition into the code\&.
.SH "INSTALLATION TOOLING"
A last thing to consider when adding a new package to the collection
is installation\&.
.PP
How to \fIuse\fR the "\fIinstaller\&.tcl\fR" script is documented

in \fITcllib - The Installer's Guide\fR\&.
.PP
Here we document how to extend said installer so that it may
install new package(s) and/or application(s)\&.
.PP
In most cases only a single file has to be modified, the
"\fIsupport/installation/modules\&.tcl\fR" holding one command per module
and application to install\&.
.PP
The relevant commands are:
.TP
\fBModule\fR \fIname\fR \fIcode-action\fR \fIdoc-action\fR \fIexample-action\fR
Install the packages of module \fIname\fR, found in
"\fImodules/\fIname\fR\fR"\&.
.sp
The \fIcode-action\fR is responsible for installing the
packages and their index\&. The system currently provides

Changes to idoc/www/tcllib/files/devdoc/tcllib_devguide.html.

117
118
119
120
121
122
123
124





125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
...
246
247
248
249
250
251
252





































































253

254

255
256
257
258
259
260
261
262
263
...
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
...
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
...
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
...
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
...
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
...
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
...
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
<li class="doctools_section"><a href="#section1">Description</a></li>
<li class="doctools_section"><a href="#section2">Commitments</a>
<ul>
<li class="doctools_subsection"><a href="#subsection1">Contributor</a></li>
<li class="doctools_subsection"><a href="#subsection2">Maintainer</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section3">Branching and Workflow</a></li>





<li class="doctools_section"><a href="#section4">Structural Overview</a>
<ul>
<li class="doctools_subsection"><a href="#subsection3">Main Directories</a></li>
<li class="doctools_subsection"><a href="#subsection4">More Directories</a></li>
<li class="doctools_subsection"><a href="#subsection5">Top Files</a></li>
<li class="doctools_subsection"><a href="#subsection6">File Types</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section5">Testsuite Tooling</a>
<ul>
<li class="doctools_subsection"><a href="#subsection7">Invoke the testsuites of a specific module</a></li>
<li class="doctools_subsection"><a href="#subsection8">Invoke the testsuites of all modules</a></li>
<li class="doctools_subsection"><a href="#subsection9">Detailed Test Logs</a></li>
<li class="doctools_subsection"><a href="#subsection10">Shell Selection</a></li>
<li class="doctools_subsection"><a href="#subsection11">Help</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section6">Documentation Tooling</a>
<ul>
<li class="doctools_subsection"><a href="#subsection12">Generate documentation for a specific module</a></li>
<li class="doctools_subsection"><a href="#subsection13">Generate documentation for all modules</a></li>
<li class="doctools_subsection"><a href="#subsection14">Available output formats, help</a></li>
<li class="doctools_subsection"><a href="#subsection15">Validation without output</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section7">Notes On Writing A Testsuite</a></li>
<li class="doctools_section"><a href="#section8">Installation Tooling</a></li>
</ul>
</div>
<div id="synopsis" class="doctools_section"><h2><a name="synopsis">Synopsis</a></h2>
................................................................................
</ol>
</li>
<li><p>Follow the <span class="sectref"><a href="#section3">Branching and Workflow</a></span> of this guide.</p></li>
</ol>
</div>
</div>
<div id="section3" class="doctools_section"><h2><a name="section3">Branching and Workflow</a></h2>





































































<p>x</p>

</div>

<div id="section4" class="doctools_section"><h2><a name="section4">Structural Overview</a></h2>
<div id="subsection3" class="doctools_subsection"><h3><a name="subsection3">Main Directories</a></h3>
<p>The main directories in the Tcllib toplevel directory and of interest
to a developer are:</p>
<dl class="doctools_definitions">
<dt>&quot;<b class="file">modules</b>&quot;</dt>
<dd><p>Each child directory represents one or more packages.
In the case of the latter the packages are usually related in some
way. Examples are &quot;<b class="file">base64</b>&quot;, &quot;<b class="file">math</b>&quot;, and &quot;<b class="file">struct</b>&quot;, with
................................................................................
into sub-directories.</p></dd>
<dt>&quot;<b class="file">examples</b>&quot;</dt>
<dd><p>Each child directory &quot;<b class="file">foo</b>&quot; contains one or more example
application for the packages in &quot;<b class="file">modules/foo</b>&quot;. These examples are
generally not polished enough to be considered for installation.</p></dd>
</dl>
</div>
<div id="subsection4" class="doctools_subsection"><h3><a name="subsection4">More Directories</a></h3>
<dl class="doctools_definitions">
<dt>&quot;<b class="file">config</b>&quot;</dt>
<dd><p>This directory contains files supporting the unix build system,
i.e. &quot;<b class="file">configure</b>&quot; and &quot;<b class="file">Makefile.in</b>&quot;.</p></dd>
<dt>&quot;<b class="file">devdoc</b>&quot;</dt>
<dd><p>This directories contains the doctools sources for the global
documentation, like this document and its sibling guides.</p></dd>
................................................................................
This is the documentation which will be installed.</p></dd>
<dt>&quot;<b class="file">support</b>&quot;</dt>
<dd><p>This directory contains the sources of internal packages and utilities
used in the implementation of the &quot;<b class="file">installer.tcl</b>&quot; and
&quot;<b class="file">sak.tcl</b>&quot; scripts/tools.</p></dd>
</dl>
</div>
<div id="subsection5" class="doctools_subsection"><h3><a name="subsection5">Top Files</a></h3>
<dl class="doctools_definitions">
<dt>&quot;<b class="file">aclocal.m4</b>&quot;</dt>
<dd></dd>
<dt>&quot;<b class="file">configure</b>&quot;</dt>
<dd></dd>
<dt>&quot;<b class="file">configure.in</b>&quot;</dt>
<dd></dd>
................................................................................
<dd></dd>
<dt>&quot;<b class="file">tcllib.tap</b>&quot;</dt>
<dd></dd>
<dt>&quot;<b class="file">tcllib.yml</b>&quot;</dt>
<dd><p>????</p></dd>
</dl>
</div>
<div id="subsection6" class="doctools_subsection"><h3><a name="subsection6">File Types</a></h3>
<p>The most common file types, by file extension, are:</p>
<dl class="doctools_definitions">
<dt>&quot;<b class="file">.tcl</b>&quot;</dt>
<dd><p>Tcl code for a package, application, or example.</p></dd>
<dt>&quot;<b class="file">.man</b>&quot;</dt>
<dd><p>Doctools-formatted documentation, usually for a package.</p></dd>
<dt>&quot;<b class="file">.test</b>&quot;</dt>
................................................................................
<p>Testsuites in Tcllib are based on Tcl's standard test package
<b class="package">tcltest</b>, plus utilities found in the directory
&quot;<b class="file">modules/devtools</b>&quot;</p>
<p>Tcllib developers invoke the suites through the
<b class="cmd">test run</b> method of the &quot;<b class="file">sak.tcl</b>&quot; tool, with other methods
of <b class="cmd"><a href="../../../index.html#test">test</a></b> providing management operations, for example setting a
list of standard Tcl shells to use.</p>
<div id="subsection7" class="doctools_subsection"><h3><a name="subsection7">Invoke the testsuites of a specific module</a></h3>
<p>Invoke either</p>
<pre class="doctools_example">  ./sak.tcl test run FOO </pre>
<p>or</p>
<pre class="doctools_example">  ./sak.tcl test run modules/FOO </pre>
<p>to invoke the testsuites found in a specific module &quot;<b class="file">FOO</b>&quot;.</p>
</div>
<div id="subsection8" class="doctools_subsection"><h3><a name="subsection8">Invoke the testsuites of all modules</a></h3>
<p>Invoke the tool without a module name, i.e.</p>
<pre class="doctools_example">  ./sak.tcl test run </pre>
<p>to invoke the testsuites of all modules.</p>
</div>
<div id="subsection9" class="doctools_subsection"><h3><a name="subsection9">Detailed Test Logs</a></h3>
<p>In all the previous examples the test runner will write a combination
of progress display and testsuite log to the standard output, showing
for each module only the tests that passed or failed and how many of
each in a summary at the end.</p>
<p>To get a detailed log, it is necessary to invoke the test
runner with additional options.</p>
<p>For one:</p>
................................................................................
</pre>
<p>This writes the detailed log to the standard output, instead of the
short log.</p>
<p>Regardless of form, the detailed log contains a list of all test
cases executed, which failed, and how they failed (expected versus
actual results).</p>
</div>
<div id="subsection10" class="doctools_subsection"><h3><a name="subsection10">Shell Selection</a></h3>
<p>By default the test runner will use all the Tcl shells specified via
<b class="cmd">test add</b> to invoke the specified testsuites, if any. If no
such are specified it will fall back to the Tcl shell used to ran the
tool itself.</p>
<p>Use option <b class="option">--shell</b> to explicitly specify the Tcl shell
to use, like</p>
<pre class="doctools_example">
  ./sak.tcl test run --shell /path/to/tclsh ...
</pre>
</div>
<div id="subsection11" class="doctools_subsection"><h3><a name="subsection11">Help</a></h3>
<p>Invoke the tool as</p>
<pre class="doctools_example">  ./sak.tcl help test </pre>
<p>to see the detailed help for all methods of <b class="cmd"><a href="../../../index.html#test">test</a></b>, and the
associated options.</p>
</div>
</div>
<div id="section6" class="doctools_section"><h2><a name="section6">Documentation Tooling</a></h2>
................................................................................
Its supporting packages are a part of Tcllib, see the directories
&quot;<b class="file">modules/doctools</b>&quot; and &quot;<b class="file">modules/dtplite</b>&quot;. The latter is
an application package, with the actual application
&quot;<b class="file">apps/dtplite</b>&quot; a light wrapper around it.</p>
<p>Tcllib developers gain access to these through the <b class="cmd">doc</b>
method of the &quot;<b class="file">sak.tcl</b>&quot; tool, another (internal) wrapper around
the &quot;<b class="file">modules/dptlite</b>&quot; application package.</p>
<div id="subsection12" class="doctools_subsection"><h3><a name="subsection12">Generate documentation for a specific module</a></h3>
<p>Invoke either</p>
<pre class="doctools_example">  ./sak.tcl doc html FOO </pre>
<p>or</p>
<pre class="doctools_example">  ./sak.tcl doc html modules/FOO </pre>
<p>to generate HTML for the documentation found in the module &quot;<b class="file">FOO</b>&quot;.
Instead of <b class="const">html</b> any other supported format can be used here,
of course.</p>
<p>The generated formatted documentation will be placed into a
directory &quot;<b class="file">doc</b>&quot; in the current working directory.</p>
</div>
<div id="subsection13" class="doctools_subsection"><h3><a name="subsection13">Generate documentation for all modules</a></h3>
<p>Invoke the tool without a module name, i.e.</p>
<pre class="doctools_example">  ./sak.tcl doc html </pre>
<p>to generate HTML for the documentation found in all modules.
Instead of <b class="const">html</b> any other supported format can be used here,
of course.</p>
<p>The generated formatted documentation will be placed into a
directory &quot;<b class="file">doc</b>&quot; in the current working directory.</p>
</div>
<div id="subsection14" class="doctools_subsection"><h3><a name="subsection14">Available output formats, help</a></h3>
<p>Invoke the tool as</p>
<pre class="doctools_example">  ./sak.tcl help doc </pre>
<p>to see the entire set of supported output formats which can be
generated.</p>
</div>
<div id="subsection15" class="doctools_subsection"><h3><a name="subsection15">Validation without output</a></h3>
<p>Note the special format <b class="const">validate</b>.</p>
<p>Using this value as the name of the format to generate forces
the tool to simply check that the documentation is syntactically
correct, without generating actual output.</p>
<p>Invoke it as either</p>
<pre class="doctools_example">  ./sak.tcl doc validate (modules/)FOO </pre>
<p>or</p>
................................................................................
implementation while writing the tests. Like writing a test for a
condition like <i class="term">startnode not in input graph</i> serving as
reminder to put a check for this condition into the code.</p>
</div>
<div id="section8" class="doctools_section"><h2><a name="section8">Installation Tooling</a></h2>
<p>A last thing to consider when adding a new package to the collection
is installation.</p>
<p>How to <em>use</em> the tool, the &quot;<b class="file">installer.tcl</b>&quot; script is
doumented in
<i class="term"><a href="tcllib_installer.html">Tcllib - The Installer's Guide</a></i>.</p>
<p>Here we document how to extend the installer so that it may
install the new package(s).</p>
<p>In most cases only a single file has to be modified,
&quot;<b class="file">support/installation/modules.tcl</b>&quot; holding one command per module
and application to install.</p>
<p>The commands are:</p>
<dl class="doctools_definitions">
<dt><a name="1"><b class="cmd"><a href="../../../index.html#module">Module</a></b> <i class="arg">name</i> <i class="arg">code-action</i> <i class="arg">doc-action</i> <i class="arg">example-action</i></a></dt>
<dd><p>Install the packages of module <i class="arg">name</i>, found in
&quot;<b class="file">modules/<i class="arg">name</i></b>&quot;.</p>
<p>The <i class="arg">code-action</i> is responsible for installing the
packages and their index. The system currently provides</p>
<dl class="doctools_definitions">






|
>
>
>
>
>


|
|
|
|




|
|
|
|
|




|
|
|
|







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>

>

|







 







|







 







|







 







|







 







|






|




|







 







|










|







 







|










|








|





|







 







|
<
|
|
|
|


|







117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
...
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
...
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
...
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
...
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
...
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
...
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
...
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
...
647
648
649
650
651
652
653
654

655
656
657
658
659
660
661
662
663
664
665
666
667
668
<li class="doctools_section"><a href="#section1">Description</a></li>
<li class="doctools_section"><a href="#section2">Commitments</a>
<ul>
<li class="doctools_subsection"><a href="#subsection1">Contributor</a></li>
<li class="doctools_subsection"><a href="#subsection2">Maintainer</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section3">Branching and Workflow</a>
<ul>
<li class="doctools_subsection"><a href="#subsection3">Branches</a></li>
<li class="doctools_subsection"><a href="#subsection4">Version numbers</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section4">Structural Overview</a>
<ul>
<li class="doctools_subsection"><a href="#subsection5">Main Directories</a></li>
<li class="doctools_subsection"><a href="#subsection6">More Directories</a></li>
<li class="doctools_subsection"><a href="#subsection7">Top Files</a></li>
<li class="doctools_subsection"><a href="#subsection8">File Types</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section5">Testsuite Tooling</a>
<ul>
<li class="doctools_subsection"><a href="#subsection9">Invoke the testsuites of a specific module</a></li>
<li class="doctools_subsection"><a href="#subsection10">Invoke the testsuites of all modules</a></li>
<li class="doctools_subsection"><a href="#subsection11">Detailed Test Logs</a></li>
<li class="doctools_subsection"><a href="#subsection12">Shell Selection</a></li>
<li class="doctools_subsection"><a href="#subsection13">Help</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section6">Documentation Tooling</a>
<ul>
<li class="doctools_subsection"><a href="#subsection14">Generate documentation for a specific module</a></li>
<li class="doctools_subsection"><a href="#subsection15">Generate documentation for all modules</a></li>
<li class="doctools_subsection"><a href="#subsection16">Available output formats, help</a></li>
<li class="doctools_subsection"><a href="#subsection17">Validation without output</a></li>
</ul>
</li>
<li class="doctools_section"><a href="#section7">Notes On Writing A Testsuite</a></li>
<li class="doctools_section"><a href="#section8">Installation Tooling</a></li>
</ul>
</div>
<div id="synopsis" class="doctools_section"><h2><a name="synopsis">Synopsis</a></h2>
................................................................................
</ol>
</li>
<li><p>Follow the <span class="sectref"><a href="#section3">Branching and Workflow</a></span> of this guide.</p></li>
</ol>
</div>
</div>
<div id="section3" class="doctools_section"><h2><a name="section3">Branching and Workflow</a></h2>
<div id="subsection3" class="doctools_subsection"><h3><a name="subsection3">Branches</a></h3>
<p>An important part of working with a
<i class="term">Distributed Version Control System</i> (<i class="term">DVCS</i>) like
<a href="https://www.fossil-scm.org/">fossil</a>
is the management and use of branches.</p>
<p>For Tcllib the main branch of the collection is
<i class="term">trunk</i>. In <i class="term">git</i> this branch would be called <i class="term">master</i>,
and this exactly the case in the
<a href="https://github.com/tcltk/tcllib/">github mirror</a> of Tcllib.</p>
<p>In support of debugging, like searching for when an issue
appeared via bisection, each commit on this branch must pass the
entire testsuite of the collection.</p>
<p>As fossil has no mechanism to enfore this this is handled on
the honor system for developers and maintainers.</p>
<p>To make the task easier Tcllib comes with a tool
(&quot;<b class="file">sak.tcl</b>&quot;) providing a number of commands in support. These
commands are explained in the following sections of this guide.</p>
<p>While it is possible and allowed to commit directly to trunk
remember the above regarding the testsuite, and the coming notes about
other possible issues with a commit.</p>
<p>Because of this it is (strongly) recommended to perform any
development on a nicely named (nick of dev, ticket reference if any,
keywords applicable to the work, ...) non-trunk branch. Outside of the
trunk developers are allowed to commit intermediate broken states of
their work. Only at the end, when the branch is considered ready for
merging will it be necessary to perform full validation.</p>
</div>
<div id="subsection4" class="doctools_subsection"><h3><a name="subsection4">Version numbers</a></h3>
<p>In Tcllib all changes to a package have to come with an increment of
its version number. With what part is incremented (patchlevel, minor,
major version) dependent on the kind of change made. With multiple
changes in a commit the highest &quot;wins&quot;.</p>
<p>When working in a development branch the version change can be
defered until it is time to merge, and then has to cover all the
changes in the branch.</p>
<p>Below a list of the kinds of changes and their association
version increments:</p>
<dl class="doctools_definitions">
<dt><i class="term">D - documentation</i></dt>
<dd><p>No increment</p></dd>
<dt><i class="term">T - testsuite</i></dt>
<dd><p>No increment</p></dd>
<dt><i class="term">B - bugfix</i></dt>
<dd><p>Patchlevel</p></dd>
<dt><i class="term">I - implementation tweak</i></dt>
<dd><p>Patchlevel</p></dd>
<dt><i class="term">P - performance tweak</i></dt>
<dd><p>Patchlevel</p></dd>
<dt><i class="term">E - backward-compatible extension</i></dt>
<dd><p>Minor</p></dd>
<dt><i class="term">API - incompatible change</i></dt>
<dd><p>Major</p></dd>
</dl>
<p>Note, a commit containing a version increment has to mention
the kind of change which caused it in the commit message, as well as
the new version number.</p>
<p>Note further that the version number of a package currently
exists in 3 places. An increment has to update all of them:</p>
<ol class="doctools_enumerated">
<li><p>The package implementation.</p></li>
<li><p>The package index (&quot;<b class="file">pkgIndex.tcl</b>&quot;)</p></li>
<li><p>The package documentation.</p></li>
</ol>
<p>The &quot;<b class="file">sak.tcl</b>&quot; command <b class="cmd">validate version</b> helps
finding discrepancies between the first two.
All the other <b class="cmd">validate</b> methods are also of interest to any
developer. Invoke it with</p>
<pre class="doctools_example">
    sak.tcl help validate
</pre>
<p>to see their documentation.</p>
</div>
</div>
<div id="section4" class="doctools_section"><h2><a name="section4">Structural Overview</a></h2>
<div id="subsection5" class="doctools_subsection"><h3><a name="subsection5">Main Directories</a></h3>
<p>The main directories in the Tcllib toplevel directory and of interest
to a developer are:</p>
<dl class="doctools_definitions">
<dt>&quot;<b class="file">modules</b>&quot;</dt>
<dd><p>Each child directory represents one or more packages.
In the case of the latter the packages are usually related in some
way. Examples are &quot;<b class="file">base64</b>&quot;, &quot;<b class="file">math</b>&quot;, and &quot;<b class="file">struct</b>&quot;, with
................................................................................
into sub-directories.</p></dd>
<dt>&quot;<b class="file">examples</b>&quot;</dt>
<dd><p>Each child directory &quot;<b class="file">foo</b>&quot; contains one or more example
application for the packages in &quot;<b class="file">modules/foo</b>&quot;. These examples are
generally not polished enough to be considered for installation.</p></dd>
</dl>
</div>
<div id="subsection6" class="doctools_subsection"><h3><a name="subsection6">More Directories</a></h3>
<dl class="doctools_definitions">
<dt>&quot;<b class="file">config</b>&quot;</dt>
<dd><p>This directory contains files supporting the unix build system,
i.e. &quot;<b class="file">configure</b>&quot; and &quot;<b class="file">Makefile.in</b>&quot;.</p></dd>
<dt>&quot;<b class="file">devdoc</b>&quot;</dt>
<dd><p>This directories contains the doctools sources for the global
documentation, like this document and its sibling guides.</p></dd>
................................................................................
This is the documentation which will be installed.</p></dd>
<dt>&quot;<b class="file">support</b>&quot;</dt>
<dd><p>This directory contains the sources of internal packages and utilities
used in the implementation of the &quot;<b class="file">installer.tcl</b>&quot; and
&quot;<b class="file">sak.tcl</b>&quot; scripts/tools.</p></dd>
</dl>
</div>
<div id="subsection7" class="doctools_subsection"><h3><a name="subsection7">Top Files</a></h3>
<dl class="doctools_definitions">
<dt>&quot;<b class="file">aclocal.m4</b>&quot;</dt>
<dd></dd>
<dt>&quot;<b class="file">configure</b>&quot;</dt>
<dd></dd>
<dt>&quot;<b class="file">configure.in</b>&quot;</dt>
<dd></dd>
................................................................................
<dd></dd>
<dt>&quot;<b class="file">tcllib.tap</b>&quot;</dt>
<dd></dd>
<dt>&quot;<b class="file">tcllib.yml</b>&quot;</dt>
<dd><p>????</p></dd>
</dl>
</div>
<div id="subsection8" class="doctools_subsection"><h3><a name="subsection8">File Types</a></h3>
<p>The most common file types, by file extension, are:</p>
<dl class="doctools_definitions">
<dt>&quot;<b class="file">.tcl</b>&quot;</dt>
<dd><p>Tcl code for a package, application, or example.</p></dd>
<dt>&quot;<b class="file">.man</b>&quot;</dt>
<dd><p>Doctools-formatted documentation, usually for a package.</p></dd>
<dt>&quot;<b class="file">.test</b>&quot;</dt>
................................................................................
<p>Testsuites in Tcllib are based on Tcl's standard test package
<b class="package">tcltest</b>, plus utilities found in the directory
&quot;<b class="file">modules/devtools</b>&quot;</p>
<p>Tcllib developers invoke the suites through the
<b class="cmd">test run</b> method of the &quot;<b class="file">sak.tcl</b>&quot; tool, with other methods
of <b class="cmd"><a href="../../../index.html#test">test</a></b> providing management operations, for example setting a
list of standard Tcl shells to use.</p>
<div id="subsection9" class="doctools_subsection"><h3><a name="subsection9">Invoke the testsuites of a specific module</a></h3>
<p>Invoke either</p>
<pre class="doctools_example">  ./sak.tcl test run FOO </pre>
<p>or</p>
<pre class="doctools_example">  ./sak.tcl test run modules/FOO </pre>
<p>to invoke the testsuites found in a specific module &quot;<b class="file">FOO</b>&quot;.</p>
</div>
<div id="subsection10" class="doctools_subsection"><h3><a name="subsection10">Invoke the testsuites of all modules</a></h3>
<p>Invoke the tool without a module name, i.e.</p>
<pre class="doctools_example">  ./sak.tcl test run </pre>
<p>to invoke the testsuites of all modules.</p>
</div>
<div id="subsection11" class="doctools_subsection"><h3><a name="subsection11">Detailed Test Logs</a></h3>
<p>In all the previous examples the test runner will write a combination
of progress display and testsuite log to the standard output, showing
for each module only the tests that passed or failed and how many of
each in a summary at the end.</p>
<p>To get a detailed log, it is necessary to invoke the test
runner with additional options.</p>
<p>For one:</p>
................................................................................
</pre>
<p>This writes the detailed log to the standard output, instead of the
short log.</p>
<p>Regardless of form, the detailed log contains a list of all test
cases executed, which failed, and how they failed (expected versus
actual results).</p>
</div>
<div id="subsection12" class="doctools_subsection"><h3><a name="subsection12">Shell Selection</a></h3>
<p>By default the test runner will use all the Tcl shells specified via
<b class="cmd">test add</b> to invoke the specified testsuites, if any. If no
such are specified it will fall back to the Tcl shell used to ran the
tool itself.</p>
<p>Use option <b class="option">--shell</b> to explicitly specify the Tcl shell
to use, like</p>
<pre class="doctools_example">
  ./sak.tcl test run --shell /path/to/tclsh ...
</pre>
</div>
<div id="subsection13" class="doctools_subsection"><h3><a name="subsection13">Help</a></h3>
<p>Invoke the tool as</p>
<pre class="doctools_example">  ./sak.tcl help test </pre>
<p>to see the detailed help for all methods of <b class="cmd"><a href="../../../index.html#test">test</a></b>, and the
associated options.</p>
</div>
</div>
<div id="section6" class="doctools_section"><h2><a name="section6">Documentation Tooling</a></h2>
................................................................................
Its supporting packages are a part of Tcllib, see the directories
&quot;<b class="file">modules/doctools</b>&quot; and &quot;<b class="file">modules/dtplite</b>&quot;. The latter is
an application package, with the actual application
&quot;<b class="file">apps/dtplite</b>&quot; a light wrapper around it.</p>
<p>Tcllib developers gain access to these through the <b class="cmd">doc</b>
method of the &quot;<b class="file">sak.tcl</b>&quot; tool, another (internal) wrapper around
the &quot;<b class="file">modules/dptlite</b>&quot; application package.</p>
<div id="subsection14" class="doctools_subsection"><h3><a name="subsection14">Generate documentation for a specific module</a></h3>
<p>Invoke either</p>
<pre class="doctools_example">  ./sak.tcl doc html FOO </pre>
<p>or</p>
<pre class="doctools_example">  ./sak.tcl doc html modules/FOO </pre>
<p>to generate HTML for the documentation found in the module &quot;<b class="file">FOO</b>&quot;.
Instead of <b class="const">html</b> any other supported format can be used here,
of course.</p>
<p>The generated formatted documentation will be placed into a
directory &quot;<b class="file">doc</b>&quot; in the current working directory.</p>
</div>
<div id="subsection15" class="doctools_subsection"><h3><a name="subsection15">Generate documentation for all modules</a></h3>
<p>Invoke the tool without a module name, i.e.</p>
<pre class="doctools_example">  ./sak.tcl doc html </pre>
<p>to generate HTML for the documentation found in all modules.
Instead of <b class="const">html</b> any other supported format can be used here,
of course.</p>
<p>The generated formatted documentation will be placed into a
directory &quot;<b class="file">doc</b>&quot; in the current working directory.</p>
</div>
<div id="subsection16" class="doctools_subsection"><h3><a name="subsection16">Available output formats, help</a></h3>
<p>Invoke the tool as</p>
<pre class="doctools_example">  ./sak.tcl help doc </pre>
<p>to see the entire set of supported output formats which can be
generated.</p>
</div>
<div id="subsection17" class="doctools_subsection"><h3><a name="subsection17">Validation without output</a></h3>
<p>Note the special format <b class="const">validate</b>.</p>
<p>Using this value as the name of the format to generate forces
the tool to simply check that the documentation is syntactically
correct, without generating actual output.</p>
<p>Invoke it as either</p>
<pre class="doctools_example">  ./sak.tcl doc validate (modules/)FOO </pre>
<p>or</p>
................................................................................
implementation while writing the tests. Like writing a test for a
condition like <i class="term">startnode not in input graph</i> serving as
reminder to put a check for this condition into the code.</p>
</div>
<div id="section8" class="doctools_section"><h2><a name="section8">Installation Tooling</a></h2>
<p>A last thing to consider when adding a new package to the collection
is installation.</p>
<p>How to <em>use</em> the &quot;<b class="file">installer.tcl</b>&quot; script is documented

in <i class="term"><a href="tcllib_installer.html">Tcllib - The Installer's Guide</a></i>.</p>
<p>Here we document how to extend said installer so that it may
install new package(s) and/or application(s).</p>
<p>In most cases only a single file has to be modified, the
&quot;<b class="file">support/installation/modules.tcl</b>&quot; holding one command per module
and application to install.</p>
<p>The relevant commands are:</p>
<dl class="doctools_definitions">
<dt><a name="1"><b class="cmd"><a href="../../../index.html#module">Module</a></b> <i class="arg">name</i> <i class="arg">code-action</i> <i class="arg">doc-action</i> <i class="arg">example-action</i></a></dt>
<dd><p>Install the packages of module <i class="arg">name</i>, found in
&quot;<b class="file">modules/<i class="arg">name</i></b>&quot;.</p>
<p>The <i class="arg">code-action</i> is responsible for installing the
packages and their index. The system currently provides</p>
<dl class="doctools_definitions">