File: api-ahven-framework.html

package info (click to toggle)
ahven 2.1-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,724 kB
  • sloc: ada: 3,928; makefile: 259; xml: 108; sh: 57; python: 25; perl: 7
file content (613 lines) | stat: -rw-r--r-- 46,279 bytes parent folder | download
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
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
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
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
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
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
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
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Ahven.Framework – Package &mdash; Ahven 2.1 documentation</title>
    
    <link rel="stylesheet" href="_static/nature.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '2.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="Ahven 2.1 documentation" href="index.html" />
    <link rel="up" title="API Documentation for Ahven" href="api.html" />
    <link rel="next" title="Ahven.Listeners.Basic – Package" href="api-ahven-listeners-basic.html" />
    <link rel="prev" title="Ahven – Package" href="api-ahven.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="ada-modindex.html" title="Ada Module Index"
             >Ada modules</a> |</li>
        <li class="right" >
          <a href="api-ahven-listeners-basic.html" title="Ahven.Listeners.Basic – Package"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="api-ahven.html" title="Ahven – Package"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">Ahven 2.1 documentation</a> &raquo;</li>
          <li><a href="api.html" accesskey="U">API Documentation for Ahven</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-Ahven.Framework">
<span id="ahven-framework-package"></span><h1><tt class="xref py py-mod docutils literal"><span class="pre">Ahven.Framework</span></tt> &#8211; Package<a class="headerlink" href="#module-Ahven.Framework" title="Permalink to this headline">¶</a></h1>
<div class="section" id="types">
<h2>Types<a class="headerlink" href="#types" title="Permalink to this headline">¶</a></h2>
<div class="section" id="test-count-type">
<h3>Test_Count_Type<a class="headerlink" href="#test-count-type" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">type</span> <span class="kt">Test_Count_Type</span> <span class="kr">is</span> <span class="kr">new</span> <span class="kt">Natural</span><span class="p">;</span>
</pre></div>
</div>
<p>Type for the test count. This effectively
limits the amount tests to whatever Natural is.</p>
<p>Although, in practice when adding tests the limit
is not checked.</p>
</div>
<div class="section" id="test-duration">
<h3>Test_Duration<a class="headerlink" href="#test-duration" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">subtype</span> <span class="kt">Test_Duration</span> <span class="kr">is</span> <span class="kt">Duration</span> <span class="kr">range</span> <span class="mf">0.0</span> <span class="p">..</span> <span class="n">Three_Hours</span><span class="p">;</span>
</pre></div>
</div>
<p>Subtype for the test timeouts. Limited to 3 hours, which
should be enough for unit tests. Timeout value 0.0 means infinite time.</p>
</div>
<div class="section" id="test">
<h3>Test<a class="headerlink" href="#test" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">type</span> <span class="kt">Test</span> <span class="kr">is</span> <span class="kr">abstract</span> <span class="kr">new</span> <span class="n">Ada</span><span class="p">.</span><span class="n">Finalization</span><span class="p">.</span><span class="n">Controlled</span> <span class="kr">with</span> <span class="kc">null</span> <span class="kr">record</span><span class="p">;</span>
</pre></div>
</div>
</div>
<div class="section" id="test-class-access">
<h3>Test_Class_Access<a class="headerlink" href="#test-class-access" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">type</span> <span class="kt">Test_Class_Access</span> <span class="kr">is</span> <span class="kr">access</span> <span class="kr">all</span> <span class="n">Test</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">;</span>
</pre></div>
</div>
<p>An access type for Test&#8217;Class.</p>
</div>
<div class="section" id="test-case">
<h3>Test_Case<a class="headerlink" href="#test-case" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">type</span> <span class="kt">Test_Case</span> <span class="kr">is</span> <span class="kr">abstract</span> <span class="kr">new</span> <span class="n">Test</span> <span class="kr">with</span> <span class="kd">private</span><span class="p">;</span>
</pre></div>
</div>
<p>The base type for other test cases.</p>
</div>
<div class="section" id="object-test-routine-access">
<h3>Object_Test_Routine_Access<a class="headerlink" href="#object-test-routine-access" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">type</span> <span class="kt">Object_Test_Routine_Access</span> <span class="kr">is</span>
  <span class="kr">access</span> <span class="kd">procedure</span> <span class="p">(</span><span class="nv">T</span> <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test_Case</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">);</span>
</pre></div>
</div>
<p>A pointer to a test routine which takes Test_Case&#8217;Class object
as an argument.</p>
<p>For this kind of test routines, the framework will
call Set_Up and Tear_Down routines before and after
test routine execution.</p>
</div>
<div class="section" id="simple-test-routine-access">
<h3>Simple_Test_Routine_Access<a class="headerlink" href="#simple-test-routine-access" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">type</span> <span class="kt">Simple_Test_Routine_Access</span> <span class="kr">is</span> <span class="kr">access</span> <span class="kd">procedure</span><span class="p">;</span>
</pre></div>
</div>
<p>A pointer to a test routine which does not take arguments.</p>
</div>
<div class="section" id="test-suite">
<h3>Test_Suite<a class="headerlink" href="#test-suite" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">type</span> <span class="kt">Test_Suite</span> <span class="kr">is</span> <span class="kr">new</span> <span class="n">Test</span> <span class="kr">with</span> <span class="kd">private</span><span class="p">;</span>
</pre></div>
</div>
<p>A collection of Tests.</p>
<p>You can either fill a Test_Suite object with Test_Case objects
or nest multiple Test_Suite objects. You can even mix
Test_Case and Test_Suite objects, if necessary.</p>
</div>
<div class="section" id="test-suite-access">
<h3>Test_Suite_Access<a class="headerlink" href="#test-suite-access" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">type</span> <span class="kt">Test_Suite_Access</span> <span class="kr">is</span> <span class="kr">access</span> <span class="kr">all</span> <span class="n">Test_Suite</span><span class="p">;</span>
</pre></div>
</div>
<p>An access type for Test_Suite.</p>
</div>
</div>
<div class="section" id="procedures-and-functions">
<h2>Procedures and functions<a class="headerlink" href="#procedures-and-functions" title="Permalink to this headline">¶</a></h2>
<div class="section" id="set-up">
<h3>Set_Up<a class="headerlink" href="#set-up" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Set_Up</span> <span class="p">(</span><span class="nv">T</span> <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="tear-down">
<h3>Tear_Down<a class="headerlink" href="#tear-down" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Tear_Down</span> <span class="p">(</span><span class="nv">T</span> <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test</span><span class="p">);</span>
</pre></div>
</div>
<p>Tear_Down is called after the test procedure is executed.</p>
</div>
<div class="section" id="get-name">
<h3>Get_Name<a class="headerlink" href="#get-name" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">function</span> <span class="nf">Get_Name</span> <span class="p">(</span><span class="nv">T</span> <span class="p">: </span><span class="n">Test</span><span class="p">)</span> <span class="kr">return</span> <span class="kt">String</span> <span class="kr">is</span> <span class="kr">abstract</span><span class="p">;</span>
</pre></div>
</div>
</div>
<div class="section" id="run">
<h3>Run<a class="headerlink" href="#run" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Run</span> <span class="p">(</span><span class="nv">T</span>         <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test</span><span class="p">;</span>
               <span class="nv">Listener</span>  <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Listeners</span><span class="p">.</span><span class="n">Result_Listener</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="id1">
<h3>Run<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Run</span> <span class="p">(</span><span class="nv">T</span>         <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test</span><span class="p">;</span>
               <span class="nv">Listener</span>  <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Listeners</span><span class="p">.</span><span class="n">Result_Listener</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">;</span>
               <span class="nv">Timeout</span>   <span class="p">: </span>       <span class="n">Test_Duration</span><span class="p">)</span>
  <span class="kr">is</span> <span class="kr">abstract</span><span class="p">;</span>
</pre></div>
</div>
</div>
<div class="section" id="id2">
<h3>Run<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Run</span> <span class="p">(</span><span class="nv">T</span>         <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test</span><span class="p">;</span>
               <span class="nv">Test_Name</span> <span class="p">: </span>       <span class="kt">String</span><span class="p">;</span>
               <span class="nv">Listener</span>  <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Listeners</span><span class="p">.</span><span class="n">Result_Listener</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">);</span>
</pre></div>
</div>
<p>Run the test with given name and place the test result to Result.
Notice: If multiple tests have same name this might call all of
them.</p>
</div>
<div class="section" id="id3">
<h3>Run<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Run</span> <span class="p">(</span><span class="nv">T</span>         <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test</span><span class="p">;</span>
               <span class="nv">Test_Name</span> <span class="p">: </span>       <span class="kt">String</span><span class="p">;</span>
               <span class="nv">Listener</span>  <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Listeners</span><span class="p">.</span><span class="n">Result_Listener</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">;</span>
               <span class="nv">Timeout</span>   <span class="p">: </span>       <span class="n">Test_Duration</span><span class="p">)</span>
  <span class="kr">is</span> <span class="kr">abstract</span><span class="p">;</span>
</pre></div>
</div>
<p>Run the test with given name and place the test result to Result.
Notice: If multiple tests have same name this might call all of
them. Timeout specifies maximum execution time for the tests.</p>
<blockquote>
<div><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">param T:</th><td class="field-body">The test object to run.</td>
</tr>
<tr class="field-even field"><th class="field-name" colspan="2">param Test_Name:</th></tr>
<tr><td>&nbsp;</td><td class="field-body">The name of the test which will be run.</td>
</tr>
<tr class="field-odd field"><th class="field-name">param Listener:</th><td class="field-body">The listener which will be called during the test execution.</td>
</tr>
<tr class="field-even field"><th class="field-name">param Timeout:</th><td class="field-body">Time limit for the test.</td>
</tr>
</tbody>
</table>
</div></blockquote>
</div>
<div class="section" id="test-count">
<h3>Test_Count<a class="headerlink" href="#test-count" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">function</span> <span class="nf">Test_Count</span> <span class="p">(</span><span class="nv">T</span> <span class="p">: </span><span class="n">Test</span><span class="p">)</span> <span class="kr">return</span> <span class="n">Test_Count_Type</span> <span class="kr">is</span> <span class="kr">abstract</span><span class="p">;</span>
</pre></div>
</div>
<p>Return the amount of tests (test routines) which will be executed when
the Run (T) procedure is called.</p>
</div>
<div class="section" id="id4">
<h3>Test_Count<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">function</span> <span class="nf">Test_Count</span> <span class="p">(</span><span class="nv">T</span> <span class="p">: </span><span class="n">Test</span><span class="p">;</span> <span class="nv">Test_Name</span> <span class="p">: </span><span class="kt">String</span><span class="p">)</span>
  <span class="kr">return</span> <span class="n">Test_Count_Type</span> <span class="kr">is</span> <span class="kr">abstract</span><span class="p">;</span>
</pre></div>
</div>
<p>Return the amount of tests (test routines) which will be executed when
the Run (T, Test_Name) procedure is called.</p>
</div>
<div class="section" id="execute">
<h3>Execute<a class="headerlink" href="#execute" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Execute</span> <span class="p">(</span><span class="nv">T</span>        <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">;</span>
                   <span class="nv">Listener</span> <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Listeners</span><span class="p">.</span><span class="n">Result_Listener</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">);</span>
</pre></div>
</div>
<p>Call Test class&#8217; Run method and place the test outcome to Result.
The procedure calls Start_Test of every listener before calling
the Run procedure and End_Test after calling the Run procedure.</p>
</div>
<div class="section" id="id5">
<h3>Execute<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Execute</span> <span class="p">(</span><span class="nv">T</span>        <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">;</span>
                   <span class="nv">Listener</span> <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Listeners</span><span class="p">.</span><span class="n">Result_Listener</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">;</span>
                   <span class="nv">Timeout</span>  <span class="p">: </span>       <span class="n">Test_Duration</span><span class="p">);</span>
</pre></div>
</div>
<p>Call Test class&#8217; Run method and place the test outcome to Result.
The procedure calls Start_Test of every listener before calling
the Run procedure and End_Test after calling the Run procedure.
Timeout specifies the maximum execution time for a test.</p>
</div>
<div class="section" id="id6">
<h3>Execute<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Execute</span> <span class="p">(</span><span class="nv">T</span>         <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">;</span>
                   <span class="nv">Test_Name</span> <span class="p">: </span>       <span class="kt">String</span><span class="p">;</span>
                   <span class="nv">Listener</span>  <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Listeners</span><span class="p">.</span><span class="n">Result_Listener</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">);</span>
</pre></div>
</div>
<p>Same as Execute above, but call the Run procedure which
takes Test_Name parameter.</p>
</div>
<div class="section" id="id7">
<h3>Execute<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Execute</span> <span class="p">(</span><span class="nv">T</span>         <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">;</span>
                   <span class="nv">Test_Name</span> <span class="p">: </span>       <span class="kt">String</span><span class="p">;</span>
                   <span class="nv">Listener</span>  <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Listeners</span><span class="p">.</span><span class="n">Result_Listener</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">;</span>
                   <span class="nv">Timeout</span>  <span class="p">: </span>       <span class="n">Test_Duration</span><span class="p">);</span>
</pre></div>
</div>
<p>Same as Execute above, but call the Run procedure which
takes Test_Name parameter. Timeout specifies the maximum execution
time for a test.</p>
</div>
<div class="section" id="id8">
<h3>Get_Name<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">function</span> <span class="nf">Get_Name</span> <span class="p">(</span><span class="nv">T</span> <span class="p">: </span><span class="n">Test_Case</span><span class="p">)</span> <span class="kr">return</span> <span class="kt">String</span><span class="p">;</span>
</pre></div>
</div>
<p>Return the name of the test case.</p>
</div>
<div class="section" id="id9">
<h3>Run<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Run</span> <span class="p">(</span><span class="nv">T</span>        <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test_Case</span><span class="p">;</span>
               <span class="nv">Listener</span> <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Listeners</span><span class="p">.</span><span class="n">Result_Listener</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">);</span>
</pre></div>
</div>
<p>Run Test_Case&#8217;s test routines.</p>
</div>
<div class="section" id="id10">
<h3>Run<a class="headerlink" href="#id10" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Run</span> <span class="p">(</span><span class="nv">T</span>        <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test_Case</span><span class="p">;</span>
               <span class="nv">Listener</span> <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Listeners</span><span class="p">.</span><span class="n">Result_Listener</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">;</span>
               <span class="nv">Timeout</span>  <span class="p">: </span>       <span class="n">Test_Duration</span><span class="p">);</span>
</pre></div>
</div>
<p>Run Test_Case&#8217;s test routines with timeout value.</p>
</div>
<div class="section" id="id11">
<h3>Run<a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Run</span> <span class="p">(</span><span class="nv">T</span>         <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test_Case</span><span class="p">;</span>
               <span class="nv">Test_Name</span> <span class="p">: </span>       <span class="kt">String</span><span class="p">;</span>
               <span class="nv">Listener</span>  <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Listeners</span><span class="p">.</span><span class="n">Result_Listener</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">);</span>
</pre></div>
</div>
<p>Run Test_Case&#8217;s test routine which matches to the Name.</p>
</div>
<div class="section" id="id12">
<h3>Run<a class="headerlink" href="#id12" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Run</span> <span class="p">(</span><span class="nv">T</span>         <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test_Case</span><span class="p">;</span>
               <span class="nv">Test_Name</span> <span class="p">: </span>       <span class="kt">String</span><span class="p">;</span>
               <span class="nv">Listener</span>  <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Listeners</span><span class="p">.</span><span class="n">Result_Listener</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">;</span>
               <span class="nv">Timeout</span>   <span class="p">: </span>       <span class="n">Test_Duration</span><span class="p">);</span>
</pre></div>
</div>
<p>Run Test_Case&#8217;s test routine which matches to the Name, with timeout value.</p>
</div>
<div class="section" id="id13">
<h3>Test_Count<a class="headerlink" href="#id13" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">function</span> <span class="nf">Test_Count</span> <span class="p">(</span><span class="nv">T</span> <span class="p">: </span><span class="n">Test_Case</span><span class="p">)</span> <span class="kr">return</span> <span class="n">Test_Count_Type</span><span class="p">;</span>
</pre></div>
</div>
<p>Implementation of Test_Count (T : Test).</p>
</div>
<div class="section" id="id14">
<h3>Test_Count<a class="headerlink" href="#id14" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">function</span> <span class="nf">Test_Count</span> <span class="p">(</span><span class="nv">T</span> <span class="p">: </span><span class="n">Test_Case</span><span class="p">;</span> <span class="nv">Test_Name</span> <span class="p">: </span><span class="kt">String</span><span class="p">)</span>
  <span class="kr">return</span> <span class="n">Test_Count_Type</span><span class="p">;</span>
</pre></div>
</div>
<p>Implementation of Test_Count (T : Test, Test_Name : String).</p>
</div>
<div class="section" id="finalize">
<h3>Finalize<a class="headerlink" href="#finalize" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Finalize</span> <span class="p">(</span><span class="nv">T</span> <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test_Case</span><span class="p">);</span>
</pre></div>
</div>
<p>Finalize procedure of the Test_Case.</p>
</div>
<div class="section" id="set-name">
<h3>Set_Name<a class="headerlink" href="#set-name" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Set_Name</span> <span class="p">(</span><span class="nv">T</span> <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test_Case</span><span class="p">;</span> <span class="nv">Name</span> <span class="p">: </span><span class="kt">String</span><span class="p">);</span>
</pre></div>
</div>
<p>Set Test_Case&#8217;s name.</p>
</div>
<div class="section" id="add-test-routine">
<h3>Add_Test_Routine<a class="headerlink" href="#add-test-routine" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Add_Test_Routine</span> <span class="p">(</span><span class="nv">T</span>       <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test_Case</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">;</span>
                            <span class="nv">Routine</span> <span class="p">: </span>       <span class="n">Object_Test_Routine_Access</span><span class="p">;</span>
                            <span class="nv">Name</span>    <span class="p">: </span>       <span class="kt">String</span><span class="p">);</span>
</pre></div>
</div>
<p>Register a test routine to the Test_Case object.</p>
</div>
<div class="section" id="id15">
<h3>Add_Test_Routine<a class="headerlink" href="#id15" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Add_Test_Routine</span> <span class="p">(</span><span class="nv">T</span>       <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test_Case</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">;</span>
                            <span class="nv">Routine</span> <span class="p">: </span>       <span class="n">Simple_Test_Routine_Access</span><span class="p">;</span>
                            <span class="nv">Name</span>    <span class="p">: </span>       <span class="kt">String</span><span class="p">);</span>
</pre></div>
</div>
<p>Register a simple test routine to the Test_Case.</p>
</div>
<div class="section" id="create-suite">
<h3>Create_Suite<a class="headerlink" href="#create-suite" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">function</span> <span class="nf">Create_Suite</span> <span class="p">(</span><span class="nv">Suite_Name</span> <span class="p">: </span><span class="kt">String</span><span class="p">)</span>
  <span class="kr">return</span> <span class="n">Test_Suite_Access</span><span class="p">;</span>
</pre></div>
</div>
<p>Create a new Test_Suite.
Caller must free the returned Test_Suite using Release_Suite.</p>
</div>
<div class="section" id="id16">
<h3>Create_Suite<a class="headerlink" href="#id16" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">function</span> <span class="nf">Create_Suite</span> <span class="p">(</span><span class="nv">Suite_Name</span> <span class="p">: </span><span class="kt">String</span><span class="p">)</span>
  <span class="kr">return</span> <span class="n">Test_Suite</span><span class="p">;</span>
</pre></div>
</div>
<p>Create a new Test_Suite. The suite and its children are
released automatically.</p>
</div>
<div class="section" id="add-test">
<h3>Add_Test<a class="headerlink" href="#add-test" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Add_Test</span> <span class="p">(</span><span class="nv">Suite</span> <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test_Suite</span><span class="p">;</span> <span class="nv">T</span> <span class="p">: </span><span class="n">Test_Class_Access</span><span class="p">);</span>
</pre></div>
</div>
<p>Add a Test to the suite. The suite frees the Test automatically
when it is no longer needed.</p>
</div>
<div class="section" id="id17">
<h3>Add_Test<a class="headerlink" href="#id17" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Add_Test</span> <span class="p">(</span><span class="nv">Suite</span> <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test_Suite</span><span class="p">;</span> <span class="nv">T</span> <span class="p">: </span><span class="n">Test_Suite_Access</span><span class="p">);</span>
</pre></div>
</div>
<p>Add a Test suite to the suite. The suite frees the Test automatically
when it is no longer needed.</p>
</div>
<div class="section" id="add-static-test">
<h3>Add_Static_Test<a class="headerlink" href="#add-static-test" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Add_Static_Test</span>
  <span class="p">(</span><span class="nv">Suite</span> <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test_Suite</span><span class="p">;</span> <span class="nv">T</span> <span class="p">: </span><span class="n">Test</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">);</span>
</pre></div>
</div>
<p>Add a Test to the suite. This procedure is meant for statically
allocated Test_Case objects.</p>
</div>
<div class="section" id="id18">
<h3>Get_Name<a class="headerlink" href="#id18" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">function</span> <span class="nf">Get_Name</span> <span class="p">(</span><span class="nv">T</span> <span class="p">: </span><span class="n">Test_Suite</span><span class="p">)</span> <span class="kr">return</span> <span class="kt">String</span><span class="p">;</span>
</pre></div>
</div>
<p>Return the name of Test_Suite.</p>
</div>
<div class="section" id="id19">
<h3>Run<a class="headerlink" href="#id19" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Run</span> <span class="p">(</span><span class="nv">T</span>        <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test_Suite</span><span class="p">;</span>
               <span class="nv">Listener</span> <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Listeners</span><span class="p">.</span><span class="n">Result_Listener</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">);</span>
</pre></div>
</div>
<p>Run Test_Suite&#8217;s Test_Cases.</p>
</div>
<div class="section" id="id20">
<h3>Run<a class="headerlink" href="#id20" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Run</span> <span class="p">(</span><span class="nv">T</span>        <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test_Suite</span><span class="p">;</span>
               <span class="nv">Listener</span> <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Listeners</span><span class="p">.</span><span class="n">Result_Listener</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">;</span>
               <span class="nv">Timeout</span>  <span class="p">: </span>       <span class="n">Test_Duration</span><span class="p">);</span>
</pre></div>
</div>
<p>Run Test_Suite&#8217;s Test_Cases with timeout value.</p>
</div>
<div class="section" id="id21">
<h3>Run<a class="headerlink" href="#id21" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Run</span> <span class="p">(</span><span class="nv">T</span>         <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test_Suite</span><span class="p">;</span>
               <span class="nv">Test_Name</span> <span class="p">: </span>       <span class="kt">String</span><span class="p">;</span>
               <span class="nv">Listener</span>  <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Listeners</span><span class="p">.</span><span class="n">Result_Listener</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">);</span>
</pre></div>
</div>
<p>Run test suite&#8217;s child which matches to the given name.</p>
</div>
<div class="section" id="id22">
<h3>Run<a class="headerlink" href="#id22" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Run</span> <span class="p">(</span><span class="nv">T</span>         <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test_Suite</span><span class="p">;</span>
               <span class="nv">Test_Name</span> <span class="p">: </span>       <span class="kt">String</span><span class="p">;</span>
               <span class="nv">Listener</span>  <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Listeners</span><span class="p">.</span><span class="n">Result_Listener</span><span class="p">&#39;</span><span class="na">Class</span><span class="p">;</span>
               <span class="nv">Timeout</span>  <span class="p">: </span>       <span class="n">Test_Duration</span><span class="p">);</span>
</pre></div>
</div>
<p>Run test suite&#8217;s child which matches to the given name, with timeout value.</p>
</div>
<div class="section" id="id23">
<h3>Test_Count<a class="headerlink" href="#id23" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">function</span> <span class="nf">Test_Count</span> <span class="p">(</span><span class="nv">T</span> <span class="p">: </span><span class="n">Test_Suite</span><span class="p">)</span> <span class="kr">return</span> <span class="n">Test_Count_Type</span><span class="p">;</span>
</pre></div>
</div>
<p>Implementation of Test_Count (T : Test).</p>
</div>
<div class="section" id="id24">
<h3>Test_Count<a class="headerlink" href="#id24" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">function</span> <span class="nf">Test_Count</span> <span class="p">(</span><span class="nv">T</span> <span class="p">: </span><span class="n">Test_Suite</span><span class="p">;</span> <span class="nv">Test_Name</span> <span class="p">: </span><span class="kt">String</span><span class="p">)</span>
  <span class="kr">return</span> <span class="n">Test_Count_Type</span><span class="p">;</span>
</pre></div>
</div>
<p>Implementation of Test_Count (T : Test, Test_Name : String).</p>
</div>
<div class="section" id="adjust">
<h3>Adjust<a class="headerlink" href="#adjust" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Adjust</span> <span class="p">(</span><span class="nv">T</span> <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test_Suite</span><span class="p">);</span>
</pre></div>
</div>
<p>Adjust procedure of Test_Suite.
Handles the copying of the structure properly</p>
</div>
<div class="section" id="id25">
<h3>Finalize<a class="headerlink" href="#id25" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Finalize</span> <span class="p">(</span><span class="nv">T</span> <span class="p">: </span><span class="kr">in</span> <span class="kr">out</span> <span class="n">Test_Suite</span><span class="p">);</span>
</pre></div>
</div>
<p>Finalize procedure of Test_Suite. Frees all added Tests.</p>
</div>
<div class="section" id="release-suite">
<h3>Release_Suite<a class="headerlink" href="#release-suite" title="Permalink to this headline">¶</a></h3>
<div class="highlight-ada"><div class="highlight"><pre><span class="kd">procedure</span> <span class="nf">Release_Suite</span> <span class="p">(</span><span class="nv">T</span> <span class="p">: </span><span class="n">Test_Suite_Access</span><span class="p">);</span>
</pre></div>
</div>
<p>Release the memory of Test_Suite.
All added tests are released automatically.</p>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#"><tt class="docutils literal"><span class="pre">Ahven.Framework</span></tt> &#8211; Package</a><ul>
<li><a class="reference internal" href="#types">Types</a><ul>
<li><a class="reference internal" href="#test-count-type">Test_Count_Type</a></li>
<li><a class="reference internal" href="#test-duration">Test_Duration</a></li>
<li><a class="reference internal" href="#test">Test</a></li>
<li><a class="reference internal" href="#test-class-access">Test_Class_Access</a></li>
<li><a class="reference internal" href="#test-case">Test_Case</a></li>
<li><a class="reference internal" href="#object-test-routine-access">Object_Test_Routine_Access</a></li>
<li><a class="reference internal" href="#simple-test-routine-access">Simple_Test_Routine_Access</a></li>
<li><a class="reference internal" href="#test-suite">Test_Suite</a></li>
<li><a class="reference internal" href="#test-suite-access">Test_Suite_Access</a></li>
</ul>
</li>
<li><a class="reference internal" href="#procedures-and-functions">Procedures and functions</a><ul>
<li><a class="reference internal" href="#set-up">Set_Up</a></li>
<li><a class="reference internal" href="#tear-down">Tear_Down</a></li>
<li><a class="reference internal" href="#get-name">Get_Name</a></li>
<li><a class="reference internal" href="#run">Run</a></li>
<li><a class="reference internal" href="#id1">Run</a></li>
<li><a class="reference internal" href="#id2">Run</a></li>
<li><a class="reference internal" href="#id3">Run</a></li>
<li><a class="reference internal" href="#test-count">Test_Count</a></li>
<li><a class="reference internal" href="#id4">Test_Count</a></li>
<li><a class="reference internal" href="#execute">Execute</a></li>
<li><a class="reference internal" href="#id5">Execute</a></li>
<li><a class="reference internal" href="#id6">Execute</a></li>
<li><a class="reference internal" href="#id7">Execute</a></li>
<li><a class="reference internal" href="#id8">Get_Name</a></li>
<li><a class="reference internal" href="#id9">Run</a></li>
<li><a class="reference internal" href="#id10">Run</a></li>
<li><a class="reference internal" href="#id11">Run</a></li>
<li><a class="reference internal" href="#id12">Run</a></li>
<li><a class="reference internal" href="#id13">Test_Count</a></li>
<li><a class="reference internal" href="#id14">Test_Count</a></li>
<li><a class="reference internal" href="#finalize">Finalize</a></li>
<li><a class="reference internal" href="#set-name">Set_Name</a></li>
<li><a class="reference internal" href="#add-test-routine">Add_Test_Routine</a></li>
<li><a class="reference internal" href="#id15">Add_Test_Routine</a></li>
<li><a class="reference internal" href="#create-suite">Create_Suite</a></li>
<li><a class="reference internal" href="#id16">Create_Suite</a></li>
<li><a class="reference internal" href="#add-test">Add_Test</a></li>
<li><a class="reference internal" href="#id17">Add_Test</a></li>
<li><a class="reference internal" href="#add-static-test">Add_Static_Test</a></li>
<li><a class="reference internal" href="#id18">Get_Name</a></li>
<li><a class="reference internal" href="#id19">Run</a></li>
<li><a class="reference internal" href="#id20">Run</a></li>
<li><a class="reference internal" href="#id21">Run</a></li>
<li><a class="reference internal" href="#id22">Run</a></li>
<li><a class="reference internal" href="#id23">Test_Count</a></li>
<li><a class="reference internal" href="#id24">Test_Count</a></li>
<li><a class="reference internal" href="#adjust">Adjust</a></li>
<li><a class="reference internal" href="#id25">Finalize</a></li>
<li><a class="reference internal" href="#release-suite">Release_Suite</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="api-ahven.html"
                        title="previous chapter"><tt class="docutils literal docutils literal docutils literal"><span class="pre">Ahven</span></tt> &#8211; Package</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="api-ahven-listeners-basic.html"
                        title="next chapter"><tt class="docutils literal"><span class="pre">Ahven.Listeners.Basic</span></tt> &#8211; Package</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/api-ahven-framework.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="ada-modindex.html" title="Ada Module Index"
             >Ada modules</a> |</li>
        <li class="right" >
          <a href="api-ahven-listeners-basic.html" title="Ahven.Listeners.Basic – Package"
             >next</a> |</li>
        <li class="right" >
          <a href="api-ahven.html" title="Ahven – Package"
             >previous</a> |</li>
        <li><a href="index.html">Ahven 2.1 documentation</a> &raquo;</li>
          <li><a href="api.html" >API Documentation for Ahven</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2011, Tero Koskinen.
      Last updated on Sep 24, 2011.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1pre.
    </div>
  </body>
</html>