Skip to content

Commit

Permalink
Fix mode filters (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
sayon authored Jan 10, 2025
1 parent a067497 commit cddaada
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ Most of the specifiers support wildcards `*` (any), `^` ('3' and 'z').
With no mode argument, iterates over all option combinations (approximately 800).



## Usage

Each command assumes you are at the root of the `compiler-tester` repository.
Expand Down Expand Up @@ -228,6 +227,8 @@ cargo run --release --bin compiler-tester -- -DT \
--zksolc '../era-compiler-solidity/target/release/zksolc'
```
Modes are insensitive to spaces, therefore options such as `'Y+M3B3 0.8.26'` and `'Y + M3B3 0.8.26'` are equivalent.
### Example 2
Run all simple Yul tests. This currently runs about three hundred tests and takes about eight minutes.
Expand Down
4 changes: 2 additions & 2 deletions compiler_tester/src/compilers/mode/imode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ pub trait IMode {
}

pub fn mode_to_string_aux(mode: &impl IMode, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
for (i, element) in [mode.optimizations(), mode.codegen(), mode.version()]
for (i, element) in [mode.codegen(), mode.optimizations(), mode.version()]
.iter()
.flatten()
.enumerate()
{
if i > 0 {
write!(f, " ")?;
write!(f, " ")?;
}
write!(f, "{}", element)?;
}
Expand Down
1 change: 1 addition & 0 deletions compiler_tester/src/compilers/mode/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ impl Mode {
}
}

current = current.replace(' ', "");
current
}
}
Expand Down
7 changes: 6 additions & 1 deletion compiler_tester/src/filters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ impl Filters {
) -> Self {
Self {
path_filters: path_filters.into_iter().collect(),
mode_filters: mode_filters.into_iter().collect(),
// Mode filters are stripped of spaces so filters like "Y+M3B3
// 0.2.1 " and "Y +M3B3 0.2.1" become equivalent
mode_filters: mode_filters
.into_iter()
.map(|f| f.replace(' ', ""))
.collect(),
group_filters: group_filters.into_iter().collect(),
}
}
Expand Down

0 comments on commit cddaada

Please sign in to comment.