Skip to content
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

Fix test_gltfio cmake duplicate libs and failed UT. #7199

Merged
merged 4 commits into from
Sep 25, 2023

Conversation

suzp1984
Copy link
Contributor

  1. Fix the ld test_gltfio duplicated libraries:
[2/2] Linking CXX executable libs/gltfio/test_gltfio
ld: warning: ignoring duplicate libraries: 'filament/libfilament.a', 'libs/filabridge/libfilabridge.a', 'libs/geometry/libgeometry.a', 'libs/ktxreader/libktxreader.a', 'libs/math/libmath.a', 'libs/uberz/libuberzlib.a', 'libs/utils/libutils.a', 'third_party/stb/tnt/libstb.a'

Cause:
the cmake file libs/gltfio/CMakeLists.txt config link_libraries(math utils filament cgltf stb ktxreader geometry tsl trie uberzlib) for the targets includes test_gltfio.

Solution:
clear link_libraries property for test_gltfio target.

set_property(TARGET test_gltfio PROPERTY LINK_LIBRARIES)
  1. Fix UT glTFIOTest.AnimatedMorphCubeTransforms

run test_gltfio: ./out/cmake-debug/libs/gltfio/test_gltfio;

with errors:

Expected equality of these values:
  result
    Which is: 64-byte object <00-00 80-3F 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 80-3F 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-29 00-00 80-3F 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 80-3F>
  math::mat4f{}
    Which is: 64-byte object <00-00 80-3F 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 80-3F 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 80-3F 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 80-3F>
CircularBuffer: High watermark 0 KiB (0%)
FEngine::mHeapAllocator arena: High watermark 4 KiB
[  FAILED  ] glTFIOTest.AnimatedMorphCubeTransforms (15 ms)

Solution:
use gtest EXPECT_NEAR to compare floats.

@pixelflinger pixelflinger added the internal Issue/PR does not affect clients label Sep 24, 2023
Copy link
Contributor

@poweifeng poweifeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. Just out of curiosity, what os+cpu are you running the test on?

@suzp1984
Copy link
Contributor Author

OS: mac os 13.5.2;
CPU: M2 Arm64 chip;

About the failed UT, it maybe the same issue as #7092 .

@suzp1984 suzp1984 requested a review from poweifeng September 25, 2023 07:04
@romainguy
Copy link
Collaborator

The duplicate libraries issue is a recent one on macOS with the latest Xcode. I fixed several CMakeLists.txt last week, I'm surprised I didn't catch this one, so thanks for fixing it!

@poweifeng poweifeng merged commit 6ebd22f into google:main Sep 25, 2023
8 checks passed
plepers pushed a commit to plepers/filament that referenced this pull request Dec 9, 2023
* fix test-gltfio cmake duplicated libs links.

* fix test_gltfio failed UT.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Issue/PR does not affect clients
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants