-
Notifications
You must be signed in to change notification settings - Fork 3k
Test: deepsleep() API replacement #5147
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
In these tests, we should not allow deepsleep when sleep() is called ? |
/* Make sure deepsleep is allowed, to go to deepsleep */ | ||
bool deep_sleep_allowed = sleep_manager_can_deep_sleep(); | ||
TEST_ASSERT_TRUE_MESSAGE(deep_sleep_allowed, "Deep sleep should be allowed"); | ||
sleep(); |
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.
this is assuming that using LowPower object does allow deepsleep, and using sleep() should go into deepsleep, but would it? :-) As this test is for drivers, this looks fine, what about the below test for hal? Same? no direct deepsleep hal call ?
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 was speaking about lp_timeout_1s_sleep function.
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 was speaking about lp_timeout_1s_sleep function.
Should have lock there.
Both changes are changes for deepsleep test cases, so deepsleep should be allowed and should be entered? |
Depends on #5148 |
As the dependency was merged, this is opened for reviews |
Provided updates for handling deep-sleep mode are valid. |
That's true, they should be documented. I can add a commit here, however might be better as a new patch |
Hi I assume current update is OK to force part 3. |
2026024
to
e1d1c4d
Compare
@@ -75,6 +78,8 @@ void lp_timeout_1s_sleep(void) | |||
sleep_manager_lock_deep_sleep(); | |||
timestamp_t start = us_ticker_read(); | |||
lpt.attach(&cb_done, 1); | |||
bool deep_sleep_allowed = sleep_manager_can_deep_sleep(); | |||
TEST_ASSERT_FALSE_MESSAGE(deep_sleep_allowed, "Deep sleep should be allowed"); |
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.
Since deepsleep()
is not allowed now (as it should) the message is invalid.
e1d1c4d
to
af141ac
Compare
Use sleep() as entry function + check to be certain we are entering deepsleep when required by test (should be allowed)
af141ac
to
b30c622
Compare
@fkjagodzinski Can you review again pls? |
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.
Missing test case description.
Please don't bother with comments for LowPowerTimeout
test cases. I'll add them in #5106.
/morph test-nightly |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
retest uvisor |
Build : SUCCESSBuild number : 102 Triggering tests/test mbed-os |
Test : SUCCESSBuild number : 52 |
Use sleep() as entry function + check to be certain we
are entering deepsleep when required by test (should be allowed as we use LowPower object).
This has dependency on fixing this issue #5076 (the test now fails, and will be fixed as today).
Tested using K64F and GCC ARM , these 2 tests affected, one failure at the moment
@jeromecoutant