Uh oh!
There was an error while loading. Please reload this page.
add UI testing framework - #33588
Conversation
There was a problem hiding this comment.
May be worth using String::from_utf8_lossy instead of "not uf8" on invalid utf-8
retep998
commented
May 12, 2016
It is possible to create a console screen buffer, redirect rustc to that, and then read the output including all the color attributes. A bit complicated, but nonetheless very much possible. |
alexcrichton
commented
May 12, 2016
Nice! Some thoughts:
I'd personally want to get rustbuild running these tests as well as printing the actual/expected on failure, but other than that the remaining pieces seem like they're nice-to-have and we can add later. Having a script to blanket overwrite all the previous output may also be a bit heavy-handed? In theory these shouldn't be too hard to run by hand, right? I'd just be worried that having these scripts checked in makes it "too easy" to blanket change the rustc output without thinking much. |
nikomatsakis
commented
May 13, 2016
I may try to at least get diffs of the output working.
I agree those are necessary.
This was sort of the goal =) I figured we'd make it easy to update, then use review + git diff to check the results.
Cool. Nonetheless, after discussing with @jonathandturner and @alexcrichton, we were thinking we'd just move all color checking to operate at a more semantic level rather than using this framework (i.e., if we get more "presentation" info in the JSON as discussed here, we can check that this is as expected, and then we'll just trust that the translation to ANSI/Windows goes swimmingly). |
alexcrichton
commented
May 13, 2016
@nikomatsakis all sounds good to me! |
nikomatsakis
commented
May 13, 2016
@alexcrichton ok, I did the following:
I chose not to:
|
There was a problem hiding this comment.
Could you be sure to add these to the blanket Check target below?
alexcrichton
commented
May 13, 2016
Looks good to me! Just one minor nit and otherwise r=me |
nikomatsakis
commented
May 13, 2016
@bors r=alexcrichton |
bors
commented
May 13, 2016
📌 Commit 3ff521b has been approved by |
bors
commented
May 14, 2016
⌛ Testing commit 3ff521b with merge 9c87f71... |
bors
commented
May 14, 2016
⛄ The build was interrupted to prioritize another pull request. |
bors
commented
May 14, 2016
⌛ Testing commit 3ff521b with merge 9bbfe4d... |
bors
commented
May 14, 2016
💔 Test failed - auto-linux-64-opt-rustbuild |
sanxiyn
commented
May 15, 2016
This failed tidy. |
nikomatsakis
commented
May 16, 2016
@bors r=alexcrichton |
bors
commented
May 16, 2016
📌 Commit 474eb38 has been approved by |
nikomatsakis
commented
May 16, 2016
@bors r=acrichto |
bors
commented
May 16, 2016
📌 Commit 24cfa1e has been approved by |
bors
commented
May 16, 2016
add UI testing framework This adds a framework for capturing and tracking the precise output of rustc, which allows us to check all manner of minor details with the output. It's pretty strict right now -- the output must match almost exactly -- and hence maybe a bit too strict. But I figure we can add wildcards or whatever later. There is also a script intended to make updating the references easy, though the script could make things a *bit* easier (in particular, it'd be nice if it would find the build directory for you automatically). One thing I was wondering about is the best way to test colors. Since windows doesn't embed those in the output stream, this test framework can't test colors on windows -- so I figure we can just write tests that are ignored on windows and which pass `--color=always` or whatever to rustc. cc @jonathandturner r? @alexcrichton
This adds a framework for capturing and tracking the precise output of rustc, which allows us to check all manner of minor details with the output. It's pretty strict right now -- the output must match almost exactly -- and hence maybe a bit too strict. But I figure we can add wildcards or whatever later. There is also a script intended to make updating the references easy, though the script could make things a bit easier (in particular, it'd be nice if it would find the build directory for you automatically).
One thing I was wondering about is the best way to test colors. Since windows doesn't embed those in the output stream, this test framework can't test colors on windows -- so I figure we can just write tests that are ignored on windows and which pass
--color=alwaysor whatever to rustc.cc @jonathandturner
r? @alexcrichton