<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>

<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage 2.0">
<title>Getest: Configuration File</title>
</head>

<body bgcolor="#FFFFFF">

<table border="0" width="100%">
    <tr>
        <td><font size="6"><strong>Configuration File</strong></font></td>
        <td align="right"><a href="assertions.html"><img
        src="image/previous.gif" alt="Previous" border="0"
        width="40" height="40"></a><a href="options.html"><img
        src="image/next.gif" alt="Next" border="0" width="40"
        height="40"></a></td>
    </tr>
</table>

<hr size="1">

<p>The configuration file is what helps <em>getest </em>to run
properly. It contains information about the classes and features
to be used to run the test suite, the Eiffel compiler to use,
etc. The configuration filename is typically passed on the
command-line to <em>getest</em>:</p>

<blockquote>
    <pre><font color="#800000">getest filename</font></pre>
</blockquote>

<p>Other ways to specify the configuration filename are described
in the <a href="options.html">command-line options</a> section.</p>

<h2>Configuration Syntax</h2>

<p>Following is a typical configuration file. Comments follow
Eiffel style conventions and have no effect on the
configuration's semantics.</p>

<blockquote>
    <pre><font color="#000080"><em><strong>test</strong></em></font><em>

    my_test

</em><font color="#000080"><em><strong>default</strong></em></font><em>

    </em><font color="#000080"><em><strong>class</strong></em></font><em> </em>(<font
color="#800000"><em>&quot;TEST_[A-Z0-9_]*&quot;</em></font>)<em>
    </em><font color="#000080"><em><strong>feature</strong></em></font><em> </em>(<font
color="#800000"><em>&quot;test_[a-z0-9_]*&quot;</em></font>)<em>
    </em><font color="#000080"><em><strong>prefix</strong></em></font><em> </em>(<font
color="#800000"><em>&quot;X&quot;</em></font>)<em>
    </em><font color="#000080"><em><strong>testgen</strong></em></font><em> </em>(<font
color="#800000"><em>&quot;TESTGEN&quot;</em></font>)<em>
    </em><font color="#000080"><em><strong>compile</strong></em></font><em> </em>(<font
color="#800000"><em>&quot;gec system.ecf&quot;</em></font>)<em>
    </em><font color="#000080"><em><strong>execute</strong></em></font><em> </em>(<font
color="#800000"><em>&quot;my_test&quot;</em></font>)<em>

</em><font color="#000080"><em><strong>cluster</strong></em></font><em>

    test_dir</em>:<em>     </em><font color="#800000"><em>&quot;$GOBO/test/my_test&quot;</em></font><em>
    other_tests:  </em><font color="#800000"><em>&quot;$GOBO/test/my_test/other&quot;</em></font><em>

</em><font color="#000080"><em><strong>end</strong></em></font></pre>
</blockquote>

<p>The various clauses of the configuration file are used during
the three phases of the execution of <em>getest</em>: preparing
the test (generating the test classes), compiling the test
program and finally running it.</p>

<h2>Preparing Test Cases</h2>

<p>The section <font color="#000080"><em><strong><tt>test</tt></strong></em></font>
specifies the name of the test suite. In this example it is
called <font color="#008080"><em><tt>my_test</tt></em></font>.
This name is used as the class name of the root class of the
generated test program. This root class is generated by <em>getest</em>
and its creation procedure is called <font color="#008080"><em><tt>make</tt></em></font>.
In order to generate the classes necessary to run the test, <em>getest</em>
parses the files with a suffix <font color="#800000"><tt>.e</tt></font>
in the directories specified in the <font color="#000080"><em><strong><tt>cluster</tt></strong></em></font>
section. The default behavior is to parse the current directory.
When it finds an Eiffel class, <em>getest</em> checks whether its
name matches the regular expression specified in the <a
name="class"><font color="#000080"><em><strong><tt>class</tt></strong></em></font></a>
clause of the <font color="#000080"><em><strong><tt>default</tt></strong></em></font>
section. If it does then <em>getest</em> interprets this class as
a test case class. The default regular expression for test case
class names is <font color="#800000"><tt>&quot;TEST_.*&quot;</tt></font>,
in other words class names with the prefix <font color="#008080"><em><tt>TEST_</tt></em></font>.
This clause can be overriden by <em>getest</em>'s command-line
option <font color="#800000"><tt>--</tt></font><a
href="options.html#class"><font color="#800000"><tt>class</tt></font></a><font
color="#800000"><tt>=&lt;regexp&gt;</tt></font>. The new way of
writing test cases is to make sure that the class declares <font
color="#008080"><em><tt>make_default </tt></em></font>inherited
from <font color="#008080"><em><tt>TS_TEST_CASE </tt></em></font>as
creation procedure. For backward compatibility, for each found
test case class that appears to be deferred <em>getest </em>will
generate a new class inheriting from this former class with <font
color="#008080"><em><tt>make_default </tt></em></font>as creation
procedure. Each test case class defines a series of individual
test procedures identified by feature names matching the regular
expression specified in the <a name="feature"><font
color="#000080"><em><strong><tt>feature</tt></strong></em></font></a><font
color="#000080"><em><strong><tt> </tt></strong></em></font>clause
of the <font color="#000080"><em><strong><tt>default</tt></strong></em></font>
section. The default regular expression for the feature names is <font
color="#800000"><tt>&quot;test_.*&quot;</tt></font>, in other
words feature names with the prefix <font color="#008080"><em><tt>test_</tt></em></font>.
This clause can be overriden by <em>getest</em>'s command-line
option <font color="#800000"><tt>--</tt></font><a
href="options.html#feature"><font color="#800000"><tt>feature</tt></font></a><font
color="#800000"><tt>=&lt;regexp&gt;</tt></font>. Note that since
Eiffel is a case-insensitive language, regular expressions
specified in the configuration file are also case-insensitive.</p>

<p>We already saw that <em>getest</em> generates the root class
of the test suite program with the name specified in the <font
color="#000080"><em><strong><tt>test </tt></strong></em></font>section.
The new classes generated after the test case classes (when
deferred, as explained above) will have names derived from these
former classes by adding the prefix specified in the <font
color="#000080"><em><strong><tt>prefix </tt></strong></em></font>clause
of the <font color="#000080"><em><strong><tt>default</tt></strong></em></font>
section. For example if a test case class is named <font
color="#008080"><em><tt>TEST_FOO</tt></em></font>, then the
generated class will be named <font color="#008080"><em><tt>XTEST_FOO</tt></em></font>.
The default value for the prefix is <font color="#800000"><tt>&quot;X&quot;</tt></font>.
All new classes are generated in the current directory by
default. The behavior can be changed by specifying another
directory name in the <font color="#000080"><em><strong><tt>testgen
</tt></strong></em></font>clause of the <font color="#000080"><em><strong><tt>default</tt></strong></em></font>
section. Note that <em>getest</em> will try to create this
directory if it does not exist yet.</p>

<h2><a name="compile">Compiling Test Cases</a></h2>

<p><em>Getest</em> can be used with all Eiffel compilers
supported by the <em>Gobo Eiffel Project</em>. Therefore the
clause <font color="#000080"><em><strong><tt>compile</tt></strong></em></font>
of the <font color="#000080"><em><strong><tt>default</tt></strong></em></font>
section is used to specify the command-line instructions of the
Eiffel compiler chosen to run the test. This clause can be
overriden by <em>getest</em>'s command-line option <font
color="#800000"><tt>--</tt></font><a href="options.html#compile"><font
color="#800000"><tt>compile</tt></font></a><font color="#800000"><tt>=&lt;command&gt;</tt></font>.
It can be either a direct call to the Eiffel compiler executable,
a call to a script or use a <font color="#800000"><tt>Makefile</tt></font>
and <font color="#800000"><tt>geant</tt></font> build file. It
can also redirect its output to a temporary file to avoid too
much noise on the screen. The default value for the <font
color="#000080"><em><strong><tt>compile</tt></strong></em></font>
clause is <font color="#800000"><tt>&quot;geant compile&quot;</tt></font>,
or <font color="#800000"><tt>&quot;geant
compile_&lt;compiler&gt;&quot; </tt></font>where <font
color="#800000"><tt>&lt;compiler&gt;</tt></font> stands for
either <font color="#800000"><tt>ge</tt></font> or
<font color="#800000"><tt>ise</tt></font>
if <em>getest</em> has been invoked with the option <font
color="#800000"><tt>--</tt></font><a href="options.html#ge"><font
color="#800000"><tt>ge</tt></font></a> or <font color="#800000"><tt>--</tt></font><a
href="options.html#se"><font color="#800000"><tt>ise</tt></font></a>.</p>

<h2><a name="execute">Running Test Cases</a></h2>

<p>After the generated test suite program has been compiled, <em>getest</em>
executes it using the command specified in the <font
color="#000080"><em><strong><tt>execute </tt></strong></em></font>clause
of the <font color="#000080"><em><strong><tt>default</tt></strong></em></font>
section. By default the value of the <font color="#000080"><em><strong><tt>execute
</tt></strong></em></font>clause is <font color="#800000"><tt>&quot;./my_test
[-D name=value]*&quot; </tt></font>(or <font color="#800000"><tt>&quot;.\my_test.exe
[-D name=value]*&quot;</tt></font> under Windows), where <font
color="#800000"><tt>my_test</tt></font> is the name of the test
suite specified in the <font color="#000080"><em><strong><tt>test
</tt></strong></em></font>section and <font color="#800000"><tt>[-D
name=value]*</tt></font> are the <a href="options.html#define">variables</a>
defined on the command-line. But it can easily be changed to <font
color="#800000"><tt>&quot;cd EIFGENs/my_test/W_code;
./my_test&quot;</tt></font> when using the ISE Eiffel compiler
for example.</p>

<hr size="1">

<table border="0" width="100%">
    <tr>
        <td><address>
            <font size="2"><b>Copyright © 2001-2019</b></font><font
            size="1"><b>, </b></font><font size="2"><strong>Eric
            Bezault</strong></font><strong> </strong><font
            size="2"><br>
            <strong>mailto:</strong></font><a
            href="mailto:ericb@gobosoft.com"><font size="2">ericb@gobosoft.com</font></a><font
            size="2"><br>
            <strong>http:</strong></font><a
            href="http://www.gobosoft.com"><font size="2">//www.gobosoft.com</font></a><font
            size="2"><br>
            <strong>Last Updated:</strong> 15 March 2019</font><br>
            <!--webbot bot="PurpleText"
            preview="
$Date$
$Revision$"
            -->
        </address>
        </td>
        <td align="right" valign="top"><a
        href="http://www.gobosoft.com"><img
        src="image/home.gif" alt="Home" border="0" width="40"
        height="40"></a><a href="index.html"><img
        src="image/toc.gif" alt="Toc" border="0" width="40"
        height="40"></a><a href="assertions.html"><img
        src="image/previous.gif" alt="Previous" border="0"
        width="40" height="40"></a><a href="options.html"><img
        src="image/next.gif" alt="Next" border="0" width="40"
        height="40"></a></td>
    </tr>
</table>
</body>
</html>
