Let the tests configure alongside Highway's - #1038
yupengtang wants to merge 1 commit into
Conversation
|
Thank you for helping maintain our tests :) We are only able to integrate changes to the dev branch - would you mind retargeting to that? |
Highway derives its test target names from the file basename exactly as we do, and it is fetched before this block, so compress_test, dot_test and image_test were already taken and the configure step failed. Prefix ours when the name is taken; those three of our tests were never built through CMake as a result. threading_test includes gmock/gmock.h, whose headers come with the gmock target rather than with GTest::Main, so link it where it exists.
22ca6cb to
45f6270
Compare
|
Retargeted to Rebuilding it there was worth doing: What is left is the target-name collision and the missing gmock link, 13 lines in One thing I did not touch: |
|
Thanks for updating. Unfortunately the number of commits is too large for our CLA scanner. Would you mind re-creating the PR so we can merge it? |
cmake -B build -DGEMMA_ENABLE_TESTS=ONdoes not configure ondev. Two reasons, both in the test block.1. Test target names collide with Highway's. Highway derives its test target names from the file basename exactly as we do, and it is fetched before this block runs, so three names are already taken:
The collisions are
compress_test,dot_testandimage_test. A side effect worth noting: those three of our tests were never built through CMake, since the name resolved to Highway's target.2.
threading_testincludesgmock/gmock.h, whose headers come with thegmocktarget rather than withGTest::Main:Verified on dev
Ubuntu 22.04, GCC 11.4, CMake 3.22, Intel i7-1355U, at
c93e0724plus this change:gemma_dot_testbuilds and links, then aborts on an accuracy expectation. I left it alone, since I cannot tell whether the bound is stale or whether this machine is genuinely outside it:Happy to open a separate issue for that if it is worth tracking.
Note on the earlier version of this PR
This started against
main, where the same run also needed aGTest::Mainalias, a C++17 fix inops/dot_test.cc, and hit a link error forhwy::Statsbecause the pinned Highway did not compilehwy/stats.cc. None of those apply here:devalready usesfind_package(GTest REQUIRED), sets C++20, and pins a newer Highway. So this is down to the two hunks above. TheWORKING_DIRECTORYyou already added togtest_discover_testsalso covers the relative-path issue I would have raised forimage_test.I used AI assistance (Claude Code) while working through this, mainly to bisect the configure and link failures and to draft this description. I ran every build and test listed above myself and reviewed each line of the change.