Skip to content

Commit e477af0

Browse files
committed
[hermes] Add fixture testing
gherrit-pr-id: G3220747e90b678c598c506be49219a8f75118988
1 parent 6f377df commit e477af0

File tree

655 files changed

+101951
-7
lines changed

Some content is hidden

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

655 files changed

+101951
-7
lines changed

tools/Cargo.lock

Lines changed: 208 additions & 0 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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,11 @@ walkdir = "2.5.0"
2626
syn = { version = "2.0.114", features = ["printing", "full", "visit", "extra-traits", "parsing"] }
2727
proc-macro2 = { version = "1.0.105", features = ["span-locations"] }
2828
ui_test = "0.30.4"
29+
assert_cmd = "2.1.2"
30+
tempfile = "3.24.0"
31+
predicates = "3.1.3"
32+
datatest-stable = "0.3.3"
33+
34+
[[test]]
35+
name = "integration"
36+
harness = false

tools/hermes/src/main.rs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,33 @@ mod shadow;
55
mod transform;
66
mod ui_test_shim;
77

8-
use std::{env, process::exit};
9-
108
use clap::Parser;
119

1210
/// Hermes: A Literate Verification Toolchain
1311
#[derive(Parser, Debug)]
1412
#[command(name = "hermes", version, about, long_about = None)]
1513
struct Cli {
16-
#[command(flatten)]
17-
resolve: resolve::Args,
14+
#[command(subcommand)]
15+
command: Commands,
16+
}
17+
18+
#[derive(clap::Subcommand, Debug)]
19+
enum Commands {
20+
/// Verify a crate
21+
Verify(resolve::Args),
1822
}
1923

2024
fn main() -> anyhow::Result<()> {
21-
if env::var("HERMES_UI_TEST_MODE").is_ok() {
25+
if std::env::var("HERMES_UI_TEST_MODE").is_ok() {
2226
ui_test_shim::run();
2327
return Ok(());
2428
}
2529

2630
let args = Cli::parse();
27-
let roots = resolve::resolve_roots(&args.resolve)?;
28-
shadow::build_shadow_crate(&roots)
31+
match args.command {
32+
Commands::Verify(resolve_args) => {
33+
let roots = resolve::resolve_roots(&resolve_args)?;
34+
shadow::build_shadow_crate(&roots)
35+
}
36+
}
2937
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
failure
2+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Unclosed ```lean block

tools/hermes/tests/fixtures/broken_doc_block/hermes.toml

Whitespace-only changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[package]
2+
name = "broken_doc"
3+
version = "0.1.0"
4+
edition = "2021"
5+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/// ```lean
2+
/// unclosed block
3+
fn foo() {}

0 commit comments

Comments
 (0)