Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use test_log::test to have env logging in all tests #80

Merged
merged 2 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ edition = "2021"
[features]
default = ["fft_resampler"]
fft_resampler = ["realfft", "num-complex"]
log = ["dep:log"]

[dependencies]
log = { version = "0.4.18", optional = true }
Expand All @@ -31,6 +32,7 @@ rand = "0.8.5"
num-traits = "0.2.15"
log = "0.4.18"
approx = "0.5.1"
test-log = "0.2.16"

[[bench]]
name = "resamplers"
Expand Down
1 change: 1 addition & 0 deletions src/asynchro_fast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,7 @@ mod tests {
use crate::{check_output, check_ratio};
use crate::{FastFixedIn, FastFixedOut};
use rand::Rng;
use test_log::test;

#[test]
fn make_resampler_fi() {
Expand Down
1 change: 1 addition & 0 deletions src/asynchro_sinc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,7 @@ mod tests {
use crate::{check_output, check_ratio};
use crate::{SincFixedIn, SincFixedOut};
use rand::Rng;
use test_log::test;

fn basic_params() -> SincInterpolationParameters {
SincInterpolationParameters {
Expand Down
1 change: 1 addition & 0 deletions src/interpolation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ mod tests {
use crate::interpolation::get_nearest_times_2;
use crate::interpolation::get_nearest_times_3;
use crate::interpolation::get_nearest_times_4;
use test_log::test;

#[test]
fn get_nearest_2() {
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,7 @@ pub mod tests {
use crate::{FastFixedIn, PolynomialDegree, SincFixedIn, SincFixedOut};
#[cfg(feature = "fft_resampler")]
use crate::{FftFixedIn, FftFixedInOut, FftFixedOut};
use test_log::test;

// This tests that a VecResampler can be boxed.
#[test]
Expand Down
1 change: 1 addition & 0 deletions src/sinc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ where
mod tests {
use crate::sinc::make_sincs;
use crate::WindowFunction;
use test_log::test;

#[test]
fn sincs() {
Expand Down
1 change: 1 addition & 0 deletions src/sinc_interpolator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ mod tests {
use crate::WindowFunction;
use num_traits::Float;
use rand::Rng;
use test_log::test;

fn get_sinc_interpolated<T: Float>(wave: &[T], index: usize, sinc: &[T]) -> T {
let wave_cut = &wave[index..(index + sinc.len())];
Expand Down
1 change: 1 addition & 0 deletions src/sinc_interpolator/sinc_interpolator_avx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ mod tests {
use crate::WindowFunction;
use num_traits::Float;
use rand::Rng;
use test_log::test;

fn get_sinc_interpolated<T: Float>(wave: &[T], index: usize, sinc: &[T]) -> T {
let wave_cut = &wave[index..(index + sinc.len())];
Expand Down
1 change: 1 addition & 0 deletions src/sinc_interpolator/sinc_interpolator_neon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ mod tests {
use crate::WindowFunction;
use num_traits::Float;
use rand::Rng;
use test_log::test;

fn get_sinc_interpolated<T: Float>(wave: &[T], index: usize, sinc: &[T]) -> T {
let wave_cut = &wave[index..(index + sinc.len())];
Expand Down
1 change: 1 addition & 0 deletions src/sinc_interpolator/sinc_interpolator_sse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ mod tests {
use crate::WindowFunction;
use num_traits::Float;
use rand::Rng;
use test_log::test;

fn get_sinc_interpolated<T: Float>(wave: &[T], index: usize, sinc: &[T]) -> T {
let wave_cut = &wave[index..(index + sinc.len())];
Expand Down
1 change: 1 addition & 0 deletions src/synchro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,7 @@ mod tests {
use crate::synchro::{FftFixedIn, FftFixedInOut, FftFixedOut, FftResampler};
use crate::Resampler;
use rand::Rng;
use test_log::test;

#[test]
fn resample_unit() {
Expand Down
1 change: 1 addition & 0 deletions src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ mod tests {
use crate::windows::make_window;
use crate::windows::WindowFunction;
use approx::assert_abs_diff_eq;
use test_log::test;

#[test]
fn test_blackman_harris() {
Expand Down