Debian Codegraph @

tests/test_import_lib.rs

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 use implib::{Flavor, ImportLibrary, MachineType};
2
3 #[cfg(feature = "msvc")]
4 #[test]
5 fn test_import_library_msvc_amd64() {
6 let import_lib = ImportLibrary::new(
7 include_str!("python39.def"),
8 MachineType::AMD64,
9 Flavor::Msvc,
10 )
11 .unwrap();
•12 let mut lib = std::fs::File::create(std::path::Path::new(std::env!("CARGO_TARGET_TMPDIR")).join("amd64-python39.lib")).unwrap();
13 import_lib.write_to(&mut lib).unwrap();
14 }
15
•16 #[cfg(feature = "msvc")]
17 #[test]
18 fn test_import_library_msvc_i386() {
19 let import_lib = ImportLibrary::new(
20 include_str!("python39.def"),
21 MachineType::I386,
22 Flavor::Msvc,
23 )
24 .unwrap();
•25 let mut lib = std::fs::File::create(std::path::Path::new(std::env!("CARGO_TARGET_TMPDIR")).join("i386-python39.lib")).unwrap();
26 import_lib.write_to(&mut lib).unwrap();
27 }
28
29 #[cfg(feature = "gnu")]
30 #[test]
31 fn test_import_library_gnu_amd64() {
32 let import_lib = ImportLibrary::new(
33 include_str!("python39.def"),
34 MachineType::AMD64,
35 Flavor::Gnu,
36 )
37 .unwrap();
•38 let mut lib = std::fs::File::create(std::path::Path::new(std::env!("CARGO_TARGET_TMPDIR")).join("amd64-python39.dll.a")).unwrap();
39 import_lib.write_to(&mut lib).unwrap();
40 }
41
42 #[cfg(feature = "gnu")]
43 #[test]
44 fn test_import_library_gnu_i386() {
45 let import_lib =
46 ImportLibrary::new(include_str!("python39.def"), MachineType::I386, Flavor::Gnu).unwrap();
•47 let mut lib = std::fs::File::create(std::path::Path::new(std::env!("CARGO_TARGET_TMPDIR")).join("i386-python39.dll.a")).unwrap();
48 import_lib.write_to(&mut lib).unwrap();
49 }