Skip to content

Commit a144bb5

Browse files
Florian FreundFlorian Freund
authored andcommitted
add usage description for OrderedTests
1 parent c6f8e4a commit a144bb5

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

plugin_manual.markdown

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ CppUTest plugins can be installed in the main and 'extend' the unit test framewo
1010
* [SetPointerPlugin](#setpointerplugin)
1111
* [MockSupportPlugin](#mocksupportplugin)
1212
* [IEEE754ExceptionsPlugin](#ieee754exceptionsplugin)
13+
* [OrderedTests](#orderedtests)
1314

1415
<a id="setpointerplugin"> </a>
1516

@@ -255,3 +256,51 @@ New value = true
255256
(gdb)
256257
{% endhighlight %}
257258
Of course you don't have to use commandline Gdb to do this; you can debug your code from within your favorite IDE (Eclipse, Code::Blocks, ...) following basically the same procedure.
259+
260+
## OrderedTests
261+
262+
### Usage
263+
264+
{% highlight c++ %}
265+
TEST_ORDERED(TestGroup, TestName, Level) {}
266+
TEST_ORDERED_C_WRAPPER(TestGroup, TestName, Level)
267+
{% endhighlight %}
268+
269+
Order: Test are executed from lowest to highest level. Tests with same same level are executed top down.
270+
271+
{% highlight c++ %}
272+
#include "CppUTest/TestHarness.h"
273+
#include "CppUTestExt/OrderedTest.h"
274+
275+
TEST_GROUP(TestOrderedTest) {}
276+
277+
TEST_ORDERED(TestOrdered, Test3, 3) {
278+
// 3. Test
279+
}
280+
281+
TEST_ORDERED(TestOrdered, Test1, 1) {
282+
// 1. Test
283+
}
284+
285+
TEST_ORDERED(TestOrdered, Test4, 3) {
286+
// 4. Test
287+
}
288+
289+
TEST_ORDERED_C_WRAPPER(TestOrdered, Test2, 2)
290+
291+
TEST_ORDERED_C_WRAPPER(TestOrdered, Test5, 5)
292+
{% endhighlight %}
293+
294+
Only the C++-wrapper changes, the C-file synatx is as usual.
295+
296+
{% highlight c++ %}
297+
#include "CppUTest/TestHarness_c.h"
298+
299+
TEST_C(TestOrdered, Test2) {
300+
// 2. Test
301+
}
302+
303+
TEST_C(TestOrdered, Test5) {
304+
// 5. Test
305+
}
306+
{% endhighlight %}

0 commit comments

Comments
 (0)