From fd011cd5ecb65b076f94376214ff31e7edcff189 Mon Sep 17 00:00:00 2001 From: datdenkikniet Date: Sun, 16 Apr 2023 11:37:36 +0200 Subject: FIx printing for Run and Qemu --- xtask/src/run/results.rs | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'xtask/src/run/results.rs') diff --git a/xtask/src/run/results.rs b/xtask/src/run/results.rs index 072cbcf..b64e7b1 100644 --- a/xtask/src/run/results.rs +++ b/xtask/src/run/results.rs @@ -2,32 +2,10 @@ use log::{error, info, log, Level}; use crate::{argument_parsing::Globals, cargo_command::CargoCommand}; -use super::data::{FinalRunResult, RunResult, TestRunError}; +use super::data::FinalRunResult; const TARGET: &str = "xtask::results"; -/// Check if `run` was successful. -/// returns Ok in case the run went as expected, -/// Err otherwise -pub fn run_successful(run: &RunResult, expected_output_file: &str) -> Result<(), TestRunError> { - let file = expected_output_file.to_string(); - - let expected_output = std::fs::read(expected_output_file) - .map(|d| String::from_utf8(d).map_err(|_| TestRunError::FileError { file: file.clone() })) - .map_err(|_| TestRunError::FileError { file })??; - - if expected_output != run.stdout { - Err(TestRunError::FileCmpError { - expected: expected_output.clone(), - got: run.stdout.clone(), - }) - } else if !run.exit_status.success() { - Err(TestRunError::CommandError(run.clone())) - } else { - Ok(()) - } -} - pub fn handle_results(globals: &Globals, results: Vec) -> Result<(), ()> { let errors = results.iter().filter_map(|r| { if let FinalRunResult::Failed(c, r) = r { -- cgit v1.2.3