Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 4 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
[workspace]
members = [
"executables/*"
]
members = ["executables/*"]
resolver = "2"

[workspace.dependencies]
anyhow = "1.0.86"
serde = { version = "1.0.214", features = ["derive"] }
serde_json = {version = "1.0.125", features = ["unbounded_depth"]}
rust_am_lib = { git = "https://github.com/ku-sldg/rust-am-lib.git", version = "0.2.0"}
#rust_am_lib = { git = "file:///Users/adampetz/Documents/Summer_2025/rust-am-lib/", version = "0.2.0", branch="env_demo"}
serde_json = { version = "1.0.125", features = ["unbounded_depth"] }
rust_am_lib = { git = "https://github.com/ku-sldg/rust-am-lib.git", version = "0.3.0" }
#rust_am_lib = { git = "file:///Users/adampetz/Documents/Summer_2025/rust-am-lib/", version = "0.2.0", branch="env_demo"}
32 changes: 24 additions & 8 deletions executables/verus_compare/tests/integration.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
fn test_exec_and_output(test_name: &str, exec: &str, args: &str, expected_output: &str) {
// Capture the output of running [exec] with [args] as a single argument
let output = std::process::Command::new(exec)
.arg(args)
.output()
.expect("Failed to execute process");
use std::io::Write;
use std::process::{Command, Stdio};

fn test_exec_and_output(test_name: &str, exec: &str, input_data: &str, expected_output: &str) {
let mut child = Command::new(exec)
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.spawn()
.expect("Failed to spawn process");

{
let mut stdin = child.stdin.take().expect("Failed to open stdin");
stdin
.write_all(input_data.as_bytes())
.expect("Failed to write to stdin");
}

let output = child.wait_with_output().expect("Failed to read stdout");
let stdout = String::from_utf8_lossy(&output.stdout);
// If we fail this, print the full output for debugging

assert!(
stdout.contains(expected_output),
"Test {}: Output did not contain expected string\nOutput: ```\n{}\n```\nExpected to contain: \n```{}\n```\nFull output for debugging: \n{:?}",
"Test {}: Output did not contain expected string\n\
--- Captured STDOUT ---\n{}\n\
--- Expected to contain ---\n{}\n\
--- Full Metadata ---\n{:?}",
test_name,
stdout,
expected_output,
Expand Down