Skip to content

Support more test names in difftest #313

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 2 commits into from
Jul 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions tests/difftests/bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,27 @@ fn main() -> Result<()> {
})
.collect();

// If filters are provided that look like paths (contain '/'), convert them to test names
let opts = if opts.filters.iter().any(|f| f.contains('/')) {
let mut new_opts = opts;
new_opts.filters = new_opts
.filters
.into_iter()
.map(|filter| {
if filter.contains('/') {
// Convert path-like filter to test name format
let path_filter = filter.replace('/', "::");
format!("{}", path_filter)
} else {
filter
}
})
.collect();
new_opts
} else {
opts
};

let passed = run_tests_console(&opts, tests).expect("Failed to run tests");

process::exit(if passed { 0 } else { 1 });
Expand Down