Skip to content

Conversation

@54m43lJ
Copy link
Contributor

@54m43lJ 54m43lJ commented Jan 14, 2025

The gtest_add_tests macro is very old and breaks when building on newer versions of CMake (in my case cmake 3.31.4-1 on ArchLinux).
image
Switching to gtest_discover_tests and omitting the SOURCES option works, but whichever is causing the issue is unclear.
By the way, doing this seems to automatically ignore the unused tests, which is a plus in my book.
I'm pasting the results from running make test to prove that no regression is introduced.
Before:

95% tests passed, 72 tests failed out of 1584

After:

99% tests passed, 2 tests failed out of 1514

@54m43lJ 54m43lJ marked this pull request as draft January 14, 2025 14:09
@54m43lJ 54m43lJ marked this pull request as ready for review January 14, 2025 14:10
@jack-ullery
Copy link
Owner

Thanks! I know I was experimenting with both before (it seems libappanvil uses the newer macro). I can't remember why I settled on gtest_add_tests.

I'll merge your change soon

@jack-ullery jack-ullery merged commit af55d7b into jack-ullery:main Feb 5, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants