| 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("amd64-python39.lib").unwrap(); |
| 13 |
import_lib.write_to(&mut lib).unwrap(); |
| 14 |
} |
| 15 |
|
| 16 |
#[test] |
| 17 |
fn test_import_library_msvc_i386() { |
| 18 |
let import_lib = ImportLibrary::new( |
| 19 |
include_str!("python39.def"), |
| 20 |
MachineType::I386, |
| 21 |
Flavor::Msvc, |
| 22 |
) |
| 23 |
.unwrap(); |
| 24 |
let mut lib = std::fs::File::create("i386-python39.lib").unwrap(); |
| 25 |
import_lib.write_to(&mut lib).unwrap(); |
| 26 |
} |
| 27 |
|
| 28 |
#[cfg(feature = "gnu")] |
| 29 |
#[test] |
| 30 |
fn test_import_library_gnu_amd64() { |
| 31 |
let import_lib = ImportLibrary::new( |
| 32 |
include_str!("python39.def"), |
| 33 |
MachineType::AMD64, |
| 34 |
Flavor::Gnu, |
| 35 |
) |
| 36 |
.unwrap(); |
| 37 |
let mut lib = std::fs::File::create("amd64-python39.dll.a").unwrap(); |
| 38 |
import_lib.write_to(&mut lib).unwrap(); |
| 39 |
} |
| 40 |
|
| 41 |
#[cfg(feature = "gnu")] |
| 42 |
#[test] |
| 43 |
fn test_import_library_gnu_i386() { |
| 44 |
let import_lib = |
| 45 |
ImportLibrary::new(include_str!("python39.def"), MachineType::I386, Flavor::Gnu).unwrap(); |
| 46 |
let mut lib = std::fs::File::create("i386-python39.dll.a").unwrap(); |
| 47 |
import_lib.write_to(&mut lib).unwrap(); |
| 48 |
} |