Skip to content

fix self_tests #4033

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

Merged
merged 3 commits into from
Feb 17, 2020
Merged

fix self_tests #4033

merged 3 commits into from
Feb 17, 2020

Conversation

rchaser53
Copy link
Contributor

@rchaser53 rchaser53 commented Jan 30, 2020

fix: #4017

@@ -92,7 +92,6 @@ struct Opt {
verbose: bool,

// Nightly-only options.

Copy link
Member

@calebcartwright calebcartwright Jan 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be nice to keep the intent of this comment (and the Positional args on line 125/126 below) separate so they don't seem to be pinned to a specific opt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now rustfmt removes the newline in this case.
So if I insert newline here, self_tests is failed...
I think this is the rustfmt bug.
maybe related: #4012

@@ -385,7 +389,8 @@ fn self_tests() {
if !is_nightly_channel!() {
return;
}
let mut files = get_test_files(Path::new("tests"), false);
let skip_file_white_list = ["target", "tests"];
let mut files = get_test_files(Path::new("../../rustfmt-core"), true, &skip_file_white_list);
files.push(PathBuf::from("src/lib.rs"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I was also originally thinking that we could restore self_tests by conditionally enabling the recursive Config setting that could be controlled via additional flags to check_files() and then to idempotent_check() vs. running in non-recursive mode and collecting each individual file.

However, if we are going to use the updated form of get_test_files to collect every file, then I don't think there's a need to have this line to push the entry lib.rs file again (it should already be there), right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Certainly. I fixed it. Thank you for the review.

Copy link
Contributor

@topecongiro topecongiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@topecongiro topecongiro merged commit 75a375f into rust-lang:master Feb 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

self_tests is not working
4 participants