Closed
Description
Running tests requires linking to std
, where the test runner lives. core has a huge hack in it to allow it to link to std when building with --test
.
When building core tests (an executable), core links to std, which then links to the actual core shared library. As a result coretest actually includes two entire copies of core at runtime. The tests are exercising the core code compiled into the executable, and std is exercising the core library.
This caused a confusing problem with the TLS tests which use function addresses as keys, because std and coretest were using two different functions.
Two solutions
- move std::test to core
- move core tests to their own crate