-
Notifications
You must be signed in to change notification settings - Fork 3k
Add RTC time test. #5087
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
Add RTC time test. #5087
Conversation
@bulislaw @0xc0170 The following issues have been found during test development:
|
Just a note in the doxygen should be enough.
I think it's a implementation of standard library function, maybe it's not the best place for it, you could try opening new PR and moving it to mbed_retarget.cpp.
Init should just enable registers and the new RTC HAL spec is explicitly mentioning it can be called multiple times. So I would ignore that here, it'll be tested in HAL RTC tests
I think it's implementation and HW specific and possibly could possibly be a valid case, we should validate if it works rather how it is done. |
TESTS/mbed_drivers/rtc/main.cpp
Outdated
|
||
void test_case_rtc_strftime() { | ||
greentea_send_kv("timestamp", CUSTOM_TIME); | ||
static int rtc_enabled_ret; |
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.
Lets make them all volatile
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.
Added volatile.
TESTS/mbed_drivers/rtc/main.cpp
Outdated
* When set_time/time functions are called. | ||
* Then set_time/time functions use attached RTC functions. | ||
*/ | ||
void test_attach_RTC_funtions() |
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.
That's too long. We should try checking one thing in a test (within reason).
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.
Spited into two cases. First case verify attaching of stub driver functions and second verify attaching of original RTC driver functions.
TESTS/mbed_drivers/rtc/main.cpp
Outdated
* Note: Stubs are used instead of original RTC functions. | ||
* | ||
* Given environment has RTC functions | ||
* defined and RTC is enabled. |
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: doesn't need to be broken into two lines, we have limit of 120chars https://docs.mbed.com/docs/mbed-os-handbook/en/latest/cont/code_style/
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.
Description of the test cases have been corrected.
TESTS/mbed_drivers/rtc/main.cpp
Outdated
* When set_time()/time() functions is called. | ||
* Then RTC time is set/retrieved. | ||
*/ | ||
template<uint32_t timeValue> |
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 split that in two tests set and wait.
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.
Spitted in to two test cases as suggested.
TESTS/mbed_drivers/rtc/main.cpp
Outdated
seconds = time(NULL); | ||
|
||
/* Get current time and verify that new value has been set. */ | ||
TEST_ASSERT_EQUAL(timeValue, seconds); |
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.
Maybe we should allow for +/- 1sec? As there's a chance it changes I think
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 verify RTC from wider perspective, but still rational I have increased delay to 10 seconds and added delta for comparison equal to 1 sec.
cc @c1728p9 |
@bulislaw Have your comments been addressed? |
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.
@c1728p9 Please look at this, how it aligns with another RTC specification pull request
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
I think you need to add a guard against boards without RTC. |
Added guard against boards without RTC. |
/morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
@mprse Could you change the sha of the last commit to kick out Circle CI? You can do this with |
Done |
/morph test |
The resolution of the blocking issue was that RTC will have to be disabled for the NCS36510 for the time being. A PR will be incoming today to unblock this PR. |
Depends on #5898 |
@mprse Can you rebase this , it should be unblocked after? |
Re-based and tested on Can we run morph? |
/morph build |
Build : SUCCESSBuild number : 936 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 623 |
/morph test |
Test : FAILUREBuild number : 793 |
@mprse Can you reproduce those failures in the CI? timeouts? From the logs
Starting from this test, teh rest timeout. And can see this there
|
/morph build |
Build : SUCCESSBuild number : 975 Triggering tests/morph test |
Exporter Build : FAILUREBuild number : 662 |
Will rebuild. Firmware version output is symptom of earlier CI issue. |
Build : SUCCESSBuild number : 977 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 669 |
Test : SUCCESSBuild number : 801 |
Description
Add RTC time test.
Test verifies RTC time() and set_time() functions.
Status
READY
Migrations
NO