-
Notifications
You must be signed in to change notification settings - Fork 3k
Add Low Power Timer test. #5074
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
TEST_ASSERT_UINT64_WITHIN(DELTA_US, 10000, lp_timer.read_high_resolution_us()); | ||
|
||
/* Reset the timer - previous measured time should be lost now. */ | ||
lp_timer.reset(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we validate the reset here? Rather than start the timer again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intention of this test case is to show that reset() function works - i.e. clears time already counted by the timer. Verification if timer counts time between starts and stops is provided in test_lptimer_time_accumulation test function.
* When read of timer elapsed time is requested. | ||
* Then result is always 0. | ||
*/ | ||
void test_lptimer_creation() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add another tests showing that stop actually works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verification if stop() works correctly is provided in test_lptimer_time_accumulation() test function. This test case proves that timer counts time only between start and stop. Additional delay is provided when timer is stopped and it has been verified that this time is not counted by the timer.
TESTS/mbed_drivers/lp_timer/main.cpp
Outdated
/* This test verifies if calling start() for already | ||
* started low power timer does nothing. | ||
* | ||
* Timer is already started. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Given...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be corrected, to the following form:
"Given timer is already started."
Also other test cases descriptions need to be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
TESTS/mbed_drivers/lp_timer/main.cpp
Outdated
* delays. | ||
* Then the results are valid (within acceptable range). | ||
*/ | ||
void test_lptimer_time_measurement() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this function an template and add multiple test cases instead of duplicate the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be corrected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
d6bc9d5
to
0beea94
Compare
@bulislaw Did you find the responses to your questions suitable? |
bump |
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
I have checked build log on several platforms and it looks like building fails on platforms where low power timer is not available. |
@mprse Are you planning on fixing this failure? |
@theotherjimmy Added guard for boards which do not support low power timers. |
/morph test-nightly |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputExample Build failed! |
Build : FAILUREBuild number : 37 |
/morph build |
Build : SUCCESSBuild number : 94 Triggering tests/test mbed-os |
Added missing delta value, provided minor fixes (comment, style). |
Build : SUCCESSBuild number : 120 Triggering tests/test mbed-os |
Description
Add test for Low Power Timer. This test is created based on regular Timer test.
Status
READY
Migrations
NO