Uh oh!
There was an error while loading. Please reload this page.
Introduce 'run-pass' header to 'ui' tests in compiletest. Fix issue #36516. - #41968
Conversation
rust-highfive
commented
May 13, 2017
(rust_highfive has picked a reviewer for you, use r? to override) |
petrochenkov
commented
May 13, 2017
BTW, I have a branch in progress unifying I always wondered why (I'm not touching specialized tests like |
04728f8 to
f8b85c8CompareMark-Simulacrum
commented
May 13, 2017
Yeah, it seems to me like UI checking is "good" but also probably adds a small overhead to each test, which may not be a good idea -- our cycle times are already long. |
There was a problem hiding this comment.
I don't think this should be removed after this is merged. People in the future may still add run-pass tests, and if we want the separation, then we should enforce it.
There was a problem hiding this comment.
@Mark-Simulacrum Well this check does add a tiny overhead to the test 😄 (running load_errors will scan the whole file again for //~).
(This can be moved to tidy but it will spend the same amount of Travis time)
There was a problem hiding this comment.
Presumably we already load the errors for the test somewhere else, since we need them -- could we assert at that location?
There was a problem hiding this comment.
@Mark-Simulacrum The test runner loads the header information (// ignore-stage0 stuff) twice (EarlyProps and TestProps), but both do not look for the //~ errors. Or did I misunderstand what you mean?
There was a problem hiding this comment.
I thought that we probably loaded //~ errors at some point to verify that they're correct; and we could then assert there if the test has none.
There was a problem hiding this comment.
@Mark-Simulacrum The //~ are loaded in errors::load_errors, and checked against the output in check_expected_errors. So they were verified at this line exactly.
There was a problem hiding this comment.
Oh, yeah, I see what you mean. So I guess this is a little extra work, but hopefully not much. I think I'm more or less fine with removing it then.
nikomatsakis
commented
May 15, 2017
cc @cengizio -- who was also looking into this general area :) |
nikomatsakis
commented
May 15, 2017
I like the idea of unifying run-pass, run-fail, and compile-fail into one category. I would prefer to be able to group tests by what they are testing, basically, not whether they are expected to generate a compilation error or not. |
alexcrichton
commented
May 18, 2017
@nikomatsakis to clarify, just for tagging purposes, is this waiting on a decision to happen elsewhere? |
cengiz-io
commented
May 18, 2017
Hello, I'm (slowly) adding inline ERROR assertions to ui tests. Not sure if this intersects with it. |
kennytm
commented
May 18, 2017
@cengizio there should be no conflict with the scope of this PR itself, which just affects the original run-pass tests to get rid of the JSON output. The rest of the discussion (unifying test folders) seems to be the same direction as what outlined in the internals thread, I hope the actual unification, when a plan is decided, will be done in a different PR a later :). |
carols10cents
commented
May 22, 2017
ping @nikomatsakis for an answer to @alexcrichton's question :) |
nikomatsakis
commented
May 22, 2017
It's not really clear. I started this internals thread and, as of yet, there's not been any opposition. We normally land changes to the test infrastructure kind of willy-nilly without a lot of fuss, but merging compile-fail and ui (which is part of what I would like to do) feels like a fairly fundamental change that I would like @rust-lang/compiler and others to know about and be on board with. That said, this particular PR does something much more modest -- it adds |
nikomatsakis
commented
May 22, 2017
Now, that said, I think I'd prefer not to have a new direction ( (I think I would also like to support a "reference file" showing the output onto stdout/stderr, which might be good for Finally, I think I agree that we should scan for |
kennytm
commented
May 22, 2017
Sounds good to me |
f8b85c8 to
fa62a0cComparekennytm
commented
May 23, 2017
@nikomatsakis Changed to use |
petrochenkov
commented
May 23, 2017
I'd really like to avoid this for practical reasons. |
nikomatsakis
commented
May 23, 2017
I don't understand. It sounds to me like you are arguing in favor of a |
nikomatsakis
commented
May 23, 2017
Oh, I see, you're saying you'd prefer to have them separated into their own directory? If so, I disagree. The problem is that I don't like having the tests that target a common area of the code strewn about in various directories; I'd like to see them all in one place, grouped by what they test, not by their "mode". (i.e., I would like all borrowck tests together). What about if we compromised, by adding a flag to compile test to let it configure which "modes" it will execute? My personal preference would be to have tags in tests, so that we can have e.g. a "smoketest" tag, and then be able to say "run just the smoketests". This may include some run-pass tests but also some compile-pass and compile-fail tests. Things like |
petrochenkov
commented
May 24, 2017
Yes, it's not necessary for "fast" and "slow" tests to be in different directories literally, the important thing is ability to run the "fast" group only somehow, maybe through compiletest flags and annotations in test files. |
Test failed due to comments like these... Update: Added 15edf4f to require directives to be the first complete word of the line. |
6f4068d to
15edf4fComparenikomatsakis
commented
May 24, 2017
Great! I agree that this is a useful thing. What do you think of the "tags" idea as a way of specifying what "sets" we want to run? I feel though that this should be a distinct PR. Maybe we should open an issue to write up a "spec"? I imagine this: and adding a flag like This flag also needs to work from |
nikomatsakis
commented
May 30, 2017
I'm inclined to r+ this specific PR, then, and try to address @petrochenkov's concern in a follow-up via some kind of tags scheme. Everybody OK with that? |
petrochenkov
commented
May 30, 2017
OK |
462fe26 to
92d1f4fComparenikomatsakis
commented
Jun 1, 2017
Sigh. This seems like it would be a good use-case for either having multiple references, or adding the ability to add "wildcards" into the reference output. I'd hoped to avoid the latter so that references can still be updated automatically though. I guess configuring the test for specific platforms suffices though -- at worst, if we really wanted to test multiple platforms, we could have two copies of the test. |
nikomatsakis
commented
Jun 1, 2017
@bors r+ |
bors
commented
Jun 1, 2017
📌 Commit 92d1f4f has been approved by |
bors
commented
Jun 2, 2017
⌛ Testing commit 92d1f4f with merge 65251ec... |
bors
commented
Jun 2, 2017
💔 Test failed - status-travis |
kennytm
commented
Jun 2, 2017
looks like emscripten is also 32-bit. |
92d1f4f to
e703fa7Compare@nikomatsakis Ignored emscripten as well in 2f68cfd (HEAD = e703fa7). |
Mark-Simulacrum
commented
Jun 2, 2017
Looks like a UI test needs updating. |
…ust-lang#36516. The 'run-pass' header cause a 'ui' test to execute the result. It is used to test the lint output, at the same time ensure those lints won't cause the source code to become compile-fail. 12 run-pass/run-pass-fulldeps tests gained the header and are moved to ui/ui-fulldeps. After this move, no run-pass/run-pass-fulldeps tests should rely on the compiler's JSON message. This allows us to stop passing `--error-format json` in run-pass tests, thus fixing rust-lang#36516.
…ent. Refactored some related code to take advantage of this change.
e703fa7 to
3e6c83dComparekennytm
commented
Jun 2, 2017
@Mark-Simulacrum Thanks. Gah. Fixed in 3e6c83d. |
Mark-Simulacrum
commented
Jun 4, 2017
@bors r=nikomatsakis |
bors
commented
Jun 4, 2017
📌 Commit 3e6c83d has been approved by |
bors
commented
Jun 4, 2017
… r=nikomatsakis Introduce 'run-pass' header to 'ui' tests in compiletest. Fix issue #36516. <del>`ui-run` test is a combination of `ui` test and `run-pass` test. It is used to test lint output.</del> Added support of `// run-pass` header to `ui` tests. The compiler message of each test must match the corresponding `*.stderr` file like the traditional `ui` tests. Additionally, the compiled output must be executed successfully like the `run-pass` test. 12 `run-pass`/`run-pass-fulldeps` tests are moved to `ui`/`ui-fulldeps` plus the headers. After this move, no `run-pass`/`run-pass-fulldeps` tests should rely on the compiler's JSON message. This allows us to stop passing `--error-format json` in run-pass tests, thus fixing #36516.
bors
commented
Jun 4, 2017
☀️ Test successful - status-appveyor, status-travis |
… r=nikomatsakis compilertest (UI test): Support custom normalization. Closes#42434. Adds this header for UI tests: ```rust // normalize-stderr-32bit: "fn() (32 bits)" -> "fn() ($PTR bits)" ``` It will normalize the `stderr` output on 32-bit platforms, by replacing all instances of `fn() (32 bits)` by `fn() ($PTR bits)`. Extends the UI tests in #42304 and #41968 to 32-bit targets. r? @nikomatsakis
… r=nikomatsakis compilertest (UI test): Support custom normalization. Closes#42434. Adds this header for UI tests: ```rust // normalize-stderr-32bit: "fn() (32 bits)" -> "fn() ($PTR bits)" ``` It will normalize the `stderr` output on 32-bit platforms, by replacing all instances of `fn() (32 bits)` by `fn() ($PTR bits)`. Extends the UI tests in #42304 and #41968 to 32-bit targets. r? @nikomatsakis
Eh2406
commented
Sep 3, 2017
There is a FIXME related to this issue, |
ui-runtest is a combination ofuitest andrun-passtest. It is used to test lint output.Added support of
// run-passheader touitests.The compiler message of each test must match the corresponding
*.stderrfile like the traditionaluitests. Additionally, the compiled output must be executed successfully like therun-passtest.12
run-pass/run-pass-fulldepstests are moved toui/ui-fulldepsplus the headers. After this move, norun-pass/run-pass-fulldepstests should rely on the compiler's JSON message. This allows us to stop passing--error-format jsonin run-pass tests, thus fixing #36516.