From 5383d4db04bc8b8c97957edb54375de304e0458b Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 13 Aug 2020 09:59:19 +0200 Subject: libtest: Add fixture steps Support a new test plan for each nested fixture. Update #3199. --- testsuites/libtests/ttest01/init.c | 2 +- testsuites/libtests/ttest01/test-fixture.c | 34 +++++++++++++++--------------- testsuites/libtests/ttest02/init.c | 7 +++--- 3 files changed, 22 insertions(+), 21 deletions(-) (limited to 'testsuites') diff --git a/testsuites/libtests/ttest01/init.c b/testsuites/libtests/ttest01/init.c index 35b7023385..8636cdadd4 100644 --- a/testsuites/libtests/ttest01/init.c +++ b/testsuites/libtests/ttest01/init.c @@ -183,7 +183,7 @@ run_initialize(void) } static const char expected_final[] = "Z:ttest01:C:343:N:1335:F:795:D:0.689999\n" -"Y:ReportHash:SHA256:f018ab0c9ddf5c5bc0ba8377492dc52205f9b63146c787fb669222e346c65d0f\n"; +"Y:ReportHash:SHA256:525591019364543d5694dd09fef3bf2f0b7db69694f959e4298f22f4f9803fef\n"; static void run_finalize(void) diff --git a/testsuites/libtests/ttest01/test-fixture.c b/testsuites/libtests/ttest01/test-fixture.c index 0e97c1c71c..e1f59876ca 100644 --- a/testsuites/libtests/ttest01/test-fixture.c +++ b/testsuites/libtests/ttest01/test-fixture.c @@ -144,35 +144,35 @@ T_TEST_OUTPUT(fixture, "L:setup end\n" "P:3:0:UI1/More:test-fixture.c:125\n" "L:setup 2 begin\n" -"P:4:0:UI1/More/AndMore:test-fixture.c:71\n" -"P:5:0:UI1/More/AndMore:test-fixture.c:72\n" -"P:6:0:UI1/More/AndMore:test-fixture.c:76\n" +"P:4.0:0:UI1/More/AndMore:test-fixture.c:71\n" +"P:4.1:0:UI1/More/AndMore:test-fixture.c:72\n" +"P:4.2:0:UI1/More/AndMore:test-fixture.c:76\n" "L:setup 2 end\n" -"P:7:0:UI1/More/AndMore:test-fixture.c:127\n" +"P:4.3:0:UI1/More/AndMore:test-fixture.c:127\n" "L:teardown 2 begin\n" -"P:8:0:UI1/More:test-fixture.c:98\n" -"P:9:0:UI1/More:test-fixture.c:100\n" +"P:4.4:0:UI1/More/AndMore:test-fixture.c:98\n" +"P:4.5:0:UI1/More/AndMore:test-fixture.c:100\n" "L:teardown 2 end\n" "L:setup 2 begin\n" -"P:10:0:UI1/More/AndMore:test-fixture.c:71\n" -"P:11:0:UI1/More/AndMore:test-fixture.c:72\n" -"P:12:0:UI1/More/AndMore:test-fixture.c:76\n" +"P:4.0:0:UI1/More/AndMore:test-fixture.c:71\n" +"P:4.1:0:UI1/More/AndMore:test-fixture.c:72\n" +"P:4.2:0:UI1/More/AndMore:test-fixture.c:76\n" "L:setup 2 end\n" -"P:13:0:UI1/More/AndMore:test-fixture.c:131\n" -"F:14:0:UI1/More/AndMore:test-fixture.c:132:test fails and we stop the test case\n" +"P:4.3:0:UI1/More/AndMore:test-fixture.c:131\n" +"F:4.4:0:UI1/More/AndMore:test-fixture.c:132:test fails and we stop the test case\n" "L:stop 2 begin\n" -"P:15:0:UI1/More/AndMore:test-fixture.c:86\n" +"P:4.5:0:UI1/More/AndMore:test-fixture.c:86\n" "L:stop 2 end\n" "L:stop begin\n" -"P:16:0:UI1/More/AndMore:test-fixture.c:28\n" +"P:4.6:0:UI1/More/AndMore:test-fixture.c:28\n" "L:stop end\n" "L:teardown 2 begin\n" -"P:17:0:UI1/More/AndMore:test-fixture.c:98\n" -"P:18:0:UI1/More/AndMore:test-fixture.c:100\n" +"P:4.7:0:UI1/More/AndMore:test-fixture.c:98\n" +"P:4.8:0:UI1/More/AndMore:test-fixture.c:100\n" "L:teardown 2 end\n" "L:teardown begin\n" -"P:19:0:UI1/More:test-fixture.c:40\n" -"P:20:0:UI1/More:test-fixture.c:42\n" +"P:4:0:UI1/More:test-fixture.c:40\n" +"P:5:0:UI1/More:test-fixture.c:42\n" "L:teardown end\n" "E:fixture:N:21:F:1:D:0.001000\n"); diff --git a/testsuites/libtests/ttest02/init.c b/testsuites/libtests/ttest02/init.c index 846a778536..7f972aec7e 100644 --- a/testsuites/libtests/ttest02/init.c +++ b/testsuites/libtests/ttest02/init.c @@ -134,6 +134,7 @@ static void fatal(void *arg) { (void)arg; + T_plan(1); T_step(0); T_stop(); } @@ -149,7 +150,6 @@ T_TEST_CASE(TestInterruptFatal) { Atomic_Uint action_state; - T_plan(1); T_interrupt_test(&fatal_config, &action_state); T_unreachable(); } @@ -161,6 +161,7 @@ suspend(void *arg) rtems_id *id; id = arg; + T_plan(2); sc = rtems_task_suspend(*id); T_step_rsc_success(1, sc); } @@ -202,10 +203,10 @@ T_TEST_CASE(TestInterruptBlocked) T_interrupt_test_state state; rtems_id id; - T_plan(3); + T_plan(1); id = rtems_task_self(); state = T_interrupt_test(&blocked_config, &id); - T_step_eq_int(2, state, T_INTERRUPT_TEST_DONE); + T_step_eq_int(0, state, T_INTERRUPT_TEST_DONE); } T_TEST_CASE(TestThreadSwitch) -- cgit v1.2.3