Update README.md
[deliverable/titan.core.git] / help / info / module.html
CommitLineData
970ed795
EL
1<!--
2 Copyright (c) 2000-2014 Ericsson Telecom AB
3
4 All rights reserved. This program and the accompanying materials
5 are made available under the terms of the Eclipse Public License v1.0
6 which accompanies this distribution, and is available at
7 http://www.eclipse.org/legal/epl-v10.html
8 -->
9<html>
10<head>
11<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
12<meta http-equiv="Content-Language" content="en-us">
13<title>module</title>
14</head>
15<body bgcolor="#DAD3C5" vlink="#0094D2" link="#003258">
16<table align="left" border="0" cellspacing="0" cellpadding="0" valign=top>
17 <tr>
18 <td width=105 height=40><a href="https://projects.eclipse.org/projects/tools.titan"><img src="../images/titan_transparent.gif" border=0 width=105 height=40 align="left" alt="Titan"></a></td>
19 </tr>
20</table>
21<table border="0" align="right" cellpadding="0" cellspacing="0">
22 <tr>
23 <td><a href="../titan_main.html" alt="contents"><img border="0" src="../images/ao.jpg" width="53" height="40"></a></td>
24 <td><a href="../titan_index.html" alt="index"><img border="0" src="../images/up.jpg" width="53" height="40"></a></td>
25 <td><a href="modifies.html" alt="previous"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td>
26 <td><a href="modulepar.html" alt="next"><img border="0" src="../images/right.jpg" width="53" height="40"></a></td>
27 </tr>
28</table>
29<p><br clear="all">
30</p>
31<hr>
32<h1>module</h1>
33<hr align="left" width="75%">
34<p>The principal building blocks of TTCN-3 are modules written as free text files: line breaks or paragraph marks may be used without restrictions.&nbsp;
35<ul>
36 <li>A test suite consists of one or more modules; there is no hierarchy between modules;</li>
37 <li>a module contains a module definitions and an (optional) module control part;</li>
38 <li>In the module definitions part, definitions can be collected in named <a href="group.html"><b><font face="Courier New" color="#003258" size="4">group</font></b></a>s.</li>
39 <li>modules can have parameters supplied to the module at run-time and are considered constant during test execution;</li>
40 <li>modules can have attributes giving additional information, like coding rules or the size of a table.</li>
41</ul>
42<p>Related keywords:</p>
43<ul>
44 <li><a href="control.html"><b><font face="Courier New" color="#003258" size="4">control</font></b></a></li>
45 <li><a href="group.html"><b><font face="Courier New" color="#003258" size="4">group</font></b></a></li>
46 <li><a href="modulepar.html"><b><font face="Courier New" color="#003258" size="4">modulepar</font></b></a></li>
47 <li><a href="with.html"><b><font face="Courier New" color="#003258" size="4">with</font></b></a></li>
48</ul>
49<hr align="left" width="50%">
50<div align="center">
51<center>
52<table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
53 <tr>
54 <td width="100%">
55 <h3 align="center"><font face="Courier New" color="#003258" size="5"><b>module</b></font> <i>module_identifier</i> <font face="Courier New" color="#003258" size="5"><b>{</b></font> [ <i>module_definitions</i>
56 ]&nbsp; [ <font face="Courier New" color="#003258" size="5"><b>control {</b></font><i>module_control</i> <b><font face="Courier New" color="#003258" size="5">}</font></b> ] <b><font
57 face="Courier New" color="#003258" size="5">}</font></b> [ <font face="Courier New" color="#003258" size="5"><b>with </b></font><i>attributes</i> ]</h3>
58 </td>
59 </tr>
60</table>
61</center>
62</div>
63<ul>
64 <li>
65 <p>The <font face="Courier New" color="#003258" size="4"><b>module</b></font> keyword introduces the module definition.</p>
66 </li>
67 <li>
68 <p><i>module_identifier</i> is the&nbsp;name used to refer to the module. Must begin with a letter, may contain letters, numbers and underscore characters.</p>
69 </li>
70 <li>
71 <p>the optional <i>module_definitions</i> part may contain type, constant, template, function, signature, testcase, altstep and group definitions.</p>
72 </li>
73 <li>
74 <p>the optional <i>module_control</i> part states the execution order of the test cases (cf. the keyword <a href="execute.html"><b><font face="Courier New">execute</font></b></a>) and may
75 contain local definitions.</p>
76 </li>
77 <li>
78 <p><i>attributes:</i> see the keyword <b><font face="Courier New"><a href="with.html">with</a></font></b> for details.</p>
79 </li>
80</ul>
81<hr align="left" width="50%">
82<p><a name="parametrized">Example</a>
83<p><font face="Courier New">module Principal {<br>
84modulepar float tsp_hlavni;<br>
85modulepar integer tsp_vypinac, tsp_nouzove;<br>
86<br>
87type component CT {};<br>
88type enumerated Examplg {jeudi, vendredi, samedi};<br>
89<br>
90testcase tcprov() runs on CT { <br>
91/* Imagine Test Case body here */<br>
92};<br>
93control {execute (tc_prov())}</font><br>
94}
95<p>The module Principal declared here has one float (tsp_hlavni) and two integer module parameters (tsp_vypinac, tsp_nouzove), an empty component type (CT) as well as an enumerated type (Examplg)
96defined in the module definitions part. The control part contains the execution of the test case tc_prov.</p>
97<hr align="left" width="25%">
98<hr align="left" width="25%">
99<p><a HREF="BNF.html#ttcn3module">BNF definition</a> of <font face="Courier New"> module</font></p>
100</body>
101</html>
This page took 0.044438 seconds and 5 git commands to generate.