(core): core tests fail when running with the current path containing a symlink
Description
Our core tests fail when running with the current path containing a symlink, see for instance on our new windows runner that uses "subst" https://git.ircad.fr/sight/sight/-/jobs/932793.
Steps to reproduce
This can be easily reproduced under Linux as well, by replacing your build folder by a symlink:
- bin/core_detail_ut ->
OK (2)
- mv /path/to/build_folder /other/place
- ln -s /other/place /path/to/build_folder
- bin/core_detail_ut :
.F.
runtime_test.cpp:81:Assertion
Test name: sight::core::runtime::detail::ut::runtime_test::test_posix
equality assertion failed
- Expected: /home/fbridault/dev/sight/build/Debug/sight/lib/libsight_module_utest.so
- Actual : /home/fbridault/build/Debug/sight/lib/libsight_module_utest.so.23.1.0
Failures !!!
Run: 2 Failure total: 1 Failures: 1 Errors: 0
Functional specifications
No change.
Technical specifications
I identified a mix usage of std::filesystem::canonical()
and std::filesystem::path::lexically_normal()
in sight::core::runtime
. std::filesystem::canonical()
resolves symlinks whereas std::filesystem::path::lexically_normal()
does not.
We should just make it consistent and stick with std::filesystem::canonical()
.
Test plan
Repeat Steps to reproduce. Also, you can launch core_ut
after core_detail_ut
.