Skip to content

Commit 6271408

Browse files
committed
feat(tests): include timeout in IRQ tests
Signed-off-by: Diogo Costa <[email protected]>
1 parent 98265e6 commit 6271408

File tree

1 file changed

+8
-4
lines changed
  • tests/recipes/single-baremetal/src

1 file changed

+8
-4
lines changed

tests/recipes/single-baremetal/src/irq.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,33 @@ bool irq_en_timer = false;
2424
bool irq_en_uart = false;
2525

2626
#define TIMER_INTERVAL (TIME_MS(100))
27-
#define TEST_TIMEOUT (TIME_S(1))
27+
#define TEST_TIME_WAIT (TIME_MS(100))
28+
#define TEST_TIMEOUT "200"
2829

2930
BAO_TEST(IRQ_CHECK, TIMER)
3031
{
32+
COMMAND_SEND_TIMEOUT(TEST_TIMEOUT);
33+
3134
irq_set_handler(TIMER_IRQ_ID, test_interrupt_timer_callback);
3235
irq_enable(TIMER_IRQ_ID);
3336
timer_set(TIMER_INTERVAL);
3437
irq_set_prio(TIMER_IRQ_ID, IRQ_MAX_PRIO);
3538

36-
timer_wait(TEST_TIMEOUT);
37-
39+
timer_wait(TEST_TIME_WAIT);
3840
EXPECTED_TRUE(irq_en_timer);
3941
}
4042

4143
BAO_TEST(IRQ_CHECK, UART)
4244
{
45+
COMMAND_SEND_TIMEOUT(TEST_TIMEOUT);
46+
4347
irq_set_handler(33, uart_rx_handler);
4448
uart_enable_rxirq();
4549
irq_enable(33);
4650
irq_set_prio(33, IRQ_MAX_PRIO);
4751
COMMAND_SEND_CHAR("a");
4852

49-
timer_wait(TEST_TIMEOUT);
53+
timer_wait(TEST_TIME_WAIT);
5054
EXPECTED_TRUE(irq_en_uart);
5155
}
5256

0 commit comments

Comments
 (0)