-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Initial unit tests based on GoogleTest and GoogleMock #794
Comments
@uweseimet It doesn't seem like x86 Debian comes with pre-compiled GoogleTest libraries either. The I tried pulling in the headers with the -I parameter but the process fails at linking because I don't think compiled libraries are available.
What Linux distro are you using for development? |
@rdmark I am using Gentoo. But even if not all Linux distributions out of the box support GoogleTest, this should not block the PR because the tests are not compiled by default anyway, i.e. if they do not compile they do not break anything. |
@uweseimet have you thought about tooling for measuring code coverage, e.g. line coverage metrics? |
@rdmark I don't think I will spend time on this soon. Unfortunately everything related to C++ appears to be more or less a one-man-show, which is not so good ... If somebody was adding a ticket for code coverage she/he should also be prepared to work on this ticket. |
In my opinion there is value to having a backlog of improvements and new features, even if there isn't anyone who can immediately work on them. It helps show the community a future potential roadmap, as well as serve as starter tickets for potential code contributors. That said, I'm not opposed to closing out lower importance improvement ideas to reduce the clutter. Now, I'd be interested in investigating code coverage tooling myself. I asked just because I was curious if you already had something in mind. |
@rdmark Actually, if I were adding tickets for all potential improvements I can think of there would be a flood of new tickets ;-). We could add tickets for any SCSI device type not yet implemented. In theory these kind of tickets would be legitimate, but in practice ... |
@rdmark I have not yet commented on code coverage tools. I have not investigated this. As long is there is no substantial amount of unit tests, collecting code coverage metrics is not that useful. In addition having the existing (2 years ago) GitHub actions automation ticket resolved would be helpful in this context, in order to have automated building, testing and collecting metrics. Having a decent number of (C++) unit tests may be out of scope for this project anyway. Who is going to write and maintain these tests and refactor the legacy code to become testable? This is not necessarily something you can do on-the-fly. Look at the SASI removal and the related changes and refactorings which affected the SCSI code. If there had been unit tests for the SCSI code, updating these tests would have required quite some time. Regarding code coverage, which percentage would you want to achieve? 70-80% is a typical goal I think. Once I wanted to learn whether you could reach 100% in some of the Java projects I was involved with. I was surprised that this was actually possible, but how well this works depends on the nature of the project. Multithreading is not helpful here ;-). |
@rdmark Bear with me for being that talkative, but I just remembered that I had a look at how to use SonarQube for C++ some time ago, because I also use it for other languages. Besides code coverage metrics SonarQube provides a lot of additional (code qualitiy) metrics. |
@akuker @rdmark The feature_google_test branch contains some initial unit tests based on GoogleTest, which I would like to be commented on before more time is spent on them. The relevant changes only affect the Makefile and add one additional source file in the new "test" folder.
Some notes:
The text was updated successfully, but these errors were encountered: