Index: implib/tests/test_import_lib.rs =================================================================== --- implib.orig/tests/test_import_lib.rs +++ implib/tests/test_import_lib.rs @@ -9,10 +9,11 @@ fn test_import_library_msvc_amd64() { Flavor::Msvc, ) .unwrap(); - let mut lib = std::fs::File::create("amd64-python39.lib").unwrap(); + let mut lib = std::fs::File::create(std::path::Path::new(std::env!("CARGO_TARGET_TMPDIR")).join("amd64-python39.lib")).unwrap(); import_lib.write_to(&mut lib).unwrap(); } +#[cfg(feature = "msvc")] #[test] fn test_import_library_msvc_i386() { let import_lib = ImportLibrary::new( @@ -21,7 +22,7 @@ fn test_import_library_msvc_i386() { Flavor::Msvc, ) .unwrap(); - let mut lib = std::fs::File::create("i386-python39.lib").unwrap(); + let mut lib = std::fs::File::create(std::path::Path::new(std::env!("CARGO_TARGET_TMPDIR")).join("i386-python39.lib")).unwrap(); import_lib.write_to(&mut lib).unwrap(); } @@ -34,7 +35,7 @@ fn test_import_library_gnu_amd64() { Flavor::Gnu, ) .unwrap(); - let mut lib = std::fs::File::create("amd64-python39.dll.a").unwrap(); + let mut lib = std::fs::File::create(std::path::Path::new(std::env!("CARGO_TARGET_TMPDIR")).join("amd64-python39.dll.a")).unwrap(); import_lib.write_to(&mut lib).unwrap(); } @@ -43,6 +44,6 @@ fn test_import_library_gnu_amd64() { fn test_import_library_gnu_i386() { let import_lib = ImportLibrary::new(include_str!("python39.def"), MachineType::I386, Flavor::Gnu).unwrap(); - let mut lib = std::fs::File::create("i386-python39.dll.a").unwrap(); + let mut lib = std::fs::File::create(std::path::Path::new(std::env!("CARGO_TARGET_TMPDIR")).join("i386-python39.dll.a")).unwrap(); import_lib.write_to(&mut lib).unwrap(); }