Expose parsing of run commands and trivially use in testing framework

This is necessary to avoid build errors from dead code (and I didn't want to litter all of the structs with `#[allow(dead_code)]` just to remove in a subsequent PR).
This commit is contained in:
Andrew Brown
2020-03-30 13:38:51 -07:00
parent f56f9fb01c
commit 5297466add
4 changed files with 19 additions and 1 deletions

View File

@@ -92,7 +92,9 @@ fn run_file_contents(file_contents: String) -> Result<(), String> {
let test_file = parse_test(&file_contents, options).map_err(|e| e.to_string())?;
for (func, Details { comments, .. }) in test_file.functions {
if comments.iter().any(|c| c.text.contains("run")) {
// TODO in following changes we will parse this comment to alter the FunctionRunner's behavior.
let isa = create_target_isa(&test_file.isa_spec)?;
// TODO the following no longer makes sense; use FunctionRunner::with_host_isa(...) instead
FunctionRunner::new(func, isa).run()?
}
}