diff --git a/pipeline/src/test_util.rs b/pipeline/src/test_util.rs index 1d8b10463..d62e6a1a9 100644 --- a/pipeline/src/test_util.rs +++ b/pipeline/src/test_util.rs @@ -25,7 +25,7 @@ pub fn verify_test_file( .from_file(resolve_test_file(file_name)) .with_prover_inputs(inputs) .add_external_witness_values(external_witness_values); - verify_pipeline(pipeline) + verify_pipeline(pipeline, BackendType::EStarkDump) } pub fn verify_asm_string( @@ -44,12 +44,15 @@ pub fn verify_asm_string( pipeline = pipeline.add_data_vec(&data); } - verify_pipeline(pipeline).unwrap(); + verify_pipeline(pipeline, BackendType::EStarkDump).unwrap(); } -pub fn verify_pipeline(pipeline: Pipeline) -> Result<(), String> { - // TODO: Also test EStarkDumpComposite - let mut pipeline = pipeline.with_backend(BackendType::EStarkDump, None); +pub fn verify_pipeline( + pipeline: Pipeline, + backend: BackendType, +) -> Result<(), String> { + // TODO: Also test Composite variants + let mut pipeline = pipeline.with_backend(backend, None); let tmp_dir = mktemp::Temp::new_dir().unwrap(); if pipeline.output_dir().is_none() { @@ -253,7 +256,7 @@ pub fn assert_proofs_fail_for_invalid_witnesses_pilcom( .from_file(resolve_test_file(file_name)) .set_witness(convert_witness(witness)); - assert!(verify_pipeline(pipeline.clone()).is_err()); + assert!(verify_pipeline(pipeline.clone(), BackendType::EStarkDump).is_err()); } pub fn assert_proofs_fail_for_invalid_witnesses_estark( diff --git a/riscv/tests/common/mod.rs b/riscv/tests/common/mod.rs index 7a1061832..00f946fc8 100644 --- a/riscv/tests/common/mod.rs +++ b/riscv/tests/common/mod.rs @@ -1,3 +1,4 @@ +use powdr_backend::BackendType; use powdr_number::GoldilocksField; use powdr_pipeline::{test_util::verify_pipeline, Pipeline}; use std::path::PathBuf; @@ -8,6 +9,7 @@ pub fn verify_riscv_asm_string( contents: &str, inputs: Vec, data: Option>, + backend: BackendType, ) { let temp_dir = mktemp::Temp::new_dir().unwrap().release(); @@ -31,5 +33,5 @@ pub fn verify_riscv_asm_string( powdr_riscv_executor::ExecMode::Fast, Default::default(), ); - verify_pipeline(pipeline).unwrap(); + verify_pipeline(pipeline, backend).unwrap(); } diff --git a/riscv/tests/instructions.rs b/riscv/tests/instructions.rs index 99e618bdd..32a5c39c9 100644 --- a/riscv/tests/instructions.rs +++ b/riscv/tests/instructions.rs @@ -2,6 +2,7 @@ mod common; mod instruction_tests { use crate::common::verify_riscv_asm_string; + use powdr_backend::BackendType; use powdr_number::GoldilocksField; use powdr_riscv::asm::compile; use powdr_riscv::Runtime; @@ -15,7 +16,13 @@ mod instruction_tests { false, ); - verify_riscv_asm_string::<()>(&format!("{name}.asm"), &powdr_asm, Default::default(), None); + verify_riscv_asm_string::<()>( + &format!("{name}.asm"), + &powdr_asm, + Default::default(), + None, + BackendType::EStarkDump, + ); } include!(concat!(env!("OUT_DIR"), "/instruction_tests.rs")); diff --git a/riscv/tests/riscv.rs b/riscv/tests/riscv.rs index 99523ec75..651b41457 100644 --- a/riscv/tests/riscv.rs +++ b/riscv/tests/riscv.rs @@ -337,8 +337,17 @@ fn many_chunks_memory() { } fn verify_riscv_crate(case: &str, inputs: Vec, runtime: &Runtime) { + verify_riscv_crate_with_backend(case, inputs, runtime, BackendType::EStarkDump) +} + +fn verify_riscv_crate_with_backend( + case: &str, + inputs: Vec, + runtime: &Runtime, + backend: BackendType, +) { let powdr_asm = compile_riscv_crate::(case, runtime); - verify_riscv_asm_string::<()>(&format!("{case}.asm"), &powdr_asm, inputs, None); + verify_riscv_asm_string::<()>(&format!("{case}.asm"), &powdr_asm, inputs, None, backend); } fn verify_riscv_crate_with_data( @@ -349,7 +358,13 @@ fn verify_riscv_crate_with_data( ) { let powdr_asm = compile_riscv_crate::(case, runtime); - verify_riscv_asm_string(&format!("{case}.asm"), &powdr_asm, inputs, Some(data)); + verify_riscv_asm_string( + &format!("{case}.asm"), + &powdr_asm, + inputs, + Some(data), + BackendType::EStarkDump, + ); } fn compile_riscv_crate(case: &str, runtime: &Runtime) -> String {