Skip to content
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

Add normalize() in run-make Diff type #124561

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

GuillaumeGomez
Copy link
Member

I need it to do the same as:

//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"

in doctests.

I need it in particular for the #123974 PR (which contains this commit until this PR current PR is merged).

cc @Urgau
r? @jieyouxu

@rustbot
Copy link
Collaborator

rustbot commented Apr 30, 2024

The run-make-support library was changed

cc @jieyouxu

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 30, 2024
src/tools/run-make-support/src/diff/mod.rs Outdated Show resolved Hide resolved
src/tools/run-make-support/src/diff/mod.rs Outdated Show resolved Hide resolved
let expected_name = self.expected_name.as_ref().unwrap();
let actual_name = self.actual_name.as_ref().unwrap();
for (regex, replacement) in &self.normalizers {
let re = Regex::new(regex).expect("bad regex in custom normalization rule");
actual = re.replace_all(&actual, replacement).into_owned();
Copy link
Member

Choose a reason for hiding this comment

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

should we assert that we actually replace something?

Copy link
Member Author

Choose a reason for hiding this comment

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

As you prefer.

@jieyouxu
Copy link
Member

Thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Apr 30, 2024

📌 Commit e0ec71f has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 30, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 30, 2024
Rollup of 4 pull requests

Successful merges:

 - rust-lang#124280 (Port repr128-dwarf run-make test to rmake)
 - rust-lang#124299 (Add test for issue 106269)
 - rust-lang#124553 (Write `git-commit-{sha,info}` for Cargo in source tarballs)
 - rust-lang#124561 (Add `normalize()` in run-make `Diff` type)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7350a7f into rust-lang:master Apr 30, 2024
6 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 30, 2024
Rollup merge of rust-lang#124561 - GuillaumeGomez:run-make-normalize, r=jieyouxu

Add `normalize()` in run-make `Diff` type

I need it to do the same as:

```
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
```

in doctests.

I need it in particular for the rust-lang#123974 PR (which contains this commit until this PR current PR is merged).

cc `@Urgau`
r? `@jieyouxu`
@rustbot rustbot added this to the 1.80.0 milestone Apr 30, 2024
@GuillaumeGomez GuillaumeGomez deleted the run-make-normalize branch May 1, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants