fix: tests

This commit is contained in:
Ilya Zlobintsev 2025-01-05 15:24:42 +02:00
parent 141329caab
commit 14429fd67c
6 changed files with 1 additions and 115 deletions

View File

@ -9,6 +9,7 @@ fn main() {
.header("include/intel.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.dynamic_library_name("IntelDrm")
.generate_comments(false)
.generate()
.expect("Unable to generate intel bindings")
.write_to_file(out_path.join("intel_bindings.rs"))

View File

@ -936,7 +936,6 @@ fn load_controllers(base_path: &Path) -> anyhow::Result<BTreeMap<String, Box<dyn
#[cfg(test)]
let nvml: LazyCell<Option<Rc<Nvml>>> = LazyCell::new(|| None);
#[cfg(not(test))]
let amd_drm: LazyCell<Option<LibDrmAmdgpu>> = LazyCell::new(|| match LibDrmAmdgpu::new() {
Ok(drm) => {
info!("AMDGPU DRM initialized");
@ -947,10 +946,7 @@ fn load_controllers(base_path: &Path) -> anyhow::Result<BTreeMap<String, Box<dyn
None
}
});
#[cfg(test)]
let amd_drm: LazyCell<Option<LibDrmAmdgpu>> = LazyCell::new(|| None);
#[cfg(not(test))]
let intel_drm: LazyCell<Option<Rc<IntelDrm>>> = unsafe {
LazyCell::new(|| match IntelDrm::new("libdrm_intel.so.1") {
Ok(drm) => {
@ -963,8 +959,6 @@ fn load_controllers(base_path: &Path) -> anyhow::Result<BTreeMap<String, Box<dyn
}
})
};
#[cfg(test)]
let intel_drm: LazyCell<Option<Rc<IntelDrm>>> = LazyCell::new(|| None);
for entry in base_path
.read_dir()

View File

@ -1,7 +1,6 @@
---
source: lact-daemon/src/tests/mod.rs
expression: device_info
snapshot_kind: text
---
{
"clocks_info": {

View File

@ -1,54 +0,0 @@
---
source: lact-daemon/src/tests/mod.rs
assertion_line: 29
expression: device_info
snapshot_kind: text
---
{
"clocks_info": null,
"info": {
"driver": "i915",
"link_info": {
"current_speed": "Unknown",
"current_width": "0"
},
"pci_info": {
"device_pci_info": {
"model": "CometLake-U GT2 [UHD Graphics]",
"model_id": "9B41",
"vendor": "Intel Corporation",
"vendor_id": "8086"
},
"subsystem_pci_info": {
"model_id": "22B1",
"vendor": "Lenovo",
"vendor_id": "17AA"
}
}
},
"pci_info": {
"device_pci_info": {
"model": "CometLake-U GT2 [UHD Graphics]",
"model_id": "9B41",
"vendor": "Intel Corporation",
"vendor_id": "8086"
},
"subsystem_pci_info": {
"model_id": "22B1",
"vendor": "Lenovo",
"vendor_id": "17AA"
}
},
"power_profile_modes": null,
"stats": {
"clockspeed": {},
"fan": {
"control_enabled": false,
"pmfw_info": {}
},
"power": {},
"temps": {},
"voltage": {},
"vram": {}
}
}

View File

@ -1,54 +0,0 @@
---
source: lact-daemon/src/tests/mod.rs
assertion_line: 29
expression: device_info
snapshot_kind: text
---
{
"clocks_info": null,
"info": {
"driver": "xe",
"link_info": {
"current_speed": "Unknown",
"current_width": "0"
},
"pci_info": {
"device_pci_info": {
"model": "TigerLake-LP GT2 [Iris Xe Graphics]",
"model_id": "9A49",
"vendor": "Intel Corporation",
"vendor_id": "8086"
},
"subsystem_pci_info": {
"model_id": "3F19",
"vendor": "Lenovo",
"vendor_id": "17AA"
}
}
},
"pci_info": {
"device_pci_info": {
"model": "TigerLake-LP GT2 [Iris Xe Graphics]",
"model_id": "9A49",
"vendor": "Intel Corporation",
"vendor_id": "8086"
},
"subsystem_pci_info": {
"model_id": "3F19",
"vendor": "Lenovo",
"vendor_id": "17AA"
}
},
"power_profile_modes": null,
"stats": {
"clockspeed": {},
"fan": {
"control_enabled": false,
"pmfw_info": {}
},
"power": {},
"temps": {},
"voltage": {},
"vram": {}
}
}