Replaced the internal crate testing on the corresponding module in the tests directory (#48).

This commit is contained in:
Kirill Kuzminykh
2025-04-07 00:41:22 +03:00
parent f4e15602fe
commit babe8c4c55
24 changed files with 47 additions and 75 deletions
+2
View File
@@ -5,6 +5,8 @@
- Fixed error in `NEON` implementation of `MulDiv::multiply_alpha()` and
`MulDiv::multiply_alpha_inplace()` for `U8x2` pixels
([#49](https://github.com/Cykooz/fast_image_resize/issues/49)).
- Replaced the internal crate `testing` on the corresponding module in the `tests` directory
([#48](https://github.com/Cykooz/fast_image_resize/issues/48)).
## [5.1.2] - 2025-02-16
Generated
-9
View File
@@ -582,7 +582,6 @@ dependencies = [
"serde",
"serde_json",
"tera",
"testing",
"thiserror 1.0.69",
"walkdir",
]
@@ -1591,14 +1590,6 @@ dependencies = [
"unic-segment",
]
[[package]]
name = "testing"
version = "0.1.0"
dependencies = [
"fast_image_resize",
"image",
]
[[package]]
name = "thiserror"
version = "1.0.69"
+5 -6
View File
@@ -1,6 +1,5 @@
[workspace]
members = [
"testing",
"resizer",
]
@@ -16,7 +15,7 @@ readme = "README.md"
keywords = ["image", "resize"]
repository = "https://github.com/cykooz/fast_image_resize"
documentation = "https://docs.rs/crate/fast_image_resize"
exclude = ["/data"]
exclude = ["/data", "/.github"]
[dependencies]
@@ -29,6 +28,7 @@ image = { version = "0.25.5", optional = true, default-features = false }
bytemuck = { version = "1.21", optional = true }
rayon = { version = "1.10", optional = true }
[features]
## Enable this feature to implement traits [IntoImageView](crate::IntoImageView) and
## [IntoImageViewMut](crate::IntoImageViewMut) for the
@@ -36,9 +36,9 @@ rayon = { version = "1.10", optional = true }
## type from the `image` crate.
image = ["dep:image", "dep:bytemuck"]
## This feature enables image processing in `rayon` thread pool.
rayon = ["dep:rayon", "resize/rayon", "image/rayon", "testing/rayon"]
for_testing = ["image"]
only_u8x4 = ["testing/only_u8x4"] # This can be used to experiment with the crate's code.
rayon = ["dep:rayon", "resize/rayon", "image/rayon"]
for_testing = ["image", "image/png"]
only_u8x4 = [] # This can be used to experiment with the crate's code.
[dev-dependencies]
@@ -52,7 +52,6 @@ walkdir = "2.5"
itertools = "0.14.0"
criterion = { version = "0.5.1", default-features = false, features = ["cargo_bench_support"] }
tera = "1.20"
testing = { path = "testing" }
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
+3 -6
View File
@@ -1,10 +1,7 @@
use num_traits::ToBytes;
use fast_image_resize::images::Image;
use fast_image_resize::CpuExtensions;
use fast_image_resize::MulDiv;
use fast_image_resize::PixelType;
use testing::cpu_ext_into_str;
use fast_image_resize::{CpuExtensions, MulDiv, PixelType};
use num_traits::ToBytes;
use utils::testing::cpu_ext_into_str;
mod utils;
+2 -3
View File
@@ -1,9 +1,8 @@
use fast_image_resize::create_srgb_mapper;
use fast_image_resize::images::Image;
use fast_image_resize::pixels::U8x3;
use testing::PixelTestingExt;
use crate::utils::pin_process_to_cpu0;
use utils::pin_process_to_cpu0;
use utils::testing::PixelTestingExt;
mod utils;
+2 -3
View File
@@ -1,8 +1,7 @@
use fast_image_resize::pixels::U8;
use resize::Pixel::Gray8;
use rgb::FromSlice;
use fast_image_resize::pixels::U8;
use testing::PixelTestingExt;
use utils::testing::PixelTestingExt;
mod utils;
+2 -3
View File
@@ -1,8 +1,7 @@
use fast_image_resize::pixels::U16;
use resize::Pixel::Gray16;
use rgb::FromSlice;
use fast_image_resize::pixels::U16;
use testing::PixelTestingExt;
use utils::testing::PixelTestingExt;
mod utils;
+2 -3
View File
@@ -1,8 +1,7 @@
use fast_image_resize::pixels::F32;
use resize::Pixel::GrayF32;
use rgb::FromSlice;
use fast_image_resize::pixels::F32;
use testing::PixelTestingExt;
use utils::testing::PixelTestingExt;
mod utils;
+2 -3
View File
@@ -1,8 +1,7 @@
use fast_image_resize::pixels::U8x3;
use resize::Pixel::RGB8;
use rgb::FromSlice;
use fast_image_resize::pixels::U8x3;
use testing::PixelTestingExt;
use utils::testing::PixelTestingExt;
mod utils;
+2 -3
View File
@@ -1,8 +1,7 @@
use fast_image_resize::pixels::U16x3;
use resize::Pixel::RGB16;
use rgb::FromSlice;
use fast_image_resize::pixels::U16x3;
use testing::PixelTestingExt;
use utils::testing::PixelTestingExt;
mod utils;
+2 -3
View File
@@ -1,8 +1,7 @@
use fast_image_resize::pixels::F32x3;
use resize::Pixel::RGBF32;
use rgb::FromSlice;
use fast_image_resize::pixels::F32x3;
use testing::PixelTestingExt;
use utils::testing::PixelTestingExt;
mod utils;
+2 -3
View File
@@ -1,8 +1,7 @@
use fast_image_resize::pixels::U8x4;
use resize::Pixel::RGBA8P;
use rgb::FromSlice;
use fast_image_resize::pixels::U8x4;
use testing::PixelTestingExt;
use utils::testing::PixelTestingExt;
mod utils;
+2 -3
View File
@@ -1,8 +1,7 @@
use fast_image_resize::pixels::U16x4;
use resize::Pixel::RGBA16P;
use rgb::FromSlice;
use fast_image_resize::pixels::U16x4;
use testing::PixelTestingExt;
use utils::testing::PixelTestingExt;
mod utils;
+2 -3
View File
@@ -1,8 +1,7 @@
use fast_image_resize::images::Image;
use fast_image_resize::pixels::*;
use fast_image_resize::ResizeOptions;
use fast_image_resize::{CpuExtensions, FilterType, PixelType, ResizeAlg, Resizer};
use testing::{cpu_ext_into_str, PixelTestingExt};
use fast_image_resize::{CpuExtensions, FilterType, PixelType, ResizeAlg, ResizeOptions, Resizer};
use utils::testing::{cpu_ext_into_str, PixelTestingExt};
mod utils;
+2 -2
View File
@@ -2,15 +2,15 @@ use std::env;
use std::path::PathBuf;
use std::process::Command;
use serde::Deserialize;
pub use bencher::*;
pub use resize_functions::*;
pub use results::*;
use serde::Deserialize;
mod bencher;
mod resize_functions;
mod results;
pub mod testing;
const fn get_arch_id_and_name() -> (&'static str, &'static str) {
#[cfg(target_arch = "x86_64")]
+3 -4
View File
@@ -1,13 +1,12 @@
use std::ops::Deref;
use criterion::black_box;
use image::{imageops, ImageBuffer};
use fast_image_resize::images::Image;
use fast_image_resize::{CpuExtensions, FilterType, ResizeAlg, ResizeOptions, Resizer};
use testing::{cpu_ext_into_str, PixelTestingExt};
use image::{imageops, ImageBuffer};
use crate::utils::bencher::{bench, BenchGroup};
use super::bencher::{bench, BenchGroup};
use super::testing::{cpu_ext_into_str, PixelTestingExt};
const ALG_NAMES: [&str; 5] = ["Nearest", "Box", "Bilinear", "Bicubic", "Lanczos3"];
const NEW_WIDTH: u32 = 852;
+1
View File
@@ -0,0 +1 @@
../../tests/testing.rs
+4
View File
@@ -0,0 +1,4 @@
unstable_features = true
imports_granularity = "Module"
group_imports = "StdExternalCrate"
-18
View File
@@ -1,18 +0,0 @@
[package]
name = "testing"
version = "0.1.0"
edition = "2021"
[dependencies]
fast_image_resize = { path = "..", features = ["for_testing"] }
image = { version = "0.25.2", default-features = false, features = ["png"] }
[features]
only_u8x4 = [] # This can be used to experiment with the crate's code.
rayon = ["fast_image_resize/rayon", "image/rayon"]
[package.metadata.release]
publish = false
+1
View File
@@ -1,6 +1,7 @@
use fast_image_resize::images::{Image, TypedImage, TypedImageRef};
use fast_image_resize::{CpuExtensions, MulDiv, PixelTrait};
use testing::{cpu_ext_into_str, PixelTestingExt};
mod testing;
#[derive(Clone, Copy, PartialEq, Eq)]
enum Oper {
+2
View File
@@ -2,6 +2,8 @@ use fast_image_resize as fr;
use fast_image_resize::images::Image;
use fast_image_resize::pixels::*;
mod testing;
#[cfg(not(feature = "only_u8x4"))]
mod gamma_tests {
use super::*;
+2
View File
@@ -3,6 +3,8 @@ use fast_image_resize::pixels::U8;
use fast_image_resize::{ImageView, ImageViewMut};
use testing::non_zero_u32;
mod testing;
mod split_by_width {
use super::*;
use fast_image_resize::images::{TypedCroppedImage, TypedImageRef};
+2
View File
@@ -9,6 +9,8 @@ use fast_image_resize::{
};
use testing::{cpu_ext_into_str, image_checksum, save_result, PixelTestingExt};
mod testing;
fn get_new_height(src_image: &impl IntoImageView, new_width: u32) -> u32 {
let scale = new_width as f32 / src_image.width() as f32;
(src_image.height() as f32 * scale).round() as u32