Artifact Content

Artifact f4ef359685eaa4855bb9d7a2654e552dd1052b32:

Wiki page [Overview] by Entomy 2017-10-03 21:20:17.
D 2017-10-03T21:20:17.618
L Overview
P ff364c917ed13808e924b8b3be4dea6f7445d218
U Entomy
W 2710
<p>Like any testing framework, some boilerplate must exist. This is, simply, setting up the test suite, and getting the final results.</p>
<p>In an effort to be as easy to use as possible, initialization is nothing more than a call to <code>Start</code>. This procedure always accepts the unit name to print to the log, and the log location which is standard output by default. There are other optional parameters, such as a type name if a specific type within a package is being tested.</p>
<p>Similarly but even simpler, the entire test suite is finalized with a call to <code>Stop</code>. There are no arguments. Just make sure you actually call this.</p>

<p>Unlike most <a href="">JUnit</a> based frameworks, assertions here are done through question-like procedures. For example, equality isn't <code>Assert(1, X)</code>, it's <code>Is_Equal(X, 1)</code>. For Standard types, the relevant of: <code>Is_Equal</code>, <code>Is_Not_Equal</code>, <code>Is_Lesser</code>, <code>Is_Lesser_Or_Equal</code>, <code>Is_Greater</code>, <code>Is_Greater_Or_Equal</code> are defined.</p>
<p>Also unusual to many, is the concept of procedure testing. In the majority of testing frameworks, tests of functions or methods is all that is possible, because the tests are done against the returned value. Procedures and some Methods (those that return void) have no returned value, and so testing those is not very possible, right? Nope. While we can't provide them in any generic way, procedure assertions are implemented as child packages along with any other [Extending|Extensions]. There are two relevant choices <code>Passes</code> and <code>Fails</code>. The parameter syntax is almost entirely dependent on what is being called, and involves procedure access calls, so it is not for novice programmers. Many procedure assertions also include a <code>Dump</code> parameter, which specifies whether to include, in text form, the major type the procedure is operating upon, after the procedure call; this is obviously extremely useful for testing things like containers, where you can see the aft of the operation.</p>

<p>While still an important part of software testing, code timers are generally not included in testing frameworks. That's not the case here. A base <code>Timer</code> exists in abstract form, with two instances: <code>Real_Timer</code> and <code>Execution_Timer</code> which measure their respective times. These provide <code>Start</code> and <code>Stop</code> calls just like a stop watch would use, as well as <code>Run_Time</code> which gets how long the timer ran for as the Standard Duration type.</p>
Z a51e46d676e9a7dceef4b4f4eb1075a7