tests: add xtimer_usleep test#6394
Conversation
tests/xtimer_usleep/main.c
Outdated
|
|
||
| #define ONE_SEC_SLEEP (1 * 1000U * 1000U) | ||
| #define FIVE_SEC_SLEEP (5 * 1000U * 1000U) | ||
| #define TEN_SEC_SLEEP (10 * 1000U * 1000U) |
There was a problem hiding this comment.
Any particular reason not to use SEC_IN_USEC from timex.h?
There was a problem hiding this comment.
Not really, I didn't think about it, will change...
Any hints on how to do it? should I use something like |
|
I don't think you will need |
|
For the record: test seems to work fine on Z1 with MSP430. I don't have any AVR here to test. |
|
Should be ok. |
tests/xtimer_usleep/main.c
Outdated
| * @file | ||
| * @brief xtimer_usleep test application | ||
| * | ||
| * @author Francisco Acosta <[email protected]> |
What should be okay? |
|
The test. Just corrected some typos |
tests/xtimer_usleep/main.c
Outdated
| printf("\n<======== If using pyterm, this is the time when started.\n\n"); | ||
|
|
||
| xtimer_usleep(ONE_SEC_SLEEP); | ||
| printf("Slept for 1 sec...\n"); |
There was a problem hiding this comment.
Why not display the message before xtimer_usleep. With the message "Sleeping during x s" ?
There was a problem hiding this comment.
Just to make the test happy...
|
Oh wait, will conflict with #6399 |
|
I would say, what got merged first wins. The other one has to be rebased. |
|
Will you be my ACK @OlegHahm ? |
04143ee to
62728a4
Compare
|
Rebased. |
|
need squashing |
|
After I got my ACK. |
tests/xtimer_usleep/tests/01-run.py
Outdated
| child.expect('\r\n') | ||
| child.expect('<======== If using pyterm, this is the time when started.') | ||
| child.expect('\r\n') | ||
| n = 3 |
There was a problem hiding this comment.
I would propose to use a bigger n.
There was a problem hiding this comment.
No, I meant something like n = 30.
tests/xtimer_usleep/tests/01-run.py
Outdated
| child.expect('\r\n') | ||
| n = 3 | ||
| while (n): | ||
| if n == 3: |
tests/xtimer_usleep/tests/01-run.py
Outdated
| exp_diff1 = 1000000 | ||
| exp_diff5 = 5000000 | ||
| exp_diff10 = 10000000 | ||
| child.expect('This test will print "Slept for X sec..." every 1, 5 and 10 seconds.\r\n') |
There was a problem hiding this comment.
If you make these strings unicode (prefixing with U) the script should be Python 2 and Python 3 compatible.
62728a4 to
28f0b3d
Compare
|
@OlegHahm do you like the changes? |
tests/xtimer_usleep/tests/01-run.py
Outdated
| @@ -0,0 +1,55 @@ | |||
| #!/usr/bin/env python3 | |||
OlegHahm
left a comment
There was a problem hiding this comment.
Apart from minor change: ACK
|
Why is CI green? Needs squashing label is set. |
2502f19 to
ddaa28f
Compare
|
Merging in favour of Olegs ACK |
While checking some xtimer functionalities on several boards, I realised that xtimer_usleep was failing, and we didn't have a test. So, here there is.