Debian Codegraph @

debian/patches/fix-tests.patch

raw
1 Index: implib/tests/test_import_lib.rs
2 ===================================================================
3 --- implib.orig/tests/test_import_lib.rs
4 +++ implib/tests/test_import_lib.rs
5 @@ -9,10 +9,11 @@ fn test_import_library_msvc_amd64() {
6 Flavor::Msvc,
7 )
8 .unwrap();
9 - let mut lib = std::fs::File::create("amd64-python39.lib").unwrap();
10 + let mut lib = std::fs::File::create(std::path::Path::new(std::env!("CARGO_TARGET_TMPDIR")).join("amd64-python39.lib")).unwrap();
11 import_lib.write_to(&mut lib).unwrap();
12 }
13
14 +#[cfg(feature = "msvc")]
15 #[test]
16 fn test_import_library_msvc_i386() {
17 let import_lib = ImportLibrary::new(
18 @@ -21,7 +22,7 @@ fn test_import_library_msvc_i386() {
19 Flavor::Msvc,
20 )
21 .unwrap();
22 - let mut lib = std::fs::File::create("i386-python39.lib").unwrap();
23 + let mut lib = std::fs::File::create(std::path::Path::new(std::env!("CARGO_TARGET_TMPDIR")).join("i386-python39.lib")).unwrap();
24 import_lib.write_to(&mut lib).unwrap();
25 }
26
27 @@ -34,7 +35,7 @@ fn test_import_library_gnu_amd64() {
28 Flavor::Gnu,
29 )
30 .unwrap();
31 - let mut lib = std::fs::File::create("amd64-python39.dll.a").unwrap();
32 + let mut lib = std::fs::File::create(std::path::Path::new(std::env!("CARGO_TARGET_TMPDIR")).join("amd64-python39.dll.a")).unwrap();
33 import_lib.write_to(&mut lib).unwrap();
34 }
35
36 @@ -43,6 +44,6 @@ fn test_import_library_gnu_amd64() {
37 fn test_import_library_gnu_i386() {
38 let import_lib =
39 ImportLibrary::new(include_str!("python39.def"), MachineType::I386, Flavor::Gnu).unwrap();
40 - let mut lib = std::fs::File::create("i386-python39.dll.a").unwrap();
41 + let mut lib = std::fs::File::create(std::path::Path::new(std::env!("CARGO_TARGET_TMPDIR")).join("i386-python39.dll.a")).unwrap();
42 import_lib.write_to(&mut lib).unwrap();
43 }