Remove debug line for pretty-printing test, and add '--debug' flag to 'check instead.
This commit is contained in:
@@ -79,10 +79,12 @@ pub enum Error {
|
||||
named: NamedSource,
|
||||
},
|
||||
|
||||
#[error("{} failed", name)]
|
||||
#[error("{name} failed{}", if *verbose { format!("\n{src}") } else { String::new() } )]
|
||||
TestFailure {
|
||||
name: String,
|
||||
path: PathBuf,
|
||||
verbose: bool,
|
||||
src: String,
|
||||
evaluation_hint: Option<EvalHint>,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -105,12 +105,20 @@ where
|
||||
self.compile(options)
|
||||
}
|
||||
|
||||
pub fn check(&mut self, skip_tests: bool, match_tests: Option<String>) -> Result<(), Error> {
|
||||
pub fn check(
|
||||
&mut self,
|
||||
skip_tests: bool,
|
||||
match_tests: Option<String>,
|
||||
verbose: bool,
|
||||
) -> Result<(), Error> {
|
||||
let options = Options {
|
||||
code_gen_mode: if skip_tests {
|
||||
CodeGenMode::NoOp
|
||||
} else {
|
||||
CodeGenMode::Test(match_tests)
|
||||
CodeGenMode::Test {
|
||||
match_tests,
|
||||
verbose,
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -148,7 +156,10 @@ where
|
||||
self.write_build_outputs(programs, uplc_dump)?;
|
||||
Ok(())
|
||||
}
|
||||
CodeGenMode::Test(match_tests) => {
|
||||
CodeGenMode::Test {
|
||||
match_tests,
|
||||
verbose,
|
||||
} => {
|
||||
let tests = self
|
||||
.collect_scripts(&checked_modules, |def| matches!(def, Definition::Test(..)))?;
|
||||
if !tests.is_empty() {
|
||||
@@ -165,6 +176,8 @@ where
|
||||
name: e.script.name.clone(),
|
||||
path: e.script.input_path.clone(),
|
||||
evaluation_hint: e.script.evaluation_hint.clone(),
|
||||
src: e.script.program.to_pretty(),
|
||||
verbose,
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -627,8 +640,6 @@ where
|
||||
continue;
|
||||
}
|
||||
|
||||
println!("{}", script.program.to_pretty());
|
||||
|
||||
match script.program.eval(initial_budget) {
|
||||
(Ok(result), remaining_budget, _) => {
|
||||
let eval_info = EvalInfo {
|
||||
|
||||
@@ -3,7 +3,10 @@ pub struct Options {
|
||||
}
|
||||
|
||||
pub enum CodeGenMode {
|
||||
Test(Option<String>),
|
||||
Test {
|
||||
match_tests: Option<String>,
|
||||
verbose: bool,
|
||||
},
|
||||
Build(bool),
|
||||
NoOp,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user