-
Notifications
You must be signed in to change notification settings - Fork 3k
Rtostimer tests #4947
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
Rtostimer tests #4947
Conversation
retest uvisor |
1 similar comment
retest uvisor |
cc @bulislaw |
osStatus stat = timer.stop(); | ||
TEST_ASSERT_EQUAL(osErrorResource, stat); | ||
|
||
int32_t slots = sem.wait(0); |
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.
Why do we do that?
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 Semaphore
has its own tests this assert is actually redundant. I'll fix that.
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.
osStatus stat = timer.stop(); | ||
TEST_ASSERT_EQUAL(osErrorResource, stat); | ||
|
||
int32_t slots = sem.wait(0); |
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.
Why? We should assume in this tests semaphores work fine (they have their own tests).
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.
* Then timer stops | ||
* and elapsed time matches given delay | ||
*/ | ||
void test_correct_delay() |
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.
What's the difference between this and test_oneshot_not_restarted
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 other test cases already check the accuracy of delays I removed this one.
77ad117
to
2a432b0
Compare
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.
@0xc0170 could you have a look
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest failed! |
|
||
using namespace utest::v1; | ||
|
||
#define THREAD_STACK_SIZE 512 |
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 not used anywhere, neither creating multiple threads. Is the line 22 above also valid?
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.
You're right. I'll remove that.
|
||
sem.wait(0); | ||
stat = timer.start(TEST_DELAY_MS); | ||
uint32_t t1 = us_ticker_read(); |
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 recomend using Timer class instead of us ticker read to capture the duration (C++ classes should provide all its needed)
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.
Sure, I'll update time measurement with Timers.
@fkjagodzinski Any update? |
2a432b0
to
33e38cc
Compare
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest failed! |
@fkjagodzinski please look at failures, related to this changeset |
I suppose the ci/morph-test is failing because of Tests need to check What is the preferred solution? Is it possible to use another profile for these tests? |
One way could be to separate that failure to another test unit that would catch it via host script - that would pass if it catches the failure via serial. We got some tests like that already , can't recall from top of my head any now. |
I would recommend adding an installable hook/callback into either |
Redefine error() as noop to fix tests being aborted when compiled with -DMBED_TRAP_ERRORS_ENABLED=1.
Pushed a fix that overrides |
* which aborts test program. | ||
*/ | ||
#if defined(MBED_TRAP_ERRORS_ENABLED) && MBED_TRAP_ERRORS_ENABLED | ||
void error(const char* format, ...) { |
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.
Should we validate in the function that causes an error it actually happens by setting some flag here?
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.
Isn't that going too deep into internals? The RtosTimer
API does not say anything about calling error()
.
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.
True, you're right.
Build : SUCCESSBuild number : 19 |
Build : SUCCESSBuild number : 172 Triggering tests/test mbed-os |
Test : SUCCESSBuild number : 72 |
Test : SUCCESSBuild number : 80 |
Unless anyone has any comments, the PR is ready. I don't have any more updates to push. |
We will rerun uvisor CI once their fix lands,m then this should be ready for integration |
/morph uvisor-test |
Build : SUCCESSBuild number : 227 Triggering tests/morph test |
Test : SUCCESSBuild number : 114 |
Description
RTOS
RtosTimer
:Status
READY