File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -16,11 +16,21 @@ fn run_test(test_file: &Path, should_pass: bool) {
1616 . and_then ( |s| s. to_str ( ) )
1717 . expect ( "Failed to get file stem" )
1818 . to_string ( ) ;
19- let temp_dir = Path :: new ( env ! ( "OUT_DIR" ) ) . join ( test_name) ;
19+ let temp_dir = Path :: new ( env ! ( "OUT_DIR" ) ) . join ( "cases" ) . join ( test_name) ;
2020 if !temp_dir. exists ( ) {
2121 fs:: create_dir_all ( & temp_dir) . expect ( "Failed to create temporary directory for test" ) ;
2222 }
2323
24+ // Create a cargo workspace, to have one shared target directory for all tests
25+ let workspace_manifest = Path :: new ( env ! ( "OUT_DIR" ) ) . join ( "Cargo.toml" ) ;
26+ if !workspace_manifest. exists ( ) {
27+ fs:: write (
28+ & workspace_manifest,
29+ "[workspace]\n resolver = \" 3\" \n members = [\" cases/*\" ]\n " ,
30+ )
31+ . expect ( "Failed to create workspace manifest" ) ;
32+ }
33+
2434 let mut manifest = Manifest :: from_rust_file ( test_file) . unwrap ( ) ;
2535 manifest. fix ( test_file) . unwrap ( ) ;
2636 let manifest_path = temp_dir. join ( "Cargo.toml" ) ;
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ impl Manifest {
131131 . unwrap_or ( true )
132132 {
133133 self . package = Some ( Package {
134- name : "embedded-test" . to_string ( ) ,
134+ name : test_file . file_stem ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ,
135135 edition : "2024" . to_string ( ) ,
136136 } ) ;
137137 }
You can’t perform that action at this time.
0 commit comments