From 1e2c5cc151874545fa3c9d1b758cc651b28742a9 Mon Sep 17 00:00:00 2001 From: antti Date: Mon, 23 Jan 2017 12:54:35 +0800 Subject: [PATCH] fix unit test app to print tests in the same order they are given in files --- tools/unit-test-app/components/unity/unity_platform.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/unit-test-app/components/unity/unity_platform.c b/tools/unit-test-app/components/unity/unity_platform.c index 74f210842..05e50a160 100644 --- a/tools/unit-test-app/components/unity/unity_platform.c +++ b/tools/unit-test-app/components/unity/unity_platform.c @@ -39,16 +39,17 @@ void unity_flush() void unity_testcase_register(struct test_desc_t* desc) { - if (!s_unity_tests_first) + if (!s_unity_tests_first) { s_unity_tests_first = desc; + s_unity_tests_last = desc; } - else + else { - s_unity_tests_last->next = desc; + struct test_desc_t* temp = s_unity_tests_first; + s_unity_tests_first = desc; + s_unity_tests_first->next = temp; } - s_unity_tests_last = desc; - desc->next = NULL; } static void unity_run_single_test(const struct test_desc_t* test)