Repository navigation
umockdev tests - #1078
umockdev tests#1078benzea wants to merge 2 commits into
Conversation
3714889 to
276886b
Compare
652ebeb to
232c346
Compare
232c346 to
b8e12ef
Compare
|
OK, just a quick update here. I ran into umockdev issue martinpitt/umockdev#173, and worked around it for now by not doing any hotplug in the test. Once this is fixed upstream, we can also test hotplug by doing some umockdev version checking. Other than that, some reshuffling (I stopped reading the global log) and a new test submitting transfers from a separate thread. Also, I changed the code so the clang thread sanitizer now runs through without complaining (build with I think I'll leave it here for now as I believe this is working fine now. Adding more tests is hopefully simple, and if anyone has questions, feel free to reach out to me. I am also happy to work on specific tests if you have anything in mind. |
dcab230 to
9cc53f0
Compare
|
Thanks. I just tried it under Ubuntu 20.04 (after installing umockdev git head) and seems to run fine but I have not spent efforts to understand what the tests are trying to do. click for the full run log |
|
This seems to be a very good feature to be integrated into libusb project. |
A loopback test where we receive data into a buffer and mirror it back again is absolutely viable. My current approach was a bit different, i.e. I created a "chat" with requests and responses that have a defined order. The pre-defined order may be a bit limiting though if one writes threaded tests; indeed, one of the existing tests just submits transfers as fast as possible from a thread and needs to ignore any error that happens. |
9cc53f0 to
594c897
Compare
594c897 to
b926e72
Compare
Add some basic umockdev tests. The setup in this case is all in one process, but umockdev in principle could also work between processes. This is just a start, more tests would make sense.
f31a71c to
d51f9a8
Compare
|
Building on Ubuntu 20.04 (gcc 9.4.0) with umockdev 0.17.7 I get these warnings: Since Ubuntu 20.04 only ships umockdev 0.14 anyway this is not so important there, but does it mean the compiler is too old? Or just that GCC was configured without analyzer support enabled. |
|
In any case pushed this to master. Thanks for this great contribution! |
Uh, not sure. I just stole the pragmas from some other test code as they looked sane. I suppose it just means that gcc is too old to know about those warnings (probably the analyzer option did not even exist back then). I guess one could test for that during configure and then only do the pragma if supported. But that seems overkill. |
|
Other than the gcc warning under Ubuntu 20.04, hotplug test is complaining under Ubuntu 20.04 as well. Not so sure if that is an issue or not though. |
Which umockdev version did you use? You can also get 0.17.7 from my PPA: https://launchpad.net/~tormodvolden/+archive/ubuntu/ppa |
|
Which umockdev version did you use? You can also get 0.17.7 from my PPA: https://launchpad.net/~tormodvolden/+archive/ubuntu/ppa
Oh, neat. Maybe something to pull into the CI builds the older distribution images?
On the side of improving testing, I feel that code coverage reports would be nice next step.
|
Thanks. With your PPA it seems okay now. |
The binary will be build if
umockdev > 0.16.0is available. To run the tests, just executetests/umockdev.I included my other two MRs, without those, the test will crash.
One
libusb_close()is commented out, as the test would immediately crash otherwise.