-
Notifications
You must be signed in to change notification settings - Fork 3k
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 Unittest equeue tests #11067
Add Unittest equeue tests #11067
Conversation
@Tharazi97, thank you for your changes. |
Sounds a lot like unit testing. |
It is a valid point that Greentea tests adding CI executing time. How much effort would it be to converting these test to the UNITTEST ? @Tharazi97 @maciejbocianski |
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.
It's a good point, we are trying to push the testing time down so all the not hw specific tests should be offloaded to unittest framework.
Right I will convert them to gtest. |
I have converted them to googletests, but they don't work properly on Windows. Does it have to pass all the test on Windows, or is Windows not supported already? |
Not passing on Windows, and passing on Linux, means that you might have just bug that is affected by uninitialised variable. Try running your tests using Valgrind to see where the problem is. |
@Tharazi97 |
Other tests pass. I think that it could be caused by using pthreads library on MinGW, or by wrong reads of ticker function. I'm working on it. |
I've commited some changes. Unit tests should work on Windows and Linux. But I suggest to leave greentea test as they are, or make them optional to compile, because Equeue is a real time solution and I think it should be able to test it with a ticker and threads available on targets. |
events/equeue/tests/tests.c
Outdated
@@ -1,835 +0,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.
I'm not sure if it's good idea to remove this test file as it's part of equeue library and still runs on CI (https://github.com/ARMmbed/mbed-os/blob/master/.travis.yml#L230). It should be left as is and only disable on travis script.
events/equeue/tests/prof.c
Outdated
@@ -1,424 +0,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.
This test file also should stay, as it's part of equeue library and still runs on CI (https://github.com/ARMmbed/mbed-os/blob/master/.travis.yml#L232).
@bulislaw @SeppoTakalo @jamesbeyond What do you think about adding global mechanism/flag to make our test/example codes be aware of running on CI (e.g. Similar flag
|
@maciejbocianski @Tharazi97 |
If we have some benefits of Greentea tests then we can leave those using MBED_EXTENDED_TESTS flag to be make easier to run all tests if wanted. But if there are no benefits of those then those can be removed. Good option is to leave one or two greentea tests as hardware smoke test and remove the rests. |
The benefit is that we can test whole queue API on target hardware, not only partially as |
OK, please add the macro as O-P suggested |
5c3dca1
to
60f4d9e
Compare
@Tharazi97 Would it make sense to squash (clean the history) - to make a history release ready |
CI started |
Test run: FAILEDSummary: 1 of 4 test jobs failed Failed test jobs:
|
CI fails seems not related. |
Test was restarted and is all good. I had to restart merge jenkins error, should also be fine (internal CI issue fixed now). |
Waiting for pr-merge fix, @ARMmbed/mbed-os-test please review |
The CI status fixed, this is ready for integration |
@ARMmbed/mbed-os-maintainers Can this be merged? |
This is on top of 5.14 changes so moved |
Description
Ported events queue test to the Greentea standard:
https://github.com/ARMmbed/mbed-os/blob/master/events/equeue/tests/tests.c
Pull request type
Reviewers
@jamesbeyond @maciejbocianski
Release Notes