Skip to content

Move std::test into core or change the way coretest works #2912

Closed
@brson

Description

@brson

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-testsuiteArea: The testsuite used to check the correctness of rustc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions