craft-psd: test-support is the name of the testgen feature, which stays as an alias (#1380)

This commit is contained in:
.CooCoo authored and GitHub committed 2026-11-16 21:36:00 -05:00
1 parent 20389ae46a
commit e62945a8da
5 files changed
+19 -6

No files matched your search

+5 -2
View File
@@ -12,7 +12,10 @@ repository.workspace = true
corpus = []
default = []
serde = ["dep:serde"]
testgen = []
# `fixtures` and `testgen`: test-data generators for the tests of crates that read PSD files.
test-support = []
# The former name of `test-support`.
testgen = ["test-support"]
[dependencies]
thiserror = { workspace = true }
@@ -26,7 +29,7 @@ rayon = { workspace = true }
[dev-dependencies]
proptest = { workspace = true }
craft-psd = { path = ".", features = ["testgen"] }
craft-psd = { path = ".", features = ["test-support"] }
[lints]
workspace = true
+1 -1
View File
@@ -127,7 +127,7 @@ builder.push_layer(LayerSpec) / begin_group(GroupSpec) / end_group()? / composit
builder.build() -> Result<PsdFile>; builder.to_bytes()
PixelData::{Rgba8, Rgba16, GrayA8, GrayA16, Cmyka8, Cmyka16} // CMYK given as ink, stored inverted
// Test generator (feature `testgen`)
// Test generator (feature `test-support`; `testgen` is an alias)
testgen::{all_cases, merged_only, layered, small, sample_descriptor, pattern_plane}
```
+1 -1
View File
@@ -1,6 +1,6 @@
//! Writes multi-gigabyte PSB files (and the 2 GB PSD) for large-file tests (photocraft#375, photocraft#216), straight
//! from the Adobe PSD spec and independent of this crate's writer, so the fixtures don't inherit
//! its limits. The generator is `craft_psd::fixtures` (feature `testgen`).
//! its limits. The generator is `craft_psd::fixtures` (feature `test-support`).
//!
//! `cargo run --release -p craft-psd --example big_psb -- <out dir> [case...]`
//!
+2 -2
View File
@@ -71,7 +71,7 @@ pub mod engine_data;
pub mod error;
pub mod file;
pub mod filter_effects;
#[cfg(any(test, feature = "testgen"))]
#[cfg(any(test, feature = "test-support"))]
pub mod fixtures;
pub mod flat;
pub mod float;
@@ -97,7 +97,7 @@ pub mod slices;
pub mod smart;
pub mod source;
pub mod tagged;
#[cfg(any(test, feature = "testgen"))]
#[cfg(any(test, feature = "test-support"))]
// Test-data generator (tests and fuzz seeds only): failing loudly is the point.
#[allow(clippy::expect_used)]
pub mod testgen;
+10
View File
@@ -22,3 +22,13 @@ fn corpus_dir(sub: &str) -> std::path::PathBuf {
.map_or_else(|| std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus"), std::path::PathBuf::from);
root.join(sub)
}
/// The self dev-dependency builds these tests with `test-support`, the feature that gates
/// `craft_psd::fixtures` and `craft_psd::testgen`.
#[test]
fn tests_build_with_the_test_support_feature() {
const { assert!(cfg!(feature = "test-support")) };
let file = craft_psd::testgen::small(craft_psd::Version::Psd, craft_psd::Compression::Raw);
assert_eq!(file.header.version, craft_psd::Version::Psd);
let _sample: fn(u32, u32, u32, bool) -> u8 = craft_psd::fixtures::sample;
}