@@ -370,6 +370,15 @@ impl CompilerTestBuilder {
370370
371371 // Cargo-based source types share a lot of configuration in common
372372 match self . source {
373+ CompilerTestInputType :: CargoMiden ( ref config) => {
374+ let manifest_path = project_dir. join ( "Cargo.toml" ) ;
375+ command
376+ . arg ( "--manifest-path" )
377+ . arg ( manifest_path)
378+ . arg ( "--release" )
379+ . arg ( "--target" )
380+ . arg ( config. target . as_ref ( ) ) ;
381+ }
373382 CompilerTestInputType :: CargoComponent ( _) => {
374383 let manifest_path = project_dir. join ( "Cargo.toml" ) ;
375384 command. arg ( "--manifest-path" ) . arg ( manifest_path) . arg ( "--release" ) ;
@@ -635,6 +644,23 @@ impl CompilerTestBuilder {
635644 builder
636645 }
637646
647+ /// Compile the Rust project using cargo-miden
648+ pub fn rust_source_cargo_miden (
649+ cargo_project_folder : impl AsRef < Path > ,
650+ config : WasmTranslationConfig ,
651+ ) -> Self {
652+ let name = cargo_project_folder
653+ . as_ref ( )
654+ . file_stem ( )
655+ . map ( |name| name. to_string_lossy ( ) . into_owned ( ) )
656+ . unwrap_or ( "" . to_string ( ) ) ;
657+ let mut builder = CompilerTestBuilder :: new ( CompilerTestInputType :: CargoMiden (
658+ CargoTest :: new ( name, cargo_project_folder. as_ref ( ) . to_path_buf ( ) ) ,
659+ ) ) ;
660+ builder. with_wasm_translation_config ( config) ;
661+ builder
662+ }
663+
638664 /// Set the Rust source code to compile a library Cargo project to Wasm module
639665 pub fn rust_source_cargo_lib (
640666 cargo_project_folder : impl AsRef < Path > ,
@@ -983,6 +1009,14 @@ impl CompilerTest {
9831009 CompilerTestBuilder :: rust_source_cargo_component ( cargo_project_folder, config) . build ( )
9841010 }
9851011
1012+ /// Compile the Rust project using cargo-miden
1013+ pub fn rust_source_cargo_miden (
1014+ cargo_project_folder : impl AsRef < Path > ,
1015+ config : WasmTranslationConfig ,
1016+ ) -> Self {
1017+ CompilerTestBuilder :: rust_source_cargo_miden ( cargo_project_folder, config) . build ( )
1018+ }
1019+
9861020 /// Set the Rust source code to compile a library Cargo project to Wasm module
9871021 pub fn rust_source_cargo_lib (
9881022 cargo_project_folder : impl AsRef < Path > ,
0 commit comments