Merge branch 'bugfix/ut_startup_time' into 'master'

By default, don't print test menu in unit-test-app

See merge request !1565
This commit is contained in:
Ivan Grokhotkov
2017-11-21 12:12:46 +08:00
4 changed files with 20 additions and 20 deletions

View File

@@ -2936,28 +2936,16 @@ initial condition:
- check cmd set: - check cmd set:
- '' - ''
- - FREBOOT UT1 - - FREBOOT UT1
- [''] - ['R UT1 C Press%20ENTER%20to%20see%20the%20list%20of%20tests']
- - DELAY 3
- ['']
- - UT UT1 -
- [R UT1 C Tests C Failures C Ignored]
force restore cmd set: force restore cmd set:
- '' - ''
- - FREBOOT UT1 - - FREBOOT UT1
- [''] - ['R UT1 C Press%20ENTER%20to%20see%20the%20list%20of%20tests']
- - DELAY 3
- ['']
- - UT UT1 -
- [R UT1 C Tests C Failures C Ignored]
initial condition detail: At UT menu page initial condition detail: At UT menu page
restore cmd set: restore cmd set:
- '' - ''
- - FREBOOT UT1 - - FREBOOT UT1
- [''] - ['R UT1 C Press%20ENTER%20to%20see%20the%20list%20of%20tests']
- - DELAY 3
- ['']
- - UT UT1 -
- [R UT1 C Tests C Failures C Ignored]
restore post cmd set: restore post cmd set:
- '' - ''
- - DELAY 0.1 - - DELAY 0.1

View File

@@ -39,7 +39,7 @@ struct test_desc_t
void unity_testcase_register(struct test_desc_t* desc); 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); void unity_run_tests_with_filter(const char* filter);

View File

@@ -257,9 +257,22 @@ static int print_test_menu(void)
return test_counter; 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() 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) while (true)
{ {
char cmdline[256] = { 0 }; char cmdline[256] = { 0 };

View File

@@ -6,9 +6,8 @@
void unityTask(void *pvParameters) void unityTask(void *pvParameters)
{ {
vTaskDelay(1000 / portTICK_PERIOD_MS); vTaskDelay(30); /* Delay a bit to let the main task be deleted */
unity_run_menu(); unity_run_menu(); /* Doesn't return */
while(1);
} }
void app_main() void app_main()