Is it possible to use cxxunit or any other unit testing framework (excluding QtTestLib) to test qt widgets?
If yes, then there are two more questions :
- How?
- Since I am running unit tests using valgrind, can this report some errors?
Yes, it should be possible. I'm not sure about cxxunit specifically, but it is theoretically possible.
If you want to test your UI, I suggest to use a UI testing tool like Squish. Unit tests I find more suited to test the logic behind the widgets, not the widgets itself. If you really want to unit-test your Qt widgets, I don't think there is a better solution than QtTestLib.
Valgrind: There is a valgrind plugin for Squish. I haven't used that one myself though. Other unit tests can of course easily be run in valgrind, although I don't know of any solution that fully automates this. One would have to make sure to really suppress all warnings from outside one owns code so that some error in e.g. x11 libs doesn't trigger the unit test to fail.