Skip to content

compiletest should note when test output is normalized #125537

Open
@jyn514

Description

@jyn514

compiletest has two basic kinds of normalization:

  1. normalization it does itself, either built-in or through a normalize-stderr pattern. this is what the UI suite uses.
  2. normalization it doesn't know about, e.g. in a run-make test

normalizing outputs can lead to some extremely confusing errors, such as #121571 (comment). to avoid misleading contributors, it should note when the output has been normalized.

the first part is not too hard; it can save list of lines that have been modified in each test and print something like "note: 32/32 lines that did not match were normalized before comparison; see build/test/ui/foo.out.orig for unnormalized version"
(note that the unnormalized file already exists today but almost nobody knows about it).

the second part is trickier; run-make tests often run sed before comparing, and this is opaque to compiletest. perhaps fixing this can be part of the ongoing work to switch run-make to rust? and, in the meantime, introduce a new SED script, based off cut-and-grep.sh, to prevent the problem from getting worse? cc @jieyouxu

@rustbot label A-contributor-roadblock A-diagnostics D-confusing A-testsuite

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-compiletestArea: The compiletest test runnerA-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustA-diagnosticsArea: Messages for errors, warnings, and lintsA-testsuiteArea: The testsuite used to check the correctness of rustcD-confusingDiagnostics: Confusing error or lint that should be reworked.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions