Merge branch 'master' into patch-1

This commit is contained in:
Josh Holmer 2023-04-18 08:26:48 -04:00 committed by GitHub
commit 3c0cec88da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View file

@ -23,17 +23,19 @@ path = "src/main.rs"
required-features = ["binary"]
[dependencies]
itertools = "0.10.3"
zopfli = { version = "0.7.2", optional = true }
rgb = "0.8.33"
indexmap = "1.9.1"
libdeflater = "0.13.0"
log = "0.4.17"
stderrlog = { version = "0.5.3", optional = true, default-features = false }
crossbeam-channel = "0.5.6"
bitvec = "1.0.1"
rustc-hash = "1.1.0"
[dependencies.crossbeam-channel]
optional = true
version = "0.5.6"
[dependencies.filetime]
optional = true
version = "0.2.17"
@ -61,7 +63,7 @@ rustc_version = "0.4.0"
[features]
binary = ["clap", "wild", "stderrlog"]
default = ["binary", "filetime", "parallel", "zopfli"]
parallel = ["rayon", "indexmap/rayon"]
parallel = ["rayon", "indexmap/rayon", "crossbeam-channel"]
freestanding = ["libdeflater/freestanding"]
[lib]

View file

@ -4,6 +4,7 @@ use oxipng::{InFile, OutFile};
#[cfg(feature = "filetime")]
use std::cell::RefCell;
use std::fs::remove_file;
#[cfg(feature = "zopfli")]
use std::num::NonZeroU8;
#[cfg(feature = "filetime")]
use std::ops::Deref;
@ -95,9 +96,12 @@ fn test_it_converts(
#[test]
fn verbose_mode() {
#[cfg(feature = "parallel")]
use crossbeam_channel::{unbounded, Sender};
use log::{set_logger, set_max_level, Level, LevelFilter, Log, Metadata, Record};
use std::cell::RefCell;
#[cfg(not(feature = "parallel"))]
use std::sync::mpsc::{channel as unbounded, Sender};
// Rust runs tests in parallel by default.
// We want to make sure that we verify only logs from our test.
@ -169,7 +173,7 @@ fn verbose_mode() {
thread_exec();
});
let mut logs: Vec<_> = receiver.into_iter().collect();
let logs: Vec<_> = receiver.into_iter().collect();
println!("logs={:?}", logs);
assert_eq!(logs.len(), 9);
let expected_logs = [