Skip to content

Commit

Permalink
Add --check
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Mar 8, 2022
1 parent 90bfa86 commit 78b3eac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/datagen/src/bin/verify-zero-copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ fn main() -> eyre::Result<()> {
.long("input-from-testdata")
.help("Load input data from the icu_testdata project."),
)
.arg(
Arg::with_name("CHECK")
.long("check")
.help("Check violations against list of expected violations (recommended to be used with --test-keys and features = experimental)."),
)
.arg(
Arg::with_name("KEYS")
.short("k")
Expand Down Expand Up @@ -241,7 +246,7 @@ fn main() -> eyre::Result<()> {
log::info!("\t{}: max heap size {} bytes", name, vio);
}
}
if vio_vec != EXPECTED_VIOLATIONS {
if matches.is_present("CHECK") && vio_vec != EXPECTED_VIOLATIONS {
eyre::bail!("Expected violations list does not match found violations!\n\
If the new list is smaller, please update EXPECTED_VIOLATIONS in verify-zero-copy.rs\n\
If it is bigger and that was unexpected, please make sure the key remains zero-copy, or ask ICU4X team members if it is okay\
Expand Down
1 change: 1 addition & 0 deletions tools/scripts/data.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ args = [
"--",
"--input-from-testdata",
"--test-keys",
"--check",
]

[tasks.testdata]
Expand Down

0 comments on commit 78b3eac

Please sign in to comment.