Codebase list rust-serde-xml-rs / 5b56d76
sysinfo - fix tests in chroot envrionment. Peter Michael Green 1 year, 10 months ago
2 changed file(s) with 45 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
11
22 * Team upload.
33 * Package sysinfo 0.23.13 from crates.io using debcargo 2.5.0 (Closes: 1013137)
4 * Fix/ignore tests that fail in chroot envrionments where no disks
5 are visible.
46
57 [ Wolfgang Silbermayr ]
68 * Package sysinfo 0.22.5 from crates.io using debcargo 2.5.0
0 --- a/src/lib.rs
1 +++ b/src/lib.rs
2 @@ -256,6 +256,7 @@
0 Index: sysinfo/src/lib.rs
1 ===================================================================
2 --- sysinfo.orig/src/lib.rs
3 +++ sysinfo/src/lib.rs
4 @@ -304,6 +304,7 @@ mod test {
35 }
46
57 #[test]
79 fn check_system_info() {
810 // We don't want to test on unsupported systems.
911 if System::IS_SUPPORTED {
10 --- a/tests/process.rs
11 +++ b/tests/process.rs
12 @@ -158,6 +158,7 @@
12 Index: sysinfo/tests/process.rs
13 ===================================================================
14 --- sysinfo.orig/tests/process.rs
15 +++ sysinfo/tests/process.rs
16 @@ -157,6 +157,7 @@ fn test_process_refresh() {
1317 }
1418
1519 #[test]
1721 fn test_process_disk_usage() {
1822 use std::fs;
1923 use std::fs::File;
24 Index: sysinfo/tests/disk_list.rs
25 ===================================================================
26 --- sysinfo.orig/tests/disk_list.rs
27 +++ sysinfo/tests/disk_list.rs
28 @@ -1,6 +1,7 @@
29 // Take a look at the license at the top of the repository in the LICENSE file.
30
31 #[test]
32 +#[ignore = "not supported in debian build environments"]
33 fn test_disks() {
34 use sysinfo::SystemExt;
35
36 Index: sysinfo/benches/basic.rs
37 ===================================================================
38 --- sysinfo.orig/benches/basic.rs
39 +++ sysinfo/benches/basic.rs
40 @@ -65,10 +65,12 @@ fn bench_refresh_disk(b: &mut test::Benc
41 let mut s = sysinfo::System::new_all();
42
43 let disks = s.disks_mut();
44 - let disk = &mut disks[0];
45 - b.iter(move || {
46 - disk.refresh();
47 - });
48 + if !disks.is_empty() {
49 + let disk = &mut disks[0];
50 + b.iter(move || {
51 + disk.refresh();
52 + });
53 + }
54 }
55
56 #[bench]