summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests/ttest01/test-plan.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-08-14 09:56:51 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-08-18 07:08:51 +0200
commitc7289484348fc33f77dc99e74a8d0a298144514d (patch)
treef4272cf0be5f41e55e5427b657d303ff071654ca /testsuites/libtests/ttest01/test-plan.c
parentlibtest: Use a destructor (diff)
downloadrtems-c7289484348fc33f77dc99e74a8d0a298144514d.tar.bz2
libtest: Add T_push_plan() and T_pop_plan()
Update #3199.
Diffstat (limited to '')
-rw-r--r--testsuites/libtests/ttest01/test-plan.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/testsuites/libtests/ttest01/test-plan.c b/testsuites/libtests/ttest01/test-plan.c
index 4a550f34fa..d7632b8590 100644
--- a/testsuites/libtests/ttest01/test-plan.c
+++ b/testsuites/libtests/ttest01/test-plan.c
@@ -34,6 +34,19 @@ T_TEST_CASE(steps)
T_step(2);
}
+static T_fixture_node nested_plan_node;
+
+T_TEST_CASE(nested_plan)
+{
+ T_plan(2);
+ T_step(0);
+ T_push_plan(&nested_plan_node, 2);
+ T_step(0);
+ T_step(1);
+ T_pop_plan();
+ T_step(1);
+}
+
#include "t-self-test.h"
T_TEST_OUTPUT(wrong_step,
@@ -65,6 +78,14 @@ T_TEST_OUTPUT(steps,
"P:2:0:UI1:test-plan.c:34\n"
"E:steps:N:3:F:0:D:0.001000\n");
+T_TEST_OUTPUT(nested_plan,
+"B:nested_plan\n"
+"P:0:0:UI1:test-plan.c:42\n"
+"P:1.0:0:UI1:test-plan.c:44\n"
+"P:1.1:0:UI1:test-plan.c:45\n"
+"P:1:0:UI1:test-plan.c:47\n"
+"E:nested_plan:N:4:F:0:D:0.001000\n");
+
/*
* The license is at the end of the file to be able to use the test code and
* output in examples in the documentation. This is also the reason for the