From c7289484348fc33f77dc99e74a8d0a298144514d Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 14 Aug 2020 09:56:51 +0200 Subject: libtest: Add T_push_plan() and T_pop_plan() Update #3199. --- testsuites/libtests/ttest01/init.c | 4 ++-- testsuites/libtests/ttest01/test-plan.c | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'testsuites/libtests') diff --git a/testsuites/libtests/ttest01/init.c b/testsuites/libtests/ttest01/init.c index 8636cdadd4..c0ccee9aa4 100644 --- a/testsuites/libtests/ttest01/init.c +++ b/testsuites/libtests/ttest01/init.c @@ -182,8 +182,8 @@ run_initialize(void) T_set_putchar(censor_putchar, ctx, &ctx->putchar, &ctx->putchar_arg); } -static const char expected_final[] = "Z:ttest01:C:343:N:1335:F:795:D:0.689999\n" -"Y:ReportHash:SHA256:525591019364543d5694dd09fef3bf2f0b7db69694f959e4298f22f4f9803fef\n"; +static const char expected_final[] = "Z:ttest01:C:344:N:1339:F:795:D:0.691999\n" +"Y:ReportHash:SHA256:23dd328162c564ada3c4de97446801018ade051aaec3308bb9a7ef8f98041d67\n"; static void run_finalize(void) 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 -- cgit v1.2.3