-
Notifications
You must be signed in to change notification settings - Fork 9
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
Integrate Googletest as Test Framework #13
Conversation
Thanks @zhjwpku ! What I would be interested to know is the compile and link times, respectively, for both GTest and Catch2. |
I did 3 tests:
As the results shows, catch2 is better at preprocessed file size and compile time, but gtest is better when it comes to link time. I don't think the above tests is adequate to prove which is better than the other, since the UT in this PR is fairly simple. I think we should focus closely on the specific benefits that the test framework is expected to deliver for this project. |
Thanks for the number @zhjwpku .
Well, it does tell us that they are close in terms of inclusion overhead, which was my concern.
Agreed. Is there a detailed (hopefully unbiased) comparison somewhere? |
I found this link: https://yurigeronimus.medium.com/guide-for-choosing-a-test-framework-for-your-c-project-2a7741b53317 |
Seems like a lot of fluff with no substance, unfortunately. |
d3cee92
to
55eb59b
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.
LGTM. Thanks!
We can always improve it when we have better ideas.
BTW, should we run ctest in build_iceberg.sh (or a separate script) from pre-commit check in the CI? |
I've added the ctest command in build_iceberg.sh, this will run test on all platforms we are targeting. |
3fe843c
to
a307f41
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.
Thanks for the work @zhjwpku ! 👍
Per the discussion in apache#12, we agreed on using GTest as iceberg-cpp's unit test framework. Signed-off-by: Junwang Zhao <[email protected]>
a307f41
to
17de3cb
Compare
@zhjwpku It is better to change the PR title to reflect that we have chosen googletest? |
Updated the PR title as well as the PR's first message, thanks for the suggestion ;) |
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.
Thank you @zhjwpku for working on this, and thank you all for the review. Let's move.
In the discussion #12 regarding the choice between Googletest and Catch2 for our testing framework, most of the developers have experience with Googletest, and while they are open to considering Catch2, they see no immediate advantage, as no one on the team has experience with it. Given this context, the decision to adopt Googletest was made based on the familiarity and comfort level of the majority of the team.
We can switch to Catch2 with one shot if it proves to be a better fit for our needs in the future.