-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate link-arg
, link-dedup
and issue-26092
run-make
tests to rmake
format
#125500
Conversation
ace8f1d
to
678efb6
Compare
This comment has been minimized.
This comment has been minimized.
Yes, I think it would be good to try converting them to UI tests |
678efb6
to
70a3ac6
Compare
This comment has been minimized.
This comment has been minimized.
@rustbot author |
70a3ac6
to
841f4cc
Compare
Unfortunately, porting these tests to UI tests turned out to be non-trivial:
It's very possible that some existing UI test features would allow supporting these tests in UI form, but it seems to me that there is a reason they were Of all 3, @rustbot review |
Some changes occurred in run-make tests. cc @jieyouxu |
This comment has been minimized.
This comment has been minimized.
Some strange test failures here. Perhaps
let output = String::from_utf8(rustc().input("empty.rs").command_output().stderr).unwrap();
assert_eq!(output.matches("-ltesta").count(), 1); I have tried replacing it with an inefficient alternative just to see if it makes the test pass, though this is likely a bad implementation. let output = rustc().input("empty.rs").command_output().stderr;
let pattern = b"\"-ltesta\" \"-ltesta\" \"-ltesta\"";
for window in output.windows(pattern.len()) {
if window == pattern {
panic!("ltesta was repeated too many times");
}
} As for the other error, it's quite strange - the rewrite seems really equivalent to the original Makefile. It could be interesting to debug and see what the |
This comment has been minimized.
This comment has been minimized.
1368307
to
2942fc6
Compare
This comment has been minimized.
This comment has been minimized.
@Oneirical becareful with the
So if the input to |
@rustbot author |
That is what I thought too, hence the However, the last one is the confusing one:
This is testing that the string EDIT: Actually, most of this logic was really overkill, let's try something much simpler. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good in general, just have a few nits.
/// Checks that trimmed `stdout` contains trimmed `content`. | ||
#[track_caller] | ||
pub fn assert_stdout_contains<S: AsRef<str>>(&self, needle: S) -> &Self { | ||
assert!(self.stdout_utf8().contains(needle.as_ref())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: I think we really want to expand these asserts to verbosely log the stdout and the expected/unexpected, but that can be done in a follow-up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, that's already the case (this PR was not rebased fully, I don't know why it didn't complain about merge conflicts). Only the assert_x_equals
need verbose logging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I chose to add it right away, as it's fairly trivial.
@@ -5,7 +5,6 @@ use run_make_support::rustdoc; | |||
|
|||
fn main() { | |||
let output = rustdoc().input("input.rs").arg("--test").run_fail().stdout_utf8(); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: where did these formatting diffs from come?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just me waving around autoformatting a little too liberally, I have restored it.
@rustbot author |
12fa410
to
0813858
Compare
@rustbot review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, just a few minor nits left, then r=me.
0813858
to
d2e8671
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some more nits... Sorry!
use run_make_support::rustc; | ||
|
||
fn main() { | ||
let output = rustc().output("").stdin(b"fn main() {}").run_fail(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: I think this needs an .arg("-")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing it locally did not result in any problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool 😎
After fixing the nits, can you try to run |
d2e8671
to
6228b3e
Compare
Indeed, it failed, because the correct way to write it is |
☀️ Test successful - checks-actions |
Finished benchmarking commit (59e2c01): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results (primary 0.9%, secondary -3.4%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary -0.9%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 669.558s -> 670.994s (0.21%) |
Part of #121876 and the associated Google Summer of Code project.
All of these tests check if rustc's output contains (or does not) contain certain strings. Does that mean these could be better suited to becoming UI/codegen tests?
try-job: x86_64-msvc