<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Everyone,<br>
<br>
Hoping someone might be able to help me understand how to set up a
unit test with EUnit which needs both timeout and fixture
setup/cleanup. I find the documentation a bit challenging on this
particular aspec.<br>
<br>
For example, according to the documentation for using the fixture
pattern:<br>
<br>
<div class="moz-text-html" lang="x-western"><dt style="color: rgb(0,
0, 0); font-family: Verdana, Arial, Helvetica, sans-serif;
font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: normal; orphans: 2;
text-align: -webkit-auto; text-indent: 0px; text-transform:
none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); font-size: medium; "><strong><span
class="code" style="font-family: courier; font-weight:
normal; ">{setup, Setup, Tests | Instantiator}</span></strong></dt>
<dd style="color: rgb(0, 0, 0); font-family: Verdana, Arial,
Helvetica, sans-serif; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255); font-size: medium; "><br>
</dd>
<dt style="color: rgb(0, 0, 0); font-family: Verdana, Arial,
Helvetica, sans-serif; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255); font-size: medium; "><strong><span class="code"
style="font-family: courier; font-weight: normal; ">{setup,
Setup, Cleanup, Tests | Instantiator}</span></strong></dt>
<dd style="color: rgb(0, 0, 0); font-family: Verdana, Arial,
Helvetica, sans-serif; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255); font-size: medium; "><br>
</dd>
<dt style="color: rgb(0, 0, 0); font-family: Verdana, Arial,
Helvetica, sans-serif; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255); font-size: medium; "><strong><span class="code"
style="font-family: courier; font-weight: normal; ">{setup,
Where, Setup, Tests | Instantiator}</span></strong></dt>
<dd style="color: rgb(0, 0, 0); font-family: Verdana, Arial,
Helvetica, sans-serif; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255); font-size: medium; "><br>
</dd>
<dt style="color: rgb(0, 0, 0); font-family: Verdana, Arial,
Helvetica, sans-serif; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255); font-size: medium; "><strong><span class="code"
style="font-family: courier; font-weight: normal; ">{setup,
Where, Setup, Cleanup, Tests | Instantiator}</span></strong></dt>
<dd style="color: rgb(0, 0, 0); font-family: Verdana, Arial,
Helvetica, sans-serif; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255); font-size: medium; "><br class="Apple-interchange-newline">
</dd>
<br>
<br>
So my normal tests look like:<br>
<big><font face="Courier New, Courier, monospace"><br>
my_test_() -><br>
{setup,<br>
fun setup/0,<br>
fun cleanup/1,<br>
?_test(begin<br>
...<br>
end)}.<br>
</font></big><br>
For using adjusting the timeout, the documentation describes this
pattern:<br>
<br>
<big><strong style="color: rgb(0, 0, 0); font-family: Verdana,
Arial, Helvetica, sans-serif; font-style: normal;
font-variant: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: -webkit-auto; text-indent:
0px; text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; background-color: rgb(255,
255, 255); font-size: medium; "><span class="code"
style="font-family: courier; font-weight: normal; ">{timeout,
Time::number(), Tests}</span></strong><br>
</big> <br>
I have not been able to figure out how to craft my test.
Unfortunately my variations just fail, or just quietly end without
running any of the remaining tests for the module.<font
face="Courier New, Courier, monospace"><br>
</font><br>
<br>
Thanks!!!<br>
<br>
Cheers,<br>
Bryan</div>
</body>
</html>