mirror of https://github.com/ARMmbed/mbed-os.git
Fix Greentea test common_tickers failed
1. Disable ticker interrupt which would interfere with fire_interrupt speed test 2. Enlarge test period to avoid timeout errorpull/8341/head
parent
78cbc0db97
commit
203e87ba61
|
@ -473,11 +473,14 @@ void ticker_speed_test(void)
|
||||||
|
|
||||||
/* ---- Test fire_interrupt function. ---- */
|
/* ---- Test fire_interrupt function. ---- */
|
||||||
counter = NUM_OF_CALLS;
|
counter = NUM_OF_CALLS;
|
||||||
|
/* Disable ticker interrupt which would interfere with speed test */
|
||||||
|
core_util_critical_section_enter();
|
||||||
start = us_ticker_read();
|
start = us_ticker_read();
|
||||||
while (counter--) {
|
while (counter--) {
|
||||||
intf->fire_interrupt();
|
intf->fire_interrupt();
|
||||||
}
|
}
|
||||||
stop = us_ticker_read();
|
stop = us_ticker_read();
|
||||||
|
core_util_critical_section_exit();
|
||||||
|
|
||||||
TEST_ASSERT(diff_us(start, stop, us_ticker_info) < (NUM_OF_CALLS * (MAX_FUNC_EXEC_TIME_US + DELTA_FUNC_EXEC_TIME_US)));
|
TEST_ASSERT(diff_us(start, stop, us_ticker_info) < (NUM_OF_CALLS * (MAX_FUNC_EXEC_TIME_US + DELTA_FUNC_EXEC_TIME_US)));
|
||||||
|
|
||||||
|
@ -569,7 +572,7 @@ utest::v1::status_t lp_ticker_teardown(const Case *const source, const size_t pa
|
||||||
|
|
||||||
utest::v1::status_t test_setup(const size_t number_of_cases)
|
utest::v1::status_t test_setup(const size_t number_of_cases)
|
||||||
{
|
{
|
||||||
GREENTEA_SETUP(30, "default_auto");
|
GREENTEA_SETUP(80, "default_auto");
|
||||||
return verbose_test_setup_handler(number_of_cases);
|
return verbose_test_setup_handler(number_of_cases);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue