Skip to content

Commit f187d94

Browse files
committed
[hermes] Add some tests for Charon invocation
gherrit-pr-id: G60bb1cd41a5fade3144a05f2bdafb2a670059e03
1 parent bc49806 commit f187d94

File tree

1,534 files changed

+785266
-62
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,534 files changed

+785266
-62
lines changed

tools/Cargo.lock

Lines changed: 134 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/hermes/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ proc-macro2 = { version = "1.0.105", features = ["span-locations"] }
1919
rayon = "1.11.0"
2020
serde = { version = "1.0.228", features = ["derive"] }
2121
serde_json = "1.0.149"
22-
syn = { version = "2.0.114", features = ["full", "visit", "extra-traits", "parsing"] }
22+
syn = { version = "2.0.114", features = ["full", "visit", "extra-traits", "parsing", "printing"] }
23+
quote = "1.0"
2324
thiserror = "2.0.18"
2425
walkdir = "2.5.0"
2526

@@ -31,6 +32,9 @@ assert_cmd = "2.1.2"
3132
tempfile = "3.24.0"
3233
predicates = "3.1.3"
3334
datatest-stable = "0.3.3"
35+
serde = { version = "1.0", features = ["derive"] }
36+
toml = "0.8"
37+
which = "6.0"
3438

3539
[[test]]
3640
name = "integration"

tools/hermes/src/charon.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ pub fn run_charon(args: &Args, roots: &Roots, packages: &[HermesArtifact]) -> Re
3030
// Fail fast on errors
3131
cmd.arg("--abort-on-error");
3232

33-
// Start translation from specific entry points
34-
cmd.arg("--start-from").arg(artifact.start_from.join(","));
33+
// Start translation from specific entry points. Sort to ensure
34+
// deterministic ordering for testing (not important in production).
35+
let mut start_from = artifact.start_from.clone();
36+
start_from.sort();
37+
cmd.arg("--start-from").arg(start_from.join(","));
3538

3639
// Separator for the underlying cargo command
3740
cmd.arg("--");

tools/hermes/src/errors.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,13 @@ pub enum HermesError {
2121
span: SourceSpan,
2222
msg: String,
2323
},
24+
#[error("Nested item error: {msg}")]
25+
#[diagnostic(code(hermes::nested_item))]
26+
NestedItemError {
27+
#[source_code]
28+
src: miette::NamedSource<String>,
29+
#[label("this item is defined inside a function body")]
30+
span: miette::SourceSpan,
31+
msg: String,
32+
},
2433
}

0 commit comments

Comments
 (0)