Get tests working

This commit is contained in:
Sam Mohr 2024-08-14 19:31:45 -07:00
parent 3662c90346
commit 4ec213a114
No known key found for this signature in database
GPG key ID: EA41D161A3C1BC99
2 changed files with 75 additions and 71 deletions

View file

@ -1,5 +1,7 @@
#![cfg(test)]
use std::io::Read;
use indoc::indoc;
#[cfg(target_os = "linux")]
@ -160,10 +162,20 @@ fn run_with_valgrind(binary_path: &std::path::Path) {
.to_str()
.unwrap();
let (valgrind_out, raw_xml) =
cli_utils::helpers::run_with_valgrind([], &[generated_filename.to_string()]);
let valgrind_out = cli_utils::helpers::Run::new_roc()
.arg(generated_filename)
.run_with_valgrind();
if valgrind_out.status.success() {
let mut raw_xml = String::new();
valgrind_out
.valgrind_xml
.as_ref()
.unwrap()
.read_to_string(&mut raw_xml)
.unwrap();
let memory_errors = extract_valgrind_errors(&raw_xml).unwrap_or_else(|err| {
panic!(
indoc!(