tests: drivers: counter: Add delay for clock stabilization

On nRF platforms, Xtal LF clock source starts hundreds of milliseconds.
Until it is not started, test may fail due to wrong timing. Add initial
delay in the test for required clocks complete their start-up.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2019-10-17 17:14:18 +02:00 committed by Carles Cufí
commit 5c7c0713b8

View file

@ -801,6 +801,12 @@ void test_cancelled_alarm_does_not_expire(void)
void test_main(void)
{
/* Give required clocks some time to stabilize. In particular, nRF SoCs
* need such delay for the Xtal LF clock source to start and for this
* test to use the correct timing.
*/
k_busy_wait(USEC_PER_MSEC * 300);
ztest_test_suite(test_counter,
ztest_unit_test(test_set_top_value_with_alarm),
ztest_unit_test(test_single_shot_alarm_notop),