diff --git a/components/idf_test/unit_test/InitialConditionAll.yml b/components/idf_test/unit_test/InitialConditionAll.yml index 48045c286d..6e5d898e72 100644 --- a/components/idf_test/unit_test/InitialConditionAll.yml +++ b/components/idf_test/unit_test/InitialConditionAll.yml @@ -2936,28 +2936,16 @@ initial condition: - check cmd set: - '' - - FREBOOT UT1 - - [''] - - - DELAY 3 - - [''] - - - UT UT1 - - - [R UT1 C Tests C Failures C Ignored] + - ['R UT1 C Press%20ENTER%20to%20see%20the%20list%20of%20tests'] force restore cmd set: - '' - - FREBOOT UT1 - - [''] - - - DELAY 3 - - [''] - - - UT UT1 - - - [R UT1 C Tests C Failures C Ignored] + - ['R UT1 C Press%20ENTER%20to%20see%20the%20list%20of%20tests'] initial condition detail: At UT menu page restore cmd set: - '' - - FREBOOT UT1 - - [''] - - - DELAY 3 - - [''] - - - UT UT1 - - - [R UT1 C Tests C Failures C Ignored] + - ['R UT1 C Press%20ENTER%20to%20see%20the%20list%20of%20tests'] restore post cmd set: - '' - - DELAY 0.1 diff --git a/tools/unit-test-app/components/unity/include/unity_config.h b/tools/unit-test-app/components/unity/include/unity_config.h index 90be3a90fd..2929eb6e39 100644 --- a/tools/unit-test-app/components/unity/include/unity_config.h +++ b/tools/unit-test-app/components/unity/include/unity_config.h @@ -39,7 +39,7 @@ struct test_desc_t void unity_testcase_register(struct test_desc_t* desc); -void unity_run_menu(); +void unity_run_menu() __attribute__((noreturn)); void unity_run_tests_with_filter(const char* filter); diff --git a/tools/unit-test-app/components/unity/unity_platform.c b/tools/unit-test-app/components/unity/unity_platform.c index 94549d42c1..069bd838dc 100644 --- a/tools/unit-test-app/components/unity/unity_platform.c +++ b/tools/unit-test-app/components/unity/unity_platform.c @@ -257,9 +257,22 @@ static int print_test_menu(void) return test_counter; } +static int get_test_count(void) +{ + int test_counter = 0; + for (const struct test_desc_t* test = s_unity_tests_first; + test != NULL; + test = test->next) + { + ++test_counter; + } + return test_counter; +} + void unity_run_menu() { - int test_count = print_test_menu(); + unity_printf("\n\nPress ENTER to see the list of tests.\n"); + int test_count = get_test_count(); while (true) { char cmdline[256] = { 0 }; diff --git a/tools/unit-test-app/main/app_main.c b/tools/unit-test-app/main/app_main.c index bf54b03957..b3d249fc50 100644 --- a/tools/unit-test-app/main/app_main.c +++ b/tools/unit-test-app/main/app_main.c @@ -6,9 +6,8 @@ void unityTask(void *pvParameters) { - vTaskDelay(1000 / portTICK_PERIOD_MS); - unity_run_menu(); - while(1); + vTaskDelay(30); /* Delay a bit to let the main task be deleted */ + unity_run_menu(); /* Doesn't return */ } void app_main()