Skip to content

Create a UI-like test suite for Cargo #6816

Closed as not planned
Closed as not planned
@alexcrichton

Description

@alexcrichton

The src/test/ui tests in the rust-lang/rust repository I think have been wildly successful. I believe this is because:

  • The tests are very easy to add (just drop a file somewhere)
  • Each test's output is exhaustively checked all the time.
  • Output assertions can be automatically updated
    • Makes it easy to write a test, generate the expected output, and review it to make sure it's ok
    • Also makes it very easy to spot output differences in online diffs
    • Also makes it very easy to blanket update the entire test suite
  • Tests can have lightweight configuration (// directives at the top) to customize how the test is run.

Cargo hasn't historically done this, but thinking recently I'm wondering if we could actually implement this? It would solve a number of downsides about the current test suite, and I think it'd be awesome if we could migrate towards a system like this.

This is soemwhat vague and just an idea though. I don't think we'd be able to migrate 100% of the tests, but we sure do have a lot of tests that are basically "set the project up, run a build, make sure the output looks ok". We might even be able to move some of the more advanced tests into this format eventually, but there's no reason to migrate 100% of the tests I think if some suffice.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions