From 702822a5fc9ea68a490b860693cc5be883a9e190 Mon Sep 17 00:00:00 2001 From: FredApps Date: Thu, 19 Nov 2026 12:56:29 +0100 Subject: [PATCH 01/22] Consolidate pcap integration tests --- .../tests/{ => it}/dns_discovery_answers.rs | 5 +---- .../pcap/tests/{ => it}/dns_question_class.rs | 5 +---- crates/pcap/tests/{ => it}/dns_rdata_names.rs | 5 +---- crates/pcap/tests/it/main.rs | 22 +++++++++++++++++++ .../tests/{ => it}/pcap_dns_name_limit.rs | 5 +---- .../tests/{ => it}/pcap_dns_txt_lengths.rs | 5 +---- .../tests/{ => it}/pcap_flow_time_range.rs | 5 +---- .../tests/{ => it}/pcap_http_host_boundary.rs | 5 +---- .../pcap/tests/{ => it}/pcap_http_methods.rs | 5 +---- .../pcap/tests/{ => it}/pcap_ipv4_lengths.rs | 5 +---- .../tests/{ => it}/pcap_ipv6_fragments.rs | 5 +---- .../{ => it}/pcap_ipv6_no_next_header.rs | 0 .../pcap/tests/{ => it}/pcap_ipv6_version.rs | 5 +---- crates/pcap/tests/{ => it}/pcap_tcp_ecn.rs | 0 .../tests/{ => it}/pcapng_simple_payload.rs | 5 +---- .../{ => it}/regression_pcapng_framing.rs | 5 +---- .../{ => it}/regression_tcp_dns_framing.rs | 5 +---- .../{ => it}/regression_tcp_header_length.rs | 5 +---- .../tests/{ => it}/regression_tls_bounds.rs | 5 +---- 19 files changed, 38 insertions(+), 64 deletions(-) rename crates/pcap/tests/{ => it}/dns_discovery_answers.rs (96%) rename crates/pcap/tests/{ => it}/dns_question_class.rs (95%) rename crates/pcap/tests/{ => it}/dns_rdata_names.rs (99%) create mode 100644 crates/pcap/tests/it/main.rs rename crates/pcap/tests/{ => it}/pcap_dns_name_limit.rs (98%) rename crates/pcap/tests/{ => it}/pcap_dns_txt_lengths.rs (99%) rename crates/pcap/tests/{ => it}/pcap_flow_time_range.rs (93%) rename crates/pcap/tests/{ => it}/pcap_http_host_boundary.rs (97%) rename crates/pcap/tests/{ => it}/pcap_http_methods.rs (94%) rename crates/pcap/tests/{ => it}/pcap_ipv4_lengths.rs (96%) rename crates/pcap/tests/{ => it}/pcap_ipv6_fragments.rs (95%) rename crates/pcap/tests/{ => it}/pcap_ipv6_no_next_header.rs (100%) rename crates/pcap/tests/{ => it}/pcap_ipv6_version.rs (95%) rename crates/pcap/tests/{ => it}/pcap_tcp_ecn.rs (100%) rename crates/pcap/tests/{ => it}/pcapng_simple_payload.rs (96%) rename crates/pcap/tests/{ => it}/regression_pcapng_framing.rs (97%) rename crates/pcap/tests/{ => it}/regression_tcp_dns_framing.rs (95%) rename crates/pcap/tests/{ => it}/regression_tcp_header_length.rs (96%) rename crates/pcap/tests/{ => it}/regression_tls_bounds.rs (98%) diff --git a/crates/pcap/tests/dns_discovery_answers.rs b/crates/pcap/tests/it/dns_discovery_answers.rs similarity index 96% rename from crates/pcap/tests/dns_discovery_answers.rs rename to crates/pcap/tests/it/dns_discovery_answers.rs index 97d9dc0dc..1465235e1 100644 --- a/crates/pcap/tests/dns_discovery_answers.rs +++ b/crates/pcap/tests/it/dns_discovery_answers.rs @@ -1,8 +1,5 @@ -#[path = "support/mod.rs"] -mod support; - +use super::support::{dns_query, eth, ipv4_pkt, udp}; use craft_pcap::{Dns, decode}; -use support::{dns_query, eth, ipv4_pkt, udp}; fn answer(kind: u16, rd: &[u8]) -> Dns { let mut msg = dns_query(); diff --git a/crates/pcap/tests/dns_question_class.rs b/crates/pcap/tests/it/dns_question_class.rs similarity index 95% rename from crates/pcap/tests/dns_question_class.rs rename to crates/pcap/tests/it/dns_question_class.rs index b6583f7f3..baf748997 100644 --- a/crates/pcap/tests/dns_question_class.rs +++ b/crates/pcap/tests/it/dns_question_class.rs @@ -1,8 +1,5 @@ -#[path = "support/mod.rs"] -mod support; - +use super::support::{dns_query, eth, ipv4_pkt, pcap, udp}; use craft_pcap::{decode, summarize}; -use support::{dns_query, eth, ipv4_pkt, pcap, udp}; fn packet(message: &[u8]) -> Vec { eth(0x0800, &ipv4_pkt(17, [192, 0, 2, 1], [192, 0, 2, 2], &udp(51000, 53, message))) diff --git a/crates/pcap/tests/dns_rdata_names.rs b/crates/pcap/tests/it/dns_rdata_names.rs similarity index 99% rename from crates/pcap/tests/dns_rdata_names.rs rename to crates/pcap/tests/it/dns_rdata_names.rs index 7e8542a0a..3b87c4dd5 100644 --- a/crates/pcap/tests/dns_rdata_names.rs +++ b/crates/pcap/tests/it/dns_rdata_names.rs @@ -1,8 +1,5 @@ -#[path = "support/mod.rs"] -mod support; - +use super::support::{dns_query, eth, ipv4_pkt, pcap, udp}; use craft_pcap::{decode, summarize}; -use support::{dns_query, eth, ipv4_pkt, pcap, udp}; fn response(record_type: u16, rdata: &[u8], declared_length: usize) -> Vec { let mut message = dns_query(); diff --git a/crates/pcap/tests/it/main.rs b/crates/pcap/tests/it/main.rs new file mode 100644 index 000000000..cb3173b34 --- /dev/null +++ b/crates/pcap/tests/it/main.rs @@ -0,0 +1,22 @@ +//! Integration tests for craft-pcap. + +mod dns_discovery_answers; +mod dns_question_class; +mod dns_rdata_names; +mod pcap_dns_name_limit; +mod pcap_dns_txt_lengths; +mod pcap_flow_time_range; +mod pcap_http_host_boundary; +mod pcap_http_methods; +mod pcap_ipv4_lengths; +mod pcap_ipv6_fragments; +mod pcap_ipv6_no_next_header; +mod pcap_ipv6_version; +mod pcap_tcp_ecn; +mod pcapng_simple_payload; +mod regression_pcapng_framing; +mod regression_tcp_dns_framing; +mod regression_tcp_header_length; +mod regression_tls_bounds; +#[path = "../support/mod.rs"] +mod support; diff --git a/crates/pcap/tests/pcap_dns_name_limit.rs b/crates/pcap/tests/it/pcap_dns_name_limit.rs similarity index 98% rename from crates/pcap/tests/pcap_dns_name_limit.rs rename to crates/pcap/tests/it/pcap_dns_name_limit.rs index 82fc4e9f0..e1d77febf 100644 --- a/crates/pcap/tests/pcap_dns_name_limit.rs +++ b/crates/pcap/tests/it/pcap_dns_name_limit.rs @@ -1,8 +1,5 @@ -#[path = "support/mod.rs"] -mod support; - +use super::support::{ipv4_pkt, udp}; use craft_pcap::{Dns, decode}; -use support::{ipv4_pkt, udp}; fn query(last: usize, compressed: bool) -> Dns { let mut msg = vec![0, 1, 1, 0, 0, if compressed { 2 } else { 1 }, 0, 0, 0, 0, 0, 0]; diff --git a/crates/pcap/tests/pcap_dns_txt_lengths.rs b/crates/pcap/tests/it/pcap_dns_txt_lengths.rs similarity index 99% rename from crates/pcap/tests/pcap_dns_txt_lengths.rs rename to crates/pcap/tests/it/pcap_dns_txt_lengths.rs index 56312df41..76d7dc7e7 100644 --- a/crates/pcap/tests/pcap_dns_txt_lengths.rs +++ b/crates/pcap/tests/it/pcap_dns_txt_lengths.rs @@ -1,8 +1,5 @@ -#[path = "support/mod.rs"] -mod support; - +use super::support::{ipv4_pkt, udp}; use craft_pcap::{Dns, decode}; -use support::{ipv4_pkt, udp}; fn response(data: &[u8]) -> Dns { let mut msg = vec![0, 1, 0x81, 0x80, 0, 0, 0, 1, 0, 0, 0, 0]; diff --git a/crates/pcap/tests/pcap_flow_time_range.rs b/crates/pcap/tests/it/pcap_flow_time_range.rs similarity index 93% rename from crates/pcap/tests/pcap_flow_time_range.rs rename to crates/pcap/tests/it/pcap_flow_time_range.rs index 722121f4b..bd1009c29 100644 --- a/crates/pcap/tests/pcap_flow_time_range.rs +++ b/crates/pcap/tests/it/pcap_flow_time_range.rs @@ -1,8 +1,5 @@ -#[path = "support/mod.rs"] -mod support; - +use super::support::{block, eth, ipv4_pkt, pcap, pcapng, udp}; use craft_pcap::summarize; -use support::{block, eth, ipv4_pkt, pcap, pcapng, udp}; fn frame() -> Vec { eth(0x0800, &ipv4_pkt(17, [1; 4], [2; 4], &udp(100, 200, b"body"))) diff --git a/crates/pcap/tests/pcap_http_host_boundary.rs b/crates/pcap/tests/it/pcap_http_host_boundary.rs similarity index 97% rename from crates/pcap/tests/pcap_http_host_boundary.rs rename to crates/pcap/tests/it/pcap_http_host_boundary.rs index 5baa58fee..494661cac 100644 --- a/crates/pcap/tests/pcap_http_host_boundary.rs +++ b/crates/pcap/tests/it/pcap_http_host_boundary.rs @@ -1,8 +1,5 @@ -#[path = "support/mod.rs"] -mod support; - +use super::support::{ipv4_pkt, tcp}; use craft_pcap::{Http, decode}; -use support::{ipv4_pkt, tcp}; fn request(data: &[u8]) -> Http { decode(101, &ipv4_pkt(6, [1; 4], [2; 4], &tcp(100, 80, 0x18, data))).http.unwrap() diff --git a/crates/pcap/tests/pcap_http_methods.rs b/crates/pcap/tests/it/pcap_http_methods.rs similarity index 94% rename from crates/pcap/tests/pcap_http_methods.rs rename to crates/pcap/tests/it/pcap_http_methods.rs index 57eb4e548..b5e60f559 100644 --- a/crates/pcap/tests/pcap_http_methods.rs +++ b/crates/pcap/tests/it/pcap_http_methods.rs @@ -1,8 +1,5 @@ -#[path = "support/mod.rs"] -mod support; - +use super::support::{ipv4_pkt, tcp}; use craft_pcap::decode; -use support::{ipv4_pkt, tcp}; /// WebDAV and extension methods retain the same HTTP evidence as core methods. #[test] diff --git a/crates/pcap/tests/pcap_ipv4_lengths.rs b/crates/pcap/tests/it/pcap_ipv4_lengths.rs similarity index 96% rename from crates/pcap/tests/pcap_ipv4_lengths.rs rename to crates/pcap/tests/it/pcap_ipv4_lengths.rs index e1ea930a0..665de6c11 100644 --- a/crates/pcap/tests/pcap_ipv4_lengths.rs +++ b/crates/pcap/tests/it/pcap_ipv4_lengths.rs @@ -1,8 +1,5 @@ -#[path = "support/mod.rs"] -mod support; - +use super::support::{ipv4_pkt, udp}; use craft_pcap::decode; -use support::{ipv4_pkt, udp}; #[test] fn incomplete_ipv4_base_headers_explain_why_decoding_stopped() { diff --git a/crates/pcap/tests/pcap_ipv6_fragments.rs b/crates/pcap/tests/it/pcap_ipv6_fragments.rs similarity index 95% rename from crates/pcap/tests/pcap_ipv6_fragments.rs rename to crates/pcap/tests/it/pcap_ipv6_fragments.rs index 1c413f4b3..68d5a045b 100644 --- a/crates/pcap/tests/pcap_ipv6_fragments.rs +++ b/crates/pcap/tests/it/pcap_ipv6_fragments.rs @@ -1,8 +1,5 @@ -#[path = "support/mod.rs"] -mod support; - +use super::support::{eth, udp}; use craft_pcap::decode; -use support::{eth, udp}; fn packet(offset: u16, next: u8, payload: &[u8]) -> Vec { let mut ip = vec![0u8; 40]; diff --git a/crates/pcap/tests/pcap_ipv6_no_next_header.rs b/crates/pcap/tests/it/pcap_ipv6_no_next_header.rs similarity index 100% rename from crates/pcap/tests/pcap_ipv6_no_next_header.rs rename to crates/pcap/tests/it/pcap_ipv6_no_next_header.rs diff --git a/crates/pcap/tests/pcap_ipv6_version.rs b/crates/pcap/tests/it/pcap_ipv6_version.rs similarity index 95% rename from crates/pcap/tests/pcap_ipv6_version.rs rename to crates/pcap/tests/it/pcap_ipv6_version.rs index f69766321..ee24503c2 100644 --- a/crates/pcap/tests/pcap_ipv6_version.rs +++ b/crates/pcap/tests/it/pcap_ipv6_version.rs @@ -1,8 +1,5 @@ -#[path = "support/mod.rs"] -mod support; - +use super::support::{eth, ipv4_pkt}; use craft_pcap::decode; -use support::{eth, ipv4_pkt}; fn raw_packets() -> (Vec, Vec) { let ipv4 = ipv4_pkt(17, [1; 4], [2; 4], &[0; 20]); diff --git a/crates/pcap/tests/pcap_tcp_ecn.rs b/crates/pcap/tests/it/pcap_tcp_ecn.rs similarity index 100% rename from crates/pcap/tests/pcap_tcp_ecn.rs rename to crates/pcap/tests/it/pcap_tcp_ecn.rs diff --git a/crates/pcap/tests/pcapng_simple_payload.rs b/crates/pcap/tests/it/pcapng_simple_payload.rs similarity index 96% rename from crates/pcap/tests/pcapng_simple_payload.rs rename to crates/pcap/tests/it/pcapng_simple_payload.rs index ee4743020..c045e5eaa 100644 --- a/crates/pcap/tests/pcapng_simple_payload.rs +++ b/crates/pcap/tests/it/pcapng_simple_payload.rs @@ -1,8 +1,5 @@ -#[path = "support/mod.rs"] -mod support; - +use super::support::{block, pcapng}; use craft_pcap::Capture; -use support::{block, pcapng}; fn capture(original: u32, snaplen: u32, payload: &[u8]) -> Vec { let mut out = pcapng(&[]); diff --git a/crates/pcap/tests/regression_pcapng_framing.rs b/crates/pcap/tests/it/regression_pcapng_framing.rs similarity index 97% rename from crates/pcap/tests/regression_pcapng_framing.rs rename to crates/pcap/tests/it/regression_pcapng_framing.rs index 1ba8d2878..8c78905c3 100644 --- a/crates/pcap/tests/regression_pcapng_framing.rs +++ b/crates/pcap/tests/it/regression_pcapng_framing.rs @@ -1,8 +1,5 @@ -#[path = "support/mod.rs"] -mod support; - +use super::support::{block, pcapng, sample_frames}; use craft_pcap::summarize; -use support::{block, pcapng, sample_frames}; #[test] fn mismatched_block_footers_stop_the_capture_with_a_warning() { diff --git a/crates/pcap/tests/regression_tcp_dns_framing.rs b/crates/pcap/tests/it/regression_tcp_dns_framing.rs similarity index 95% rename from crates/pcap/tests/regression_tcp_dns_framing.rs rename to crates/pcap/tests/it/regression_tcp_dns_framing.rs index e85c987aa..951c1e5d7 100644 --- a/crates/pcap/tests/regression_tcp_dns_framing.rs +++ b/crates/pcap/tests/it/regression_tcp_dns_framing.rs @@ -1,8 +1,5 @@ -#[path = "support/mod.rs"] -mod support; - +use super::support::{dns_query, dns_response, ipv4_pkt, tcp}; use craft_pcap::{Decoded, decode}; -use support::{dns_query, dns_response, ipv4_pkt, tcp}; fn decoded(payload: &[u8]) -> Decoded { decode(101, &ipv4_pkt(6, [192, 0, 2, 1], [192, 0, 2, 2], &tcp(53, 51000, 0x18, payload))) diff --git a/crates/pcap/tests/regression_tcp_header_length.rs b/crates/pcap/tests/it/regression_tcp_header_length.rs similarity index 96% rename from crates/pcap/tests/regression_tcp_header_length.rs rename to crates/pcap/tests/it/regression_tcp_header_length.rs index d931f97b2..3ffef2b54 100644 --- a/crates/pcap/tests/regression_tcp_header_length.rs +++ b/crates/pcap/tests/it/regression_tcp_header_length.rs @@ -1,8 +1,5 @@ -#[path = "support/mod.rs"] -mod support; - +use super::support::{ipv4_pkt, tcp}; use craft_pcap::{Decoded, decode}; -use support::{ipv4_pkt, tcp}; fn decoded(segment: &[u8]) -> Decoded { decode(101, &ipv4_pkt(6, [192, 0, 2, 1], [192, 0, 2, 2], segment)) diff --git a/crates/pcap/tests/regression_tls_bounds.rs b/crates/pcap/tests/it/regression_tls_bounds.rs similarity index 98% rename from crates/pcap/tests/regression_tls_bounds.rs rename to crates/pcap/tests/it/regression_tls_bounds.rs index 92a710fc4..7306c11c8 100644 --- a/crates/pcap/tests/regression_tls_bounds.rs +++ b/crates/pcap/tests/it/regression_tls_bounds.rs @@ -1,8 +1,5 @@ -#[path = "support/mod.rs"] -mod support; - +use super::support::{client_hello, ipv4_pkt, tcp}; use craft_pcap::{Decoded, decode}; -use support::{client_hello, ipv4_pkt, tcp}; fn decoded(record: &[u8]) -> Decoded { decode(101, &ipv4_pkt(6, [192, 0, 2, 1], [192, 0, 2, 2], &tcp(51000, 443, 0x18, record))) From af2b8cfe05af0759c04d035043f1a55a2fb6021e Mon Sep 17 00:00:00 2001 From: FredApps Date: Thu, 19 Nov 2026 12:56:43 +0100 Subject: [PATCH 02/22] Consolidate video integration tests --- .config/nextest.toml | 2 +- crates/video/Cargo.toml | 73 +------------------ crates/video/src/apv/README.md | 4 +- crates/video/src/dnx/README.md | 6 +- crates/video/src/ffv1/README.md | 2 +- crates/video/src/mpeg2/README.md | 6 +- crates/video/src/mpeg2/encode/tests.rs | 2 +- crates/video/src/mpeg2/synth_tests.rs | 4 +- crates/video/src/mpeg2/tests.rs | 2 +- crates/video/src/prores/README.md | 2 +- crates/video/tests/{ => it}/apv/alpha.rs | 0 crates/video/tests/{ => it}/apv/budget.rs | 0 crates/video/tests/{ => it}/apv/fuzz.rs | 0 .../video/tests/{ => it}/apv/fuzz_hostile.rs | 0 .../video/tests/{ => it}/apv/hostile_args.rs | 0 crates/video/tests/{ => it}/apv/main.rs | 0 crates/video/tests/{ => it}/apv/oracle.rs | 0 crates/video/tests/{ => it}/av1/main.rs | 0 .../video/tests/{ => it}/av1_decode/adhoc.rs | 2 +- .../tests/{ => it}/av1_decode/common/mod.rs | 0 .../tests/{ => it}/av1_decode/conformance.rs | 2 +- .../tests/{ => it}/av1_decode/fuzz_hostile.rs | 0 .../tests/{ => it}/av1_decode/hostile_dims.rs | 0 .../video/tests/{ => it}/av1_decode/main.rs | 0 .../tests/{ => it}/av1_decode/oracle_inter.rs | 2 +- .../tests/{ => it}/av1_decode/oracle_intra.rs | 2 +- .../video/tests/{ => it}/av1_decode/perf.rs | 2 +- .../tests/{ => it}/av1_decode/wavefront.rs | 2 +- crates/video/tests/{ => it}/dnx/common/mod.rs | 0 .../video/tests/{ => it}/dnx/fuzz_hostile.rs | 0 crates/video/tests/{ => it}/dnx/main.rs | 0 .../video/tests/{ => it}/dnx/oracle_decode.rs | 2 +- .../video/tests/{ => it}/dnx/oracle_encode.rs | 2 +- crates/video/tests/{ => it}/dnx/perf.rs | 0 crates/video/tests/{ => it}/dnx/roundtrip.rs | 0 crates/video/tests/{ => it}/ffv1.rs | 0 .../tests/{ => it}/h264_decode/common/mod.rs | 0 .../tests/{ => it}/h264_decode/conformance.rs | 2 +- .../{ => it}/h264_decode/fuzz_hostile.rs | 2 +- .../tests/{ => it}/h264_decode/headers.rs | 2 +- .../video/tests/{ => it}/h264_decode/main.rs | 0 .../video/tests/{ => it}/h264_decode/perf.rs | 2 +- .../{ => it}/h264_decode/pps_validation.rs | 0 .../tests/{ => it}/h264_decode/robustness.rs | 2 +- .../tests/{ => it}/h264_encode/common/mod.rs | 0 .../h264_encode/crf_level_and_note.rs | 2 +- .../{ => it}/h264_encode/ffmpeg_oracle.rs | 2 +- .../{ => it}/h264_encode/high10_oracle.rs | 2 +- .../video/tests/{ => it}/h264_encode/main.rs | 0 .../{ => it}/h264_encode/pinned_decisions.rs | 2 +- .../{ => it}/h264_encode/thread_count.rs | 2 +- .../{ => it}/h264_encode/vbr_overshoot.rs | 2 +- crates/video/tests/{ => it}/hap.rs | 0 crates/video/tests/{ => it}/hevc/main.rs | 0 .../tests/{ => it}/hevc_decode/common/mod.rs | 0 .../tests/{ => it}/hevc_decode/conformance.rs | 2 +- .../{ => it}/hevc_decode/fuzz_hostile.rs | 2 +- .../video/tests/{ => it}/hevc_decode/main.rs | 0 .../video/tests/{ => it}/hevc_decode/perf.rs | 2 +- .../tests/{ => it}/hevc_decode/robustness.rs | 2 +- crates/video/tests/it/main.rs | 73 +++++++++++++++++++ crates/video/tests/{ => it}/mjpeg.rs | 0 .../video/tests/{ => it}/mpeg2/common/mod.rs | 0 crates/video/tests/{ => it}/mpeg2/encode.rs | 4 +- .../tests/{ => it}/mpeg2/fuzz_hostile.rs | 2 +- .../tests/{ => it}/mpeg2/hostile_dims.rs | 0 crates/video/tests/{ => it}/mpeg2/main.rs | 0 crates/video/tests/{ => it}/mpeg2/oracle.rs | 2 +- crates/video/tests/{ => it}/mpeg2/perf.rs | 4 +- .../video/tests/{ => it}/mpeg4_encode/main.rs | 0 .../video/tests/{ => it}/prores/common/mod.rs | 0 crates/video/tests/{ => it}/prores/fuzz.rs | 2 +- .../tests/{ => it}/prores/fuzz_hostile.rs | 0 crates/video/tests/{ => it}/prores/main.rs | 0 .../tests/{ => it}/prores/oracle_decode.rs | 2 +- .../tests/{ => it}/prores/oracle_encode.rs | 2 +- crates/video/tests/{ => it}/prores/perf.rs | 2 +- .../video/tests/{ => it}/prores/roundtrip.rs | 2 +- crates/video/tests/{ => it}/vmd/main.rs | 0 crates/video/tests/{ => it}/vp8/common/mod.rs | 0 .../video/tests/{ => it}/vp8/conformance.rs | 2 +- .../video/tests/{ => it}/vp8/fuzz_hostile.rs | 0 crates/video/tests/{ => it}/vp8/main.rs | 0 crates/video/tests/{ => it}/vp8/robustness.rs | 2 +- crates/video/tests/{ => it}/vp8/vectors.rs | 2 +- .../video/tests/{ => it}/vp8_encode/main.rs | 0 .../tests/{ => it}/vp9_decode/common/mod.rs | 0 .../tests/{ => it}/vp9_decode/conformance.rs | 2 +- .../video/tests/{ => it}/vp9_decode/frame.rs | 2 +- .../tests/{ => it}/vp9_decode/fuzz_hostile.rs | 0 .../video/tests/{ => it}/vp9_decode/main.rs | 0 .../video/tests/{ => it}/vp9_decode/perf.rs | 2 +- .../tests/{ => it}/vp9_decode/robustness.rs | 2 +- .../tests/{ => it}/vp9_decode/synthetic.rs | 2 +- 94 files changed, 133 insertions(+), 127 deletions(-) rename crates/video/tests/{ => it}/apv/alpha.rs (100%) rename crates/video/tests/{ => it}/apv/budget.rs (100%) rename crates/video/tests/{ => it}/apv/fuzz.rs (100%) rename crates/video/tests/{ => it}/apv/fuzz_hostile.rs (100%) rename crates/video/tests/{ => it}/apv/hostile_args.rs (100%) rename crates/video/tests/{ => it}/apv/main.rs (100%) rename crates/video/tests/{ => it}/apv/oracle.rs (100%) rename crates/video/tests/{ => it}/av1/main.rs (100%) rename crates/video/tests/{ => it}/av1_decode/adhoc.rs (98%) rename crates/video/tests/{ => it}/av1_decode/common/mod.rs (100%) rename crates/video/tests/{ => it}/av1_decode/conformance.rs (99%) rename crates/video/tests/{ => it}/av1_decode/fuzz_hostile.rs (100%) rename crates/video/tests/{ => it}/av1_decode/hostile_dims.rs (100%) rename crates/video/tests/{ => it}/av1_decode/main.rs (100%) rename crates/video/tests/{ => it}/av1_decode/oracle_inter.rs (99%) rename crates/video/tests/{ => it}/av1_decode/oracle_intra.rs (99%) rename crates/video/tests/{ => it}/av1_decode/perf.rs (99%) rename crates/video/tests/{ => it}/av1_decode/wavefront.rs (99%) rename crates/video/tests/{ => it}/dnx/common/mod.rs (100%) rename crates/video/tests/{ => it}/dnx/fuzz_hostile.rs (100%) rename crates/video/tests/{ => it}/dnx/main.rs (100%) rename crates/video/tests/{ => it}/dnx/oracle_decode.rs (99%) rename crates/video/tests/{ => it}/dnx/oracle_encode.rs (99%) rename crates/video/tests/{ => it}/dnx/perf.rs (100%) rename crates/video/tests/{ => it}/dnx/roundtrip.rs (100%) rename crates/video/tests/{ => it}/ffv1.rs (100%) rename crates/video/tests/{ => it}/h264_decode/common/mod.rs (100%) rename crates/video/tests/{ => it}/h264_decode/conformance.rs (99%) rename crates/video/tests/{ => it}/h264_decode/fuzz_hostile.rs (99%) rename crates/video/tests/{ => it}/h264_decode/headers.rs (99%) rename crates/video/tests/{ => it}/h264_decode/main.rs (100%) rename crates/video/tests/{ => it}/h264_decode/perf.rs (98%) rename crates/video/tests/{ => it}/h264_decode/pps_validation.rs (100%) rename crates/video/tests/{ => it}/h264_decode/robustness.rs (99%) rename crates/video/tests/{ => it}/h264_encode/common/mod.rs (100%) rename crates/video/tests/{ => it}/h264_encode/crf_level_and_note.rs (99%) rename crates/video/tests/{ => it}/h264_encode/ffmpeg_oracle.rs (99%) rename crates/video/tests/{ => it}/h264_encode/high10_oracle.rs (99%) rename crates/video/tests/{ => it}/h264_encode/main.rs (100%) rename crates/video/tests/{ => it}/h264_encode/pinned_decisions.rs (98%) rename crates/video/tests/{ => it}/h264_encode/thread_count.rs (98%) rename crates/video/tests/{ => it}/h264_encode/vbr_overshoot.rs (99%) rename crates/video/tests/{ => it}/hap.rs (100%) rename crates/video/tests/{ => it}/hevc/main.rs (100%) rename crates/video/tests/{ => it}/hevc_decode/common/mod.rs (100%) rename crates/video/tests/{ => it}/hevc_decode/conformance.rs (99%) rename crates/video/tests/{ => it}/hevc_decode/fuzz_hostile.rs (99%) rename crates/video/tests/{ => it}/hevc_decode/main.rs (100%) rename crates/video/tests/{ => it}/hevc_decode/perf.rs (98%) rename crates/video/tests/{ => it}/hevc_decode/robustness.rs (99%) create mode 100644 crates/video/tests/it/main.rs rename crates/video/tests/{ => it}/mjpeg.rs (100%) rename crates/video/tests/{ => it}/mpeg2/common/mod.rs (100%) rename crates/video/tests/{ => it}/mpeg2/encode.rs (99%) rename crates/video/tests/{ => it}/mpeg2/fuzz_hostile.rs (99%) rename crates/video/tests/{ => it}/mpeg2/hostile_dims.rs (100%) rename crates/video/tests/{ => it}/mpeg2/main.rs (100%) rename crates/video/tests/{ => it}/mpeg2/oracle.rs (99%) rename crates/video/tests/{ => it}/mpeg2/perf.rs (90%) rename crates/video/tests/{ => it}/mpeg4_encode/main.rs (100%) rename crates/video/tests/{ => it}/prores/common/mod.rs (100%) rename crates/video/tests/{ => it}/prores/fuzz.rs (99%) rename crates/video/tests/{ => it}/prores/fuzz_hostile.rs (100%) rename crates/video/tests/{ => it}/prores/main.rs (100%) rename crates/video/tests/{ => it}/prores/oracle_decode.rs (99%) rename crates/video/tests/{ => it}/prores/oracle_encode.rs (99%) rename crates/video/tests/{ => it}/prores/perf.rs (99%) rename crates/video/tests/{ => it}/prores/roundtrip.rs (99%) rename crates/video/tests/{ => it}/vmd/main.rs (100%) rename crates/video/tests/{ => it}/vp8/common/mod.rs (100%) rename crates/video/tests/{ => it}/vp8/conformance.rs (99%) rename crates/video/tests/{ => it}/vp8/fuzz_hostile.rs (100%) rename crates/video/tests/{ => it}/vp8/main.rs (100%) rename crates/video/tests/{ => it}/vp8/robustness.rs (99%) rename crates/video/tests/{ => it}/vp8/vectors.rs (99%) rename crates/video/tests/{ => it}/vp8_encode/main.rs (100%) rename crates/video/tests/{ => it}/vp9_decode/common/mod.rs (100%) rename crates/video/tests/{ => it}/vp9_decode/conformance.rs (99%) rename crates/video/tests/{ => it}/vp9_decode/frame.rs (99%) rename crates/video/tests/{ => it}/vp9_decode/fuzz_hostile.rs (100%) rename crates/video/tests/{ => it}/vp9_decode/main.rs (100%) rename crates/video/tests/{ => it}/vp9_decode/perf.rs (98%) rename crates/video/tests/{ => it}/vp9_decode/robustness.rs (99%) rename crates/video/tests/{ => it}/vp9_decode/synthetic.rs (99%) diff --git a/.config/nextest.toml b/.config/nextest.toml index fd2a37223..17eb6c07b 100644 --- a/.config/nextest.toml +++ b/.config/nextest.toml @@ -26,7 +26,7 @@ print = { max-threads = 1 } video-integration = { max-threads = 1 } [[profile.default.overrides]] -filter = 'package(craft-video) & binary(h264_decode)' +filter = 'package(craft-video) & binary(it) & test(/^h264_decode::/)' test-group = 'video-fixtures' [[profile.default.overrides]] diff --git a/crates/video/Cargo.toml b/crates/video/Cargo.toml index 14cc8b77a..026e6ae89 100644 --- a/crates/video/Cargo.toml +++ b/crates/video/Cargo.toml @@ -1,4 +1,5 @@ [package] +autotests = false name = "craft-video" description = "Clean-room pure-Rust video codecs, one feature per codec: DNxHD/DNxHR, VP8, ProRes, H.264, HEVC, VP9, AV1, MPEG-4 Part 2, Sierra VMD." version.workspace = true @@ -83,30 +84,6 @@ craft-media-testkit = { workspace = true } # The AVI muxer, for the MPEG-4 Part 2 encoder's end-to-end test, and the VMD demuxer for the VMD decoder's. craft-media = { workspace = true, features = ["avi", "vmd"] } -[[test]] -name = "vmd" -required-features = ["vmd-decode"] - -[[test]] -name = "hap" -required-features = ["hap"] - -[[test]] -name = "mjpeg" -required-features = ["mjpeg"] - -[[test]] -name = "dnx" -required-features = ["dnx"] - -[[test]] -name = "apv" -required-features = ["apv"] - -[[test]] -name = "vp8" -required-features = ["vp8-decode"] - [[example]] name = "vp8_fuzz" required-features = ["vp8-decode"] @@ -115,22 +92,10 @@ required-features = ["vp8-decode"] name = "vp8_vp8dec" required-features = ["vp8-decode"] -[[test]] -name = "av1_decode" -required-features = ["av1-decode"] - [[example]] name = "av1_av1dec" required-features = ["av1-decode"] -[[test]] -name = "h264_decode" -required-features = ["h264-decode"] - -[[test]] -name = "h264_encode" -required-features = ["h264-encode"] - [[example]] name = "h264_h264dec" required-features = ["h264-decode"] @@ -140,46 +105,14 @@ name = "h264_h264enc_bench" required-features = ["h264-encode"] test = true -[[test]] -name = "hevc_decode" -required-features = ["hevc-decode"] - [[example]] name = "hevc_hevcdec" required-features = ["hevc-decode"] -[[test]] -name = "vp8_encode" -required-features = ["vp8"] - -[[test]] -name = "vp9_decode" -required-features = ["vp9-decode"] - [[example]] name = "vp9_vp9dec" required-features = ["vp9-decode"] [[test]] -name = "mpeg4_encode" -required-features = ["mpeg4-encode"] - -[[test]] -name = "mpeg2" -required-features = ["mpeg2-decode"] - -[[test]] -name = "ffv1" -required-features = ["ffv1"] - -[[test]] -name = "prores" -required-features = ["prores"] - -[[test]] -name = "hevc" -required-features = ["hevc-encode"] - -[[test]] -name = "av1" -required-features = ["av1"] +name = "it" +path = "tests/it/main.rs" diff --git a/crates/video/src/apv/README.md b/crates/video/src/apv/README.md index 380660c2e..7f7b8af64 100644 --- a/crates/video/src/apv/README.md +++ b/crates/video/src/apv/README.md @@ -56,7 +56,7 @@ let apvc: Vec = enc.decoder_config_record(); // APVDecoderConfigurationReco - **Metadata (§8)**: Parses `metadata_mdcv` (`payloadType == 5`, Mastering Display Color Volume) and `metadata_cll` (`payloadType == 6`, Content Light-Level Information). - **Robustness (§10)**: All size fields, tile coordinates, VLC codeword lengths, and coefficient - ranges (`-32768..=32767`) are checked before allocation or shift. Verified by `tests/apv/fuzz.rs` + ranges (`-32768..=32767`) are checked before allocation or shift. Verified by `tests/it/apv/fuzz.rs` across thousands of mutated and random inputs. - **Memory budget**: the samples of one access unit (the decoded tiles and the frame assembled from them, plus the same for an auxiliary alpha frame) must fit `DecodeOptions::memory_budget` @@ -74,7 +74,7 @@ let apvc: Vec = enc.decoder_config_record(); // APVDecoderConfigurationReco ## Accuracy (vs FFmpeg as an External Oracle) -`tests/apv/oracle.rs` encodes synthetic test patterns across all 7 profiles, odd dimensions, multiple +`tests/it/apv/oracle.rs` encodes synthetic test patterns across all 7 profiles, odd dimensions, multiple tiles, custom asymmetric quantization matrices, and HDR metadata PBUs, then decodes the resulting `.apv` streams with `ffmpeg -v error -xerror -f apv` and compares against `craft_video::apv::decode_frame`. Because APV specifies an exact integer inverse transform, **the decoder is 100% bit-exact diff --git a/crates/video/src/dnx/README.md b/crates/video/src/dnx/README.md index a7a4c152c..78072b1db 100644 --- a/crates/video/src/dnx/README.md +++ b/crates/video/src/dnx/README.md @@ -70,7 +70,7 @@ first frame header to label the stream. 12-bit coefficient domain is ¼ of the orthonormal DCT, as Table 14's 13-bit IDCT input range for 12-bit samples implies) and 1 otherwise. - Robustness: every offset and size is validated, run lengths past coefficient 63 are rejected, - and corrupted or truncated streams return `Err` without panicking ([`fuzz_hostile.rs`](../../tests/dnx/fuzz_hostile.rs)). + and corrupted or truncated streams return `Err` without panicking ([`fuzz_hostile.rs`](../../tests/it/dnx/fuzz_hostile.rs)). ### Where we follow ffmpeg rather than the letter of the standard @@ -111,7 +111,7 @@ the prose of §7.3.1.2; we follow the prose (normative text takes precedence). ## Accuracy (vs ffmpeg as an external oracle) -[`oracle_decode.rs`](../../tests/dnx/oracle_decode.rs) decodes 22 fixtures made by ffmpeg's VC-3 encoder: CIDs 1235, 1237, +[`oracle_decode.rs`](../../tests/it/dnx/oracle_decode.rs) decodes 22 fixtures made by ffmpeg's VC-3 encoder: CIDs 1235, 1237, 1238, 1241, 1242, 1243, 1244, 1250, 1251, 1252, 1253, 1258, 1259 and DNxHR LB/SQ/HQ/HQX/444 (Y′CbCr and RGB), with testsrc2, mandelbrot and heavy noise, at 1920×1080, 1280×720, 960×720, 1440×1080 (thin raster, interlaced), 1000×562, 640×360, 256×120 and 3840×2160. Compared with @@ -122,7 +122,7 @@ decoder evaluates the exact IDCT of equation 8.3, so decode is **not bit-exact, precision** of ffmpeg. (ffmpeg wraps rather than clips 10-bit reconstructions that overflow 1023, so the noise fixtures keep their samples inside 24…231 before encoding.) -[`oracle_encode.rs`](../../tests/dnx/oracle_encode.rs) encodes 1920×1080 frames with every profile and writes them into a +[`oracle_encode.rs`](../../tests/it/dnx/oracle_encode.rs) encodes 1920×1080 frames with every profile and writes them into a minimal test-only MOV. ffmpeg decodes them with `-xerror`, without errors, and agrees with our decoder within ±2 (90–99% identical). Luma PSNR against the source: HQ 58.8 dB (mandelbrot) and 66.3 dB (testsrc2), SQ 57.5 dB, LB 56.1 dB, HQX 10-bit 67.5 dB, HQX 12-bit 80.2 dB, 444 10-bit diff --git a/crates/video/src/ffv1/README.md b/crates/video/src/ffv1/README.md index 90312dbe5..0a7b5a8e3 100644 --- a/crates/video/src/ffv1/README.md +++ b/crates/video/src/ffv1/README.md @@ -47,6 +47,6 @@ let frame = dec.decode(&packet)?; ## Verification -`tests/ffv1.rs`: round trips over every shape, hostile input (every truncation and bit flip), +`tests/it/ffv1.rs`: round trips over every shape, hostile input (every truncation and bit flip), and ffmpeg as the oracle in both directions (skipped without ffmpeg, a failure with `CRAFT_MEDIA_REQUIRE_ORACLES=1`). diff --git a/crates/video/src/mpeg2/README.md b/crates/video/src/mpeg2/README.md index bddcae904..06dd01a89 100644 --- a/crates/video/src/mpeg2/README.md +++ b/crates/video/src/mpeg2/README.md @@ -169,7 +169,7 @@ are compared within a tolerance: **per frame max |Δ| ≤ 4 and PSNR ≥ 58 dB, samples differing**. Frame count, display order, picture types, interlacing and field order are exact (ffprobe). -`tests/mpeg2/oracle.rs` (FFmpeg-encoded elementary streams): +`tests/it/mpeg2/oracle.rs` (FFmpeg-encoded elementary streams): | Fixture | Content | Max Δ | Differing | PSNR | |---|---|---|---|---| @@ -218,7 +218,7 @@ fell to 77–150 fps). These are lower bounds. rounding, field addressing, edge clamping. - `tests.rs`: a hand-built intra picture decodes to its DC; truncation at every byte and 3000 random mutations never panic. -- `synth_tests.rs`, `tests/mpeg2/oracle.rs`: see above (single-threaded decode identical to the +- `synth_tests.rs`, `tests/it/mpeg2/oracle.rs`: see above (single-threaded decode identical to the threaded one). - `encode/`: every encoder code decodes to its value with the decoder's tables; motion vector deltas survive the decoder's wrap for f_code 1-4; forward/inverse DCT and quantiser round trips; @@ -245,7 +245,7 @@ fell to 77–150 fps). These are lower bounds. bitrate, for two picture intervals) are refused, and the lowest bitrate accepted for CIF meets the buffer with noise. The `vbv.rs` model itself: both bounds of a constant bitrate buffer, a full variable bitrate buffer stops filling, 29.97 fps does not drift. -- `tests/mpeg2/encode.rs`: FFmpeg decodes our streams of `testsrc2` (CIF and 576-line 4:2:2; +- `tests/it/mpeg2/encode.rs`: FFmpeg decodes our streams of `testsrc2` (CIF and 576-line 4:2:2; without B pictures, with 2 and 4, closed and open GOPs) without errors and within the decoder suite's tolerance of our reconstruction, ffprobe reports the profile, level, pixel format and picture types in display order, and average bitrate lands within 10 % of 800 and 2500 kbit/s diff --git a/crates/video/src/mpeg2/encode/tests.rs b/crates/video/src/mpeg2/encode/tests.rs index 06b2c20fe..60f9bbfb3 100644 --- a/crates/video/src/mpeg2/encode/tests.rs +++ b/crates/video/src/mpeg2/encode/tests.rs @@ -1,6 +1,6 @@ //! Encoder tests against this crate's decoder: the decoded pictures must equal the encoder's //! reconstruction exactly (any difference would drift along a GOP of P pictures). The ffmpeg -//! comparison is in `tests/mpeg2/encode.rs`. +//! comparison is in `tests/it/mpeg2/encode.rs`. use super::*; use crate::mpeg2::{Decoder, probe}; diff --git a/crates/video/src/mpeg2/synth_tests.rs b/crates/video/src/mpeg2/synth_tests.rs index f3c8648eb..61020a0a9 100644 --- a/crates/video/src/mpeg2/synth_tests.rs +++ b/crates/video/src/mpeg2/synth_tests.rs @@ -756,7 +756,7 @@ fn check(cfg: Cfg) { } let psnr = 10.0 * (255f64 * 255.0 * n as f64 / sse.max(1e-9)).log10(); println!("{}: {} frames, max diff {worst}, {:.3}% differ, PSNR {psnr:.2} dB", cfg.name, pics.len(), 100.0 * differ as f64 / n as f64); - // the same criteria as the ffmpeg-encoded fixtures (tests/mpeg2/oracle.rs) + // the same criteria as the ffmpeg-encoded fixtures (tests/it/mpeg2/oracle.rs) assert!(worst <= 4 && psnr >= 58.0, "{} (seed {:#x}): max diff {worst}, PSNR {psnr:.2}, first at {first_bad:?}", cfg.name, cfg.seed); } @@ -857,7 +857,7 @@ fn frame_pictures_field_mc_and_dual_prime() { } /// ffmpeg's encoder writes no field pictures, 16x8 or dual-prime prediction, so the hostile sweep -/// over its streams (`tests/mpeg2/fuzz_hostile.rs`) never reaches that code. Mutate and truncate +/// over its streams (`tests/it/mpeg2/fuzz_hostile.rs`) never reaches that code. Mutate and truncate /// the synthetic streams instead; needs no ffmpeg. #[test] fn mutated_field_and_dual_prime_streams_never_panic() { diff --git a/crates/video/src/mpeg2/tests.rs b/crates/video/src/mpeg2/tests.rs index 864472e05..25ead35e3 100644 --- a/crates/video/src/mpeg2/tests.rs +++ b/crates/video/src/mpeg2/tests.rs @@ -1,5 +1,5 @@ //! Unit tests over hand-built streams (headers, robustness). Decoding accuracy against ffmpeg is -//! in `tests/mpeg2/oracle.rs`. +//! in `tests/it/mpeg2/oracle.rs`. use super::*; diff --git a/crates/video/src/prores/README.md b/crates/video/src/prores/README.md index 731bc9280..ae83e3d9a 100644 --- a/crates/video/src/prores/README.md +++ b/crates/video/src/prores/README.md @@ -68,7 +68,7 @@ does), so the decoder doesn't need to know. rayon task directly into the output planes. - Robustness: every size field is validated before allocation, codewords longer than 56 bits are rejected, and arithmetic is overflow-safe. Mutated streams return `Err`, never panic (see - [`tests/prores/fuzz_hostile.rs`](../../tests/prores/fuzz_hostile.rs)). + [`tests/it/prores/fuzz_hostile.rs`](../../tests/it/prores/fuzz_hostile.rs)). ## Encoder diff --git a/crates/video/tests/apv/alpha.rs b/crates/video/tests/it/apv/alpha.rs similarity index 100% rename from crates/video/tests/apv/alpha.rs rename to crates/video/tests/it/apv/alpha.rs diff --git a/crates/video/tests/apv/budget.rs b/crates/video/tests/it/apv/budget.rs similarity index 100% rename from crates/video/tests/apv/budget.rs rename to crates/video/tests/it/apv/budget.rs diff --git a/crates/video/tests/apv/fuzz.rs b/crates/video/tests/it/apv/fuzz.rs similarity index 100% rename from crates/video/tests/apv/fuzz.rs rename to crates/video/tests/it/apv/fuzz.rs diff --git a/crates/video/tests/apv/fuzz_hostile.rs b/crates/video/tests/it/apv/fuzz_hostile.rs similarity index 100% rename from crates/video/tests/apv/fuzz_hostile.rs rename to crates/video/tests/it/apv/fuzz_hostile.rs diff --git a/crates/video/tests/apv/hostile_args.rs b/crates/video/tests/it/apv/hostile_args.rs similarity index 100% rename from crates/video/tests/apv/hostile_args.rs rename to crates/video/tests/it/apv/hostile_args.rs diff --git a/crates/video/tests/apv/main.rs b/crates/video/tests/it/apv/main.rs similarity index 100% rename from crates/video/tests/apv/main.rs rename to crates/video/tests/it/apv/main.rs diff --git a/crates/video/tests/apv/oracle.rs b/crates/video/tests/it/apv/oracle.rs similarity index 100% rename from crates/video/tests/apv/oracle.rs rename to crates/video/tests/it/apv/oracle.rs diff --git a/crates/video/tests/av1/main.rs b/crates/video/tests/it/av1/main.rs similarity index 100% rename from crates/video/tests/av1/main.rs rename to crates/video/tests/it/av1/main.rs diff --git a/crates/video/tests/av1_decode/adhoc.rs b/crates/video/tests/it/av1_decode/adhoc.rs similarity index 98% rename from crates/video/tests/av1_decode/adhoc.rs rename to crates/video/tests/it/av1_decode/adhoc.rs index 46172ce0d..d586d95df 100644 --- a/crates/video/tests/av1_decode/adhoc.rs +++ b/crates/video/tests/it/av1_decode/adhoc.rs @@ -1,7 +1,7 @@ //! Compare an arbitrary IVF file with libdav1d: //! `AV1_IVF=/path/x.ivf AV1_PIX=yuv420p cargo test -p craft-video --features av1-decode,threads --test av1_decode adhoc:: -- --ignored --nocapture` -use crate::common; +use super::common; use common::*; #[test] diff --git a/crates/video/tests/av1_decode/common/mod.rs b/crates/video/tests/it/av1_decode/common/mod.rs similarity index 100% rename from crates/video/tests/av1_decode/common/mod.rs rename to crates/video/tests/it/av1_decode/common/mod.rs diff --git a/crates/video/tests/av1_decode/conformance.rs b/crates/video/tests/it/av1_decode/conformance.rs similarity index 99% rename from crates/video/tests/av1_decode/conformance.rs rename to crates/video/tests/it/av1_decode/conformance.rs index b2060bfd1..e528385c6 100644 --- a/crates/video/tests/av1_decode/conformance.rs +++ b/crates/video/tests/it/av1_decode/conformance.rs @@ -1,6 +1,6 @@ //! libaom conformance test vectors (downloaded on first use), compared with libdav1d. -use crate::common; +use super::common; use common::*; /// Vectors the decoder handles today (more are added as stages land). diff --git a/crates/video/tests/av1_decode/fuzz_hostile.rs b/crates/video/tests/it/av1_decode/fuzz_hostile.rs similarity index 100% rename from crates/video/tests/av1_decode/fuzz_hostile.rs rename to crates/video/tests/it/av1_decode/fuzz_hostile.rs diff --git a/crates/video/tests/av1_decode/hostile_dims.rs b/crates/video/tests/it/av1_decode/hostile_dims.rs similarity index 100% rename from crates/video/tests/av1_decode/hostile_dims.rs rename to crates/video/tests/it/av1_decode/hostile_dims.rs diff --git a/crates/video/tests/av1_decode/main.rs b/crates/video/tests/it/av1_decode/main.rs similarity index 100% rename from crates/video/tests/av1_decode/main.rs rename to crates/video/tests/it/av1_decode/main.rs diff --git a/crates/video/tests/av1_decode/oracle_inter.rs b/crates/video/tests/it/av1_decode/oracle_inter.rs similarity index 99% rename from crates/video/tests/av1_decode/oracle_inter.rs rename to crates/video/tests/it/av1_decode/oracle_inter.rs index 65a229752..20ff3b1fb 100644 --- a/crates/video/tests/av1_decode/oracle_inter.rs +++ b/crates/video/tests/it/av1_decode/oracle_inter.rs @@ -2,7 +2,7 @@ //! GOPs with hierarchical references, compound prediction, OBMC / warped motion, global motion, //! motion-field projection and all loop filters. -use crate::common; +use super::common; use common::*; fn specs() -> Vec { diff --git a/crates/video/tests/av1_decode/oracle_intra.rs b/crates/video/tests/it/av1_decode/oracle_intra.rs similarity index 99% rename from crates/video/tests/av1_decode/oracle_intra.rs rename to crates/video/tests/it/av1_decode/oracle_intra.rs index 98bfbfa73..faf5fdea4 100644 --- a/crates/video/tests/av1_decode/oracle_intra.rs +++ b/crates/video/tests/it/av1_decode/oracle_intra.rs @@ -1,6 +1,6 @@ //! Intra-frame bit-exactness against libdav1d (run as an external ffmpeg process). -use crate::common; +use super::common; use common::*; const NO_FILTERS: &str = "enable-cdef=0:enable-restoration=0:enable-dlf=0:keyint=1"; diff --git a/crates/video/tests/av1_decode/perf.rs b/crates/video/tests/it/av1_decode/perf.rs similarity index 99% rename from crates/video/tests/av1_decode/perf.rs rename to crates/video/tests/it/av1_decode/perf.rs index 3f25a3289..e356cf3ea 100644 --- a/crates/video/tests/av1_decode/perf.rs +++ b/crates/video/tests/it/av1_decode/perf.rs @@ -5,7 +5,7 @@ //! thread CPU clock, which is robust to load; wall-clock figures are printed next to the load //! average. -use crate::common; +use super::common; use common::*; use craft_video::av1::decode::{DecodeStats, Decoder, Stage}; use std::time::Instant; diff --git a/crates/video/tests/av1_decode/wavefront.rs b/crates/video/tests/it/av1_decode/wavefront.rs similarity index 99% rename from crates/video/tests/av1_decode/wavefront.rs rename to crates/video/tests/it/av1_decode/wavefront.rs index 725b02544..9a9368146 100644 --- a/crates/video/tests/av1_decode/wavefront.rs +++ b/crates/video/tests/it/av1_decode/wavefront.rs @@ -2,7 +2,7 @@ //! frames): every thread count gives the single-thread pictures, run after run, and dropping //! or flushing a busy decoder never hangs. A hang fails the test through the deadline. -use crate::common; +use super::common; use common::*; use craft_video::av1::decode::{Decoder, Picture}; diff --git a/crates/video/tests/dnx/common/mod.rs b/crates/video/tests/it/dnx/common/mod.rs similarity index 100% rename from crates/video/tests/dnx/common/mod.rs rename to crates/video/tests/it/dnx/common/mod.rs diff --git a/crates/video/tests/dnx/fuzz_hostile.rs b/crates/video/tests/it/dnx/fuzz_hostile.rs similarity index 100% rename from crates/video/tests/dnx/fuzz_hostile.rs rename to crates/video/tests/it/dnx/fuzz_hostile.rs diff --git a/crates/video/tests/dnx/main.rs b/crates/video/tests/it/dnx/main.rs similarity index 100% rename from crates/video/tests/dnx/main.rs rename to crates/video/tests/it/dnx/main.rs diff --git a/crates/video/tests/dnx/oracle_decode.rs b/crates/video/tests/it/dnx/oracle_decode.rs similarity index 99% rename from crates/video/tests/dnx/oracle_decode.rs rename to crates/video/tests/it/dnx/oracle_decode.rs index b6bf90de4..dd8fb4178 100644 --- a/crates/video/tests/dnx/oracle_decode.rs +++ b/crates/video/tests/it/dnx/oracle_decode.rs @@ -1,6 +1,6 @@ //! Decode ffmpeg-made DNxHD / DNxHR fixtures and compare with ffmpeg's own decode. -use crate::common; +use super::common; use common::*; use craft_video::dnx::{DecodeOptions, decode_frame_with}; diff --git a/crates/video/tests/dnx/oracle_encode.rs b/crates/video/tests/it/dnx/oracle_encode.rs similarity index 99% rename from crates/video/tests/dnx/oracle_encode.rs rename to crates/video/tests/it/dnx/oracle_encode.rs index 003a9f3cb..52b8290c6 100644 --- a/crates/video/tests/dnx/oracle_encode.rs +++ b/crates/video/tests/it/dnx/oracle_encode.rs @@ -1,6 +1,6 @@ //! Encode DNxHR with our encoder, decode with ffmpeg (`-xerror`) and with our decoder. -use crate::common; +use super::common; use common::*; use craft_video::dnx::{ChromaFormat, Encoder, EncoderConfig, Profile, decode_frame}; diff --git a/crates/video/tests/dnx/perf.rs b/crates/video/tests/it/dnx/perf.rs similarity index 100% rename from crates/video/tests/dnx/perf.rs rename to crates/video/tests/it/dnx/perf.rs diff --git a/crates/video/tests/dnx/roundtrip.rs b/crates/video/tests/it/dnx/roundtrip.rs similarity index 100% rename from crates/video/tests/dnx/roundtrip.rs rename to crates/video/tests/it/dnx/roundtrip.rs diff --git a/crates/video/tests/ffv1.rs b/crates/video/tests/it/ffv1.rs similarity index 100% rename from crates/video/tests/ffv1.rs rename to crates/video/tests/it/ffv1.rs diff --git a/crates/video/tests/h264_decode/common/mod.rs b/crates/video/tests/it/h264_decode/common/mod.rs similarity index 100% rename from crates/video/tests/h264_decode/common/mod.rs rename to crates/video/tests/it/h264_decode/common/mod.rs diff --git a/crates/video/tests/h264_decode/conformance.rs b/crates/video/tests/it/h264_decode/conformance.rs similarity index 99% rename from crates/video/tests/h264_decode/conformance.rs rename to crates/video/tests/it/h264_decode/conformance.rs index 2af075508..53a59ef1a 100644 --- a/crates/video/tests/h264_decode/conformance.rs +++ b/crates/video/tests/it/h264_decode/conformance.rs @@ -1,6 +1,6 @@ //! Bit-exactness against ffmpeg's decoder on libx264-generated fixtures (skipped when ffmpeg is absent). -use crate::common; +use super::common; macro_rules! fixture_tests { ($($name:ident),* $(,)?) => { diff --git a/crates/video/tests/h264_decode/fuzz_hostile.rs b/crates/video/tests/it/h264_decode/fuzz_hostile.rs similarity index 99% rename from crates/video/tests/h264_decode/fuzz_hostile.rs rename to crates/video/tests/it/h264_decode/fuzz_hostile.rs index 4c2dd4f12..e918a2672 100644 --- a/crates/video/tests/h264_decode/fuzz_hostile.rs +++ b/crates/video/tests/it/h264_decode/fuzz_hostile.rs @@ -1,7 +1,7 @@ //! Hostile-input robustness: header-region sweeps (SPS/PPS/first slice headers), truncation and //! random mutation of small libx264 streams must never panic or run away. Skips without ffmpeg. -use crate::common; +use super::common; use std::panic::{AssertUnwindSafe, catch_unwind}; use std::process::{Command, Stdio}; diff --git a/crates/video/tests/h264_decode/headers.rs b/crates/video/tests/it/h264_decode/headers.rs similarity index 99% rename from crates/video/tests/h264_decode/headers.rs rename to crates/video/tests/it/h264_decode/headers.rs index 25f126879..926075f4a 100644 --- a/crates/video/tests/h264_decode/headers.rs +++ b/crates/video/tests/it/h264_decode/headers.rs @@ -1,6 +1,6 @@ //! Parameter set / slice header / POC parsing over the fixture streams. -use crate::common; +use super::common; use craft_media::bitstream::{annexb_nals, unescape_rbsp}; use craft_video::h264::decode::params::{Pps, Sps}; diff --git a/crates/video/tests/h264_decode/main.rs b/crates/video/tests/it/h264_decode/main.rs similarity index 100% rename from crates/video/tests/h264_decode/main.rs rename to crates/video/tests/it/h264_decode/main.rs diff --git a/crates/video/tests/h264_decode/perf.rs b/crates/video/tests/it/h264_decode/perf.rs similarity index 98% rename from crates/video/tests/h264_decode/perf.rs rename to crates/video/tests/it/h264_decode/perf.rs index 1993338a5..6bdfefc70 100644 --- a/crates/video/tests/h264_decode/perf.rs +++ b/crates/video/tests/it/h264_decode/perf.rs @@ -1,7 +1,7 @@ //! Decode speed on a 1080p High-profile stream (ignored by default; run with //! `cargo test --release -p craft-video --features h264-decode,threads --test h264_decode perf:: -- --ignored --nocapture`). -use crate::common; +use super::common; use craft_video::h264::decode::Decoder; use std::time::Instant; diff --git a/crates/video/tests/h264_decode/pps_validation.rs b/crates/video/tests/it/h264_decode/pps_validation.rs similarity index 100% rename from crates/video/tests/h264_decode/pps_validation.rs rename to crates/video/tests/it/h264_decode/pps_validation.rs diff --git a/crates/video/tests/h264_decode/robustness.rs b/crates/video/tests/it/h264_decode/robustness.rs similarity index 99% rename from crates/video/tests/h264_decode/robustness.rs rename to crates/video/tests/it/h264_decode/robustness.rs index 63320bad8..d2287f0b5 100644 --- a/crates/video/tests/h264_decode/robustness.rs +++ b/crates/video/tests/it/h264_decode/robustness.rs @@ -1,6 +1,6 @@ //! avcC / length-prefixed input and resilience against damaged streams. -use crate::common; +use super::common; use craft_media::bitstream::annexb_nals; use craft_video::h264::decode::Decoder; diff --git a/crates/video/tests/h264_encode/common/mod.rs b/crates/video/tests/it/h264_encode/common/mod.rs similarity index 100% rename from crates/video/tests/h264_encode/common/mod.rs rename to crates/video/tests/it/h264_encode/common/mod.rs diff --git a/crates/video/tests/h264_encode/crf_level_and_note.rs b/crates/video/tests/it/h264_encode/crf_level_and_note.rs similarity index 99% rename from crates/video/tests/h264_encode/crf_level_and_note.rs rename to crates/video/tests/it/h264_encode/crf_level_and_note.rs index f984e6bf3..4490b0748 100644 --- a/crates/video/tests/h264_encode/crf_level_and_note.rs +++ b/crates/video/tests/it/h264_encode/crf_level_and_note.rs @@ -1,7 +1,7 @@ //! Constant quality has no bitrate cap, so the level must allow what low factors spend; and every //! stream says which settings made it. -use crate::common; +use super::common; use common::synth; use craft_video::h264::*; diff --git a/crates/video/tests/h264_encode/ffmpeg_oracle.rs b/crates/video/tests/it/h264_encode/ffmpeg_oracle.rs similarity index 99% rename from crates/video/tests/h264_encode/ffmpeg_oracle.rs rename to crates/video/tests/it/h264_encode/ffmpeg_oracle.rs index f6d13e465..d0c4fc06e 100644 --- a/crates/video/tests/h264_encode/ffmpeg_oracle.rs +++ b/crates/video/tests/it/h264_encode/ffmpeg_oracle.rs @@ -3,7 +3,7 @@ //! Every stream must decode with zero errors, with the exact frame count, and the decoder's output must be //! bit-identical to the encoder's own reconstruction (catches prediction/transform/deblocking mismatches). -use crate::common; +use super::common; use common::{Yuv, annexb_nals, ffmpeg, ffmpeg_decode, ffmpeg_source, ffprobe, out_dir, psnr, synth}; use craft_video::h264::*; diff --git a/crates/video/tests/h264_encode/high10_oracle.rs b/crates/video/tests/it/h264_encode/high10_oracle.rs similarity index 99% rename from crates/video/tests/h264_encode/high10_oracle.rs rename to crates/video/tests/it/h264_encode/high10_oracle.rs index 33033f06a..8849d924f 100644 --- a/crates/video/tests/h264_encode/high10_oracle.rs +++ b/crates/video/tests/it/h264_encode/high10_oracle.rs @@ -2,7 +2,7 @@ //! external oracle (skipped when absent): every stream decodes without a message, with the exact frame //! count, bit-identical to the encoder's reconstruction (#1221). -use crate::common; +use super::common; use common::{Yuv16, ffmpeg, ffmpeg_decode_as, ffprobe, le16, out_dir, psnr10, synth, synth10}; use craft_video::h264::*; diff --git a/crates/video/tests/h264_encode/main.rs b/crates/video/tests/it/h264_encode/main.rs similarity index 100% rename from crates/video/tests/h264_encode/main.rs rename to crates/video/tests/it/h264_encode/main.rs diff --git a/crates/video/tests/h264_encode/pinned_decisions.rs b/crates/video/tests/it/h264_encode/pinned_decisions.rs similarity index 98% rename from crates/video/tests/h264_encode/pinned_decisions.rs rename to crates/video/tests/it/h264_encode/pinned_decisions.rs index c547b54ff..c07c88931 100644 --- a/crates/video/tests/h264_encode/pinned_decisions.rs +++ b/crates/video/tests/it/h264_encode/pinned_decisions.rs @@ -2,7 +2,7 @@ //! so a change that alters any decision (a mode, a motion vector, a quantiser), and not only one //! that breaks decoding, fails here. Only slice NAL units are hashed: the SEI names the version. -use crate::common::{annexb_nals, synth}; +use super::common::{annexb_nals, synth}; use craft_video::h264::*; /// FNV-1a over the slice NAL units of `n` frames of [`synth`] encoded with `c`. diff --git a/crates/video/tests/h264_encode/thread_count.rs b/crates/video/tests/it/h264_encode/thread_count.rs similarity index 98% rename from crates/video/tests/h264_encode/thread_count.rs rename to crates/video/tests/it/h264_encode/thread_count.rs index 36d0d762a..03d7d3ebf 100644 --- a/crates/video/tests/h264_encode/thread_count.rs +++ b/crates/video/tests/it/h264_encode/thread_count.rs @@ -1,7 +1,7 @@ //! The worker-thread count only changes scheduling: with the slice count fixed, 1, 2 and several threads //! must produce byte-identical streams (also across the reuse of the per-picture buffers over many frames). -use crate::common::synth; +use super::common::synth; use craft_video::h264::*; fn encode(rate: RateControl, bframes: u8, threads: usize) -> Vec { diff --git a/crates/video/tests/h264_encode/vbr_overshoot.rs b/crates/video/tests/it/h264_encode/vbr_overshoot.rs similarity index 99% rename from crates/video/tests/h264_encode/vbr_overshoot.rs rename to crates/video/tests/it/h264_encode/vbr_overshoot.rs index eba9ff648..4ee9282c0 100644 --- a/crates/video/tests/h264_encode/vbr_overshoot.rs +++ b/crates/video/tests/it/h264_encode/vbr_overshoot.rs @@ -1,6 +1,6 @@ //! Single-pass VBR must land near its target bitrate even on a short, high-motion clip. -use crate::common::{self, Yuv}; +use super::common::{self, Yuv}; use craft_video::h264::*; use std::io::Read; use std::process::{Command, Stdio}; diff --git a/crates/video/tests/hap.rs b/crates/video/tests/it/hap.rs similarity index 100% rename from crates/video/tests/hap.rs rename to crates/video/tests/it/hap.rs diff --git a/crates/video/tests/hevc/main.rs b/crates/video/tests/it/hevc/main.rs similarity index 100% rename from crates/video/tests/hevc/main.rs rename to crates/video/tests/it/hevc/main.rs diff --git a/crates/video/tests/hevc_decode/common/mod.rs b/crates/video/tests/it/hevc_decode/common/mod.rs similarity index 100% rename from crates/video/tests/hevc_decode/common/mod.rs rename to crates/video/tests/it/hevc_decode/common/mod.rs diff --git a/crates/video/tests/hevc_decode/conformance.rs b/crates/video/tests/it/hevc_decode/conformance.rs similarity index 99% rename from crates/video/tests/hevc_decode/conformance.rs rename to crates/video/tests/it/hevc_decode/conformance.rs index 08602d079..11b31df32 100644 --- a/crates/video/tests/hevc_decode/conformance.rs +++ b/crates/video/tests/it/hevc_decode/conformance.rs @@ -1,7 +1,7 @@ //! Bit-exactness against ffmpeg's decoder on libx265 / VideoToolbox fixtures (skipped when ffmpeg is //! absent). -use crate::common; +use super::common; macro_rules! fixture_tests { ($($name:ident),* $(,)?) => { diff --git a/crates/video/tests/hevc_decode/fuzz_hostile.rs b/crates/video/tests/it/hevc_decode/fuzz_hostile.rs similarity index 99% rename from crates/video/tests/hevc_decode/fuzz_hostile.rs rename to crates/video/tests/it/hevc_decode/fuzz_hostile.rs index 29249b856..f6e4c5dc8 100644 --- a/crates/video/tests/hevc_decode/fuzz_hostile.rs +++ b/crates/video/tests/it/hevc_decode/fuzz_hostile.rs @@ -1,7 +1,7 @@ //! Hostile-input robustness: header-region sweeps (SPS/PPS/first slice headers), truncation and //! random mutation of small libx265 streams must never panic or run away. Skips without ffmpeg. -use crate::common; +use super::common; use std::panic::{AssertUnwindSafe, catch_unwind}; use std::process::{Command, Stdio}; diff --git a/crates/video/tests/hevc_decode/main.rs b/crates/video/tests/it/hevc_decode/main.rs similarity index 100% rename from crates/video/tests/hevc_decode/main.rs rename to crates/video/tests/it/hevc_decode/main.rs diff --git a/crates/video/tests/hevc_decode/perf.rs b/crates/video/tests/it/hevc_decode/perf.rs similarity index 98% rename from crates/video/tests/hevc_decode/perf.rs rename to crates/video/tests/it/hevc_decode/perf.rs index 7962ff703..badc437a8 100644 --- a/crates/video/tests/hevc_decode/perf.rs +++ b/crates/video/tests/it/hevc_decode/perf.rs @@ -1,7 +1,7 @@ //! Decode speed (ignored by default; run with //! `cargo test --release -p craft-video --features hevc-decode,threads --test hevc_decode perf:: -- --ignored --nocapture`). -use crate::common; +use super::common; use craft_video::hevc::decode::Decoder; use std::time::Instant; diff --git a/crates/video/tests/hevc_decode/robustness.rs b/crates/video/tests/it/hevc_decode/robustness.rs similarity index 99% rename from crates/video/tests/hevc_decode/robustness.rs rename to crates/video/tests/it/hevc_decode/robustness.rs index a6c50ef41..328ba9029 100644 --- a/crates/video/tests/hevc_decode/robustness.rs +++ b/crates/video/tests/it/hevc_decode/robustness.rs @@ -1,6 +1,6 @@ //! hvcC / length-prefixed input and resilience against damaged streams. -use crate::common; +use super::common; use craft_media::bitstream::annexb_nals; use craft_video::hevc::decode::Decoder; diff --git a/crates/video/tests/it/main.rs b/crates/video/tests/it/main.rs new file mode 100644 index 000000000..49be451ef --- /dev/null +++ b/crates/video/tests/it/main.rs @@ -0,0 +1,73 @@ +//! Integration tests grouped by codec, retaining each former binary's feature gate. + +#[cfg(feature = "vmd-decode")] +#[path = "vmd/main.rs"] +mod vmd; + +#[cfg(feature = "hap")] +#[path = "hap.rs"] +mod hap; + +#[cfg(feature = "mjpeg")] +#[path = "mjpeg.rs"] +mod mjpeg; + +#[cfg(feature = "dnx")] +#[path = "dnx/main.rs"] +mod dnx; + +#[cfg(feature = "apv")] +#[path = "apv/main.rs"] +mod apv; + +#[cfg(feature = "vp8-decode")] +#[path = "vp8/main.rs"] +mod vp8; + +#[cfg(feature = "av1-decode")] +#[path = "av1_decode/main.rs"] +mod av1_decode; + +#[cfg(feature = "h264-decode")] +#[path = "h264_decode/main.rs"] +mod h264_decode; + +#[cfg(feature = "h264-encode")] +#[path = "h264_encode/main.rs"] +mod h264_encode; + +#[cfg(feature = "hevc-decode")] +#[path = "hevc_decode/main.rs"] +mod hevc_decode; + +#[cfg(feature = "vp8")] +#[path = "vp8_encode/main.rs"] +mod vp8_encode; + +#[cfg(feature = "vp9-decode")] +#[path = "vp9_decode/main.rs"] +mod vp9_decode; + +#[cfg(feature = "mpeg4-encode")] +#[path = "mpeg4_encode/main.rs"] +mod mpeg4_encode; + +#[cfg(feature = "mpeg2-decode")] +#[path = "mpeg2/main.rs"] +mod mpeg2; + +#[cfg(feature = "ffv1")] +#[path = "ffv1.rs"] +mod ffv1; + +#[cfg(feature = "prores")] +#[path = "prores/main.rs"] +mod prores; + +#[cfg(feature = "hevc-encode")] +#[path = "hevc/main.rs"] +mod hevc; + +#[cfg(feature = "av1")] +#[path = "av1/main.rs"] +mod av1; diff --git a/crates/video/tests/mjpeg.rs b/crates/video/tests/it/mjpeg.rs similarity index 100% rename from crates/video/tests/mjpeg.rs rename to crates/video/tests/it/mjpeg.rs diff --git a/crates/video/tests/mpeg2/common/mod.rs b/crates/video/tests/it/mpeg2/common/mod.rs similarity index 100% rename from crates/video/tests/mpeg2/common/mod.rs rename to crates/video/tests/it/mpeg2/common/mod.rs diff --git a/crates/video/tests/mpeg2/encode.rs b/crates/video/tests/it/mpeg2/encode.rs similarity index 99% rename from crates/video/tests/mpeg2/encode.rs rename to crates/video/tests/it/mpeg2/encode.rs index 1f13d9c86..d57633f4b 100644 --- a/crates/video/tests/mpeg2/encode.rs +++ b/crates/video/tests/it/mpeg2/encode.rs @@ -8,8 +8,8 @@ use std::process::{Command, Stdio}; use craft_video::mpeg2::{ChromaFormat, Encoder, EncoderConfig, Packet, RateControl, ReconFrame, YuvFrame}; -use crate::common::{Stats, fixture_dir, pix_fmt_of}; -use crate::oracle::{MAX_DIFFERING, MIN_PSNR, TOL_MAX}; +use super::common::{Stats, fixture_dir, pix_fmt_of}; +use super::oracle::{MAX_DIFFERING, MIN_PSNR, TOL_MAX}; /// Raw source frames from ffmpeg's `testsrc2`. fn source(ff: &Path, w: u32, h: u32, frames: usize, pix_fmt: &str) -> Vec { diff --git a/crates/video/tests/mpeg2/fuzz_hostile.rs b/crates/video/tests/it/mpeg2/fuzz_hostile.rs similarity index 99% rename from crates/video/tests/mpeg2/fuzz_hostile.rs rename to crates/video/tests/it/mpeg2/fuzz_hostile.rs index 598565784..1217be631 100644 --- a/crates/video/tests/mpeg2/fuzz_hostile.rs +++ b/crates/video/tests/it/mpeg2/fuzz_hostile.rs @@ -2,7 +2,7 @@ //! sweeps over a small ffmpeg-generated stream must never panic or run away (errors are fine). //! Skips when ffmpeg is missing. -use crate::common; +use super::common; use std::panic::{AssertUnwindSafe, catch_unwind}; diff --git a/crates/video/tests/mpeg2/hostile_dims.rs b/crates/video/tests/it/mpeg2/hostile_dims.rs similarity index 100% rename from crates/video/tests/mpeg2/hostile_dims.rs rename to crates/video/tests/it/mpeg2/hostile_dims.rs diff --git a/crates/video/tests/mpeg2/main.rs b/crates/video/tests/it/mpeg2/main.rs similarity index 100% rename from crates/video/tests/mpeg2/main.rs rename to crates/video/tests/it/mpeg2/main.rs diff --git a/crates/video/tests/mpeg2/oracle.rs b/crates/video/tests/it/mpeg2/oracle.rs similarity index 99% rename from crates/video/tests/mpeg2/oracle.rs rename to crates/video/tests/it/mpeg2/oracle.rs index 14993660c..bb4e54bc5 100644 --- a/crates/video/tests/mpeg2/oracle.rs +++ b/crates/video/tests/it/mpeg2/oracle.rs @@ -3,7 +3,7 @@ //! definition (any IEEE 1180-accurate IDCT conforms), so frames are compared within a tolerance; //! frame count and display order are exact. -use crate::common; +use super::common; use common::*; diff --git a/crates/video/tests/mpeg2/perf.rs b/crates/video/tests/it/mpeg2/perf.rs similarity index 90% rename from crates/video/tests/mpeg2/perf.rs rename to crates/video/tests/it/mpeg2/perf.rs index bc5372415..e01bd6010 100644 --- a/crates/video/tests/mpeg2/perf.rs +++ b/crates/video/tests/it/mpeg2/perf.rs @@ -1,7 +1,7 @@ //! Decode speed (ignored; run with `cargo test --release -p craft-video --features mpeg2,threads --test mpeg2 perf:: -- -//! --ignored --nocapture`). Uses the 1080i fixture of `tests/mpeg2/oracle.rs` (ffmpeg-encoded, 25 Mb/s). +//! --ignored --nocapture`). Uses the 1080i fixture of `tests/it/mpeg2/oracle.rs` (ffmpeg-encoded, 25 Mb/s). -use crate::common; +use super::common; use common::*; diff --git a/crates/video/tests/mpeg4_encode/main.rs b/crates/video/tests/it/mpeg4_encode/main.rs similarity index 100% rename from crates/video/tests/mpeg4_encode/main.rs rename to crates/video/tests/it/mpeg4_encode/main.rs diff --git a/crates/video/tests/prores/common/mod.rs b/crates/video/tests/it/prores/common/mod.rs similarity index 100% rename from crates/video/tests/prores/common/mod.rs rename to crates/video/tests/it/prores/common/mod.rs diff --git a/crates/video/tests/prores/fuzz.rs b/crates/video/tests/it/prores/fuzz.rs similarity index 99% rename from crates/video/tests/prores/fuzz.rs rename to crates/video/tests/it/prores/fuzz.rs index b533c1e0e..90221ae2b 100644 --- a/crates/video/tests/prores/fuzz.rs +++ b/crates/video/tests/it/prores/fuzz.rs @@ -1,6 +1,6 @@ //! Robustness: mutated and random inputs must never panic (errors are fine). -use crate::common; +use super::common; use craft_video::prores::*; struct Rng(u64); diff --git a/crates/video/tests/prores/fuzz_hostile.rs b/crates/video/tests/it/prores/fuzz_hostile.rs similarity index 100% rename from crates/video/tests/prores/fuzz_hostile.rs rename to crates/video/tests/it/prores/fuzz_hostile.rs diff --git a/crates/video/tests/prores/main.rs b/crates/video/tests/it/prores/main.rs similarity index 100% rename from crates/video/tests/prores/main.rs rename to crates/video/tests/it/prores/main.rs diff --git a/crates/video/tests/prores/oracle_decode.rs b/crates/video/tests/it/prores/oracle_decode.rs similarity index 99% rename from crates/video/tests/prores/oracle_decode.rs rename to crates/video/tests/it/prores/oracle_decode.rs index 1c8c535db..f9cff8114 100644 --- a/crates/video/tests/prores/oracle_decode.rs +++ b/crates/video/tests/it/prores/oracle_decode.rs @@ -1,6 +1,6 @@ //! Decoder accuracy against ffmpeg's ProRes decoder (oracle only; skipped without ffmpeg). -use crate::common; +use super::common; use common::*; use craft_video::prores::{AlphaType, ChromaFormat, DecodeOptions, Interlace, decode_frame, decode_frame_with, probe}; diff --git a/crates/video/tests/prores/oracle_encode.rs b/crates/video/tests/it/prores/oracle_encode.rs similarity index 99% rename from crates/video/tests/prores/oracle_encode.rs rename to crates/video/tests/it/prores/oracle_encode.rs index 024e4524f..b9323d3d9 100644 --- a/crates/video/tests/prores/oracle_encode.rs +++ b/crates/video/tests/it/prores/oracle_encode.rs @@ -1,6 +1,6 @@ //! Encoder conformance and quality against ffmpeg's ProRes decoder (oracle only). -use crate::common; +use super::common; use common::*; use craft_video::prores::{ChromaFormat, DecodeOptions, Encoder, Frame, Profile, decode_frame, decode_frame_with}; diff --git a/crates/video/tests/prores/perf.rs b/crates/video/tests/it/prores/perf.rs similarity index 99% rename from crates/video/tests/prores/perf.rs rename to crates/video/tests/it/prores/perf.rs index aac69664d..2a8c5f623 100644 --- a/crates/video/tests/prores/perf.rs +++ b/crates/video/tests/it/prores/perf.rs @@ -1,7 +1,7 @@ //! Decode/encode throughput. Run with //! `cargo test --release -p craft-video --features prores --test prores perf:: -- --ignored --nocapture`. -use crate::common; +use super::common; use craft_video::prores::*; use std::time::Instant; diff --git a/crates/video/tests/prores/roundtrip.rs b/crates/video/tests/it/prores/roundtrip.rs similarity index 99% rename from crates/video/tests/prores/roundtrip.rs rename to crates/video/tests/it/prores/roundtrip.rs index 873e78840..e0bd0ed1b 100644 --- a/crates/video/tests/prores/roundtrip.rs +++ b/crates/video/tests/it/prores/roundtrip.rs @@ -1,6 +1,6 @@ //! Encoder → decoder round trips on synthetic content (no external tools needed). -use crate::common; +use super::common; use common::psnr; use craft_video::prores::*; diff --git a/crates/video/tests/vmd/main.rs b/crates/video/tests/it/vmd/main.rs similarity index 100% rename from crates/video/tests/vmd/main.rs rename to crates/video/tests/it/vmd/main.rs diff --git a/crates/video/tests/vp8/common/mod.rs b/crates/video/tests/it/vp8/common/mod.rs similarity index 100% rename from crates/video/tests/vp8/common/mod.rs rename to crates/video/tests/it/vp8/common/mod.rs diff --git a/crates/video/tests/vp8/conformance.rs b/crates/video/tests/it/vp8/conformance.rs similarity index 99% rename from crates/video/tests/vp8/conformance.rs rename to crates/video/tests/it/vp8/conformance.rs index c6dec271e..39c9fbca0 100644 --- a/crates/video/tests/vp8/conformance.rs +++ b/crates/video/tests/it/vp8/conformance.rs @@ -1,7 +1,7 @@ //! Bit-exactness against libvpx (through ffmpeg) on generated fixtures covering every coding //! tool: skipped when ffmpeg or its libvpx encoder is absent. -use crate::common; +use super::common; fn check(name: &str) { let f = common::fixture(name); diff --git a/crates/video/tests/vp8/fuzz_hostile.rs b/crates/video/tests/it/vp8/fuzz_hostile.rs similarity index 100% rename from crates/video/tests/vp8/fuzz_hostile.rs rename to crates/video/tests/it/vp8/fuzz_hostile.rs diff --git a/crates/video/tests/vp8/main.rs b/crates/video/tests/it/vp8/main.rs similarity index 100% rename from crates/video/tests/vp8/main.rs rename to crates/video/tests/it/vp8/main.rs diff --git a/crates/video/tests/vp8/robustness.rs b/crates/video/tests/it/vp8/robustness.rs similarity index 99% rename from crates/video/tests/vp8/robustness.rs rename to crates/video/tests/it/vp8/robustness.rs index 620da97e1..59a7bf054 100644 --- a/crates/video/tests/vp8/robustness.rs +++ b/crates/video/tests/it/vp8/robustness.rs @@ -1,6 +1,6 @@ //! Damaged, truncated, reordered and random input must never panic (errors are fine). -use crate::common; +use super::common; use craft_video::vp8::{Decoder, Error}; diff --git a/crates/video/tests/vp8/vectors.rs b/crates/video/tests/it/vp8/vectors.rs similarity index 99% rename from crates/video/tests/vp8/vectors.rs rename to crates/video/tests/it/vp8/vectors.rs index df9d02e27..4d8894606 100644 --- a/crates/video/tests/vp8/vectors.rs +++ b/crates/video/tests/it/vp8/vectors.rs @@ -3,7 +3,7 @@ //! downloaded by the tests; fetch them from //! `https://storage.googleapis.com/downloads.webmproject.org/test_data/libvpx/`. -use crate::common; +use super::common; /// MD5 (RFC 1321), for comparing with the vectors' checksums. fn md5(data: &[u8]) -> String { diff --git a/crates/video/tests/vp8_encode/main.rs b/crates/video/tests/it/vp8_encode/main.rs similarity index 100% rename from crates/video/tests/vp8_encode/main.rs rename to crates/video/tests/it/vp8_encode/main.rs diff --git a/crates/video/tests/vp9_decode/common/mod.rs b/crates/video/tests/it/vp9_decode/common/mod.rs similarity index 100% rename from crates/video/tests/vp9_decode/common/mod.rs rename to crates/video/tests/it/vp9_decode/common/mod.rs diff --git a/crates/video/tests/vp9_decode/conformance.rs b/crates/video/tests/it/vp9_decode/conformance.rs similarity index 99% rename from crates/video/tests/vp9_decode/conformance.rs rename to crates/video/tests/it/vp9_decode/conformance.rs index cfa42b17b..84299206c 100644 --- a/crates/video/tests/vp9_decode/conformance.rs +++ b/crates/video/tests/it/vp9_decode/conformance.rs @@ -1,7 +1,7 @@ //! Bit-exactness against ffmpeg's VP9 decoder on libvpx-vp9 fixtures (skipped when ffmpeg or //! libvpx is absent). -use crate::common; +use super::common; macro_rules! fixture_tests { ($($name:ident),* $(,)?) => { diff --git a/crates/video/tests/vp9_decode/frame.rs b/crates/video/tests/it/vp9_decode/frame.rs similarity index 99% rename from crates/video/tests/vp9_decode/frame.rs rename to crates/video/tests/it/vp9_decode/frame.rs index c8e94db57..fe146c56e 100644 --- a/crates/video/tests/vp9_decode/frame.rs +++ b/crates/video/tests/it/vp9_decode/frame.rs @@ -1,6 +1,6 @@ //! Conversion of decoded VP9 pictures into `craft_video::frame::VideoFrame`. -use crate::common; +use super::common; use craft_video::frame::{ColorFamily, Samples, VideoFrame}; /// An RGB stream converts to R, G, B. The reference decode is ffmpeg's `gbrp` (G, B, R), so the diff --git a/crates/video/tests/vp9_decode/fuzz_hostile.rs b/crates/video/tests/it/vp9_decode/fuzz_hostile.rs similarity index 100% rename from crates/video/tests/vp9_decode/fuzz_hostile.rs rename to crates/video/tests/it/vp9_decode/fuzz_hostile.rs diff --git a/crates/video/tests/vp9_decode/main.rs b/crates/video/tests/it/vp9_decode/main.rs similarity index 100% rename from crates/video/tests/vp9_decode/main.rs rename to crates/video/tests/it/vp9_decode/main.rs diff --git a/crates/video/tests/vp9_decode/perf.rs b/crates/video/tests/it/vp9_decode/perf.rs similarity index 98% rename from crates/video/tests/vp9_decode/perf.rs rename to crates/video/tests/it/vp9_decode/perf.rs index ac891f8da..3af94bee6 100644 --- a/crates/video/tests/vp9_decode/perf.rs +++ b/crates/video/tests/it/vp9_decode/perf.rs @@ -1,7 +1,7 @@ //! Decode speed (ignored by default; run with //! `cargo test --release -p craft-video --features vp9-decode,threads --test vp9_decode perf:: -- --ignored --nocapture`). -use crate::common; +use super::common; use craft_video::vp9::decode::Decoder; use std::time::Instant; diff --git a/crates/video/tests/vp9_decode/robustness.rs b/crates/video/tests/it/vp9_decode/robustness.rs similarity index 99% rename from crates/video/tests/vp9_decode/robustness.rs rename to crates/video/tests/it/vp9_decode/robustness.rs index 27f5bbb34..1cb703c09 100644 --- a/crates/video/tests/vp9_decode/robustness.rs +++ b/crates/video/tests/it/vp9_decode/robustness.rs @@ -1,6 +1,6 @@ //! Damaged, truncated and random input must never panic or hang (errors are fine). -use crate::common; +use super::common; use craft_video::vp9::decode::Decoder; use std::time::{Duration, Instant}; diff --git a/crates/video/tests/vp9_decode/synthetic.rs b/crates/video/tests/it/vp9_decode/synthetic.rs similarity index 99% rename from crates/video/tests/vp9_decode/synthetic.rs rename to crates/video/tests/it/vp9_decode/synthetic.rs index 5f267ad6a..5a95a31dc 100644 --- a/crates/video/tests/vp9_decode/synthetic.rs +++ b/crates/video/tests/it/vp9_decode/synthetic.rs @@ -7,7 +7,7 @@ //! show_existing_frame; //! - show_existing_frame of hidden alt-ref frames and of arbitrary slots. -use crate::common; +use super::common; use std::path::Path; From df833e4552aabf46abed64d4fca4bffd0fb3f9d2 Mon Sep 17 00:00:00 2001 From: FredApps Date: Thu, 19 Nov 2026 12:56:56 +0100 Subject: [PATCH 03/22] Consolidate dxf integration tests --- crates/dxf/tests/{ => it}/audit_followups.rs | 0 crates/dxf/tests/{ => it}/binary_write.rs | 0 crates/dxf/tests/{ => it}/code_page_write.rs | 0 crates/dxf/tests/{ => it}/conformance.rs | 0 crates/dxf/tests/{ => it}/hardening.rs | 0 crates/dxf/tests/{ => it}/hex_chunks.rs | 0 crates/dxf/tests/it/main.rs | 15 +++++++++++++++ crates/dxf/tests/{ => it}/model.rs | 0 crates/dxf/tests/{ => it}/model_entities.rs | 0 crates/dxf/tests/{ => it}/model_mleader.rs | 0 crates/dxf/tests/{ => it}/model_objects.rs | 0 crates/dxf/tests/{ => it}/model_table.rs | 0 crates/dxf/tests/{ => it}/model_write.rs | 0 .../dxf/tests/{ => it}/model_write_annotations.rs | 0 crates/dxf/tests/{ => it}/recovering.rs | 0 crates/dxf/tests/{ => it}/roundtrip.rs | 0 16 files changed, 15 insertions(+) rename crates/dxf/tests/{ => it}/audit_followups.rs (100%) rename crates/dxf/tests/{ => it}/binary_write.rs (100%) rename crates/dxf/tests/{ => it}/code_page_write.rs (100%) rename crates/dxf/tests/{ => it}/conformance.rs (100%) rename crates/dxf/tests/{ => it}/hardening.rs (100%) rename crates/dxf/tests/{ => it}/hex_chunks.rs (100%) create mode 100644 crates/dxf/tests/it/main.rs rename crates/dxf/tests/{ => it}/model.rs (100%) rename crates/dxf/tests/{ => it}/model_entities.rs (100%) rename crates/dxf/tests/{ => it}/model_mleader.rs (100%) rename crates/dxf/tests/{ => it}/model_objects.rs (100%) rename crates/dxf/tests/{ => it}/model_table.rs (100%) rename crates/dxf/tests/{ => it}/model_write.rs (100%) rename crates/dxf/tests/{ => it}/model_write_annotations.rs (100%) rename crates/dxf/tests/{ => it}/recovering.rs (100%) rename crates/dxf/tests/{ => it}/roundtrip.rs (100%) diff --git a/crates/dxf/tests/audit_followups.rs b/crates/dxf/tests/it/audit_followups.rs similarity index 100% rename from crates/dxf/tests/audit_followups.rs rename to crates/dxf/tests/it/audit_followups.rs diff --git a/crates/dxf/tests/binary_write.rs b/crates/dxf/tests/it/binary_write.rs similarity index 100% rename from crates/dxf/tests/binary_write.rs rename to crates/dxf/tests/it/binary_write.rs diff --git a/crates/dxf/tests/code_page_write.rs b/crates/dxf/tests/it/code_page_write.rs similarity index 100% rename from crates/dxf/tests/code_page_write.rs rename to crates/dxf/tests/it/code_page_write.rs diff --git a/crates/dxf/tests/conformance.rs b/crates/dxf/tests/it/conformance.rs similarity index 100% rename from crates/dxf/tests/conformance.rs rename to crates/dxf/tests/it/conformance.rs diff --git a/crates/dxf/tests/hardening.rs b/crates/dxf/tests/it/hardening.rs similarity index 100% rename from crates/dxf/tests/hardening.rs rename to crates/dxf/tests/it/hardening.rs diff --git a/crates/dxf/tests/hex_chunks.rs b/crates/dxf/tests/it/hex_chunks.rs similarity index 100% rename from crates/dxf/tests/hex_chunks.rs rename to crates/dxf/tests/it/hex_chunks.rs diff --git a/crates/dxf/tests/it/main.rs b/crates/dxf/tests/it/main.rs new file mode 100644 index 000000000..db0ee235e --- /dev/null +++ b/crates/dxf/tests/it/main.rs @@ -0,0 +1,15 @@ +mod audit_followups; +mod binary_write; +mod code_page_write; +mod conformance; +mod hardening; +mod hex_chunks; +mod model; +mod model_entities; +mod model_mleader; +mod model_objects; +mod model_table; +mod model_write; +mod model_write_annotations; +mod recovering; +mod roundtrip; diff --git a/crates/dxf/tests/model.rs b/crates/dxf/tests/it/model.rs similarity index 100% rename from crates/dxf/tests/model.rs rename to crates/dxf/tests/it/model.rs diff --git a/crates/dxf/tests/model_entities.rs b/crates/dxf/tests/it/model_entities.rs similarity index 100% rename from crates/dxf/tests/model_entities.rs rename to crates/dxf/tests/it/model_entities.rs diff --git a/crates/dxf/tests/model_mleader.rs b/crates/dxf/tests/it/model_mleader.rs similarity index 100% rename from crates/dxf/tests/model_mleader.rs rename to crates/dxf/tests/it/model_mleader.rs diff --git a/crates/dxf/tests/model_objects.rs b/crates/dxf/tests/it/model_objects.rs similarity index 100% rename from crates/dxf/tests/model_objects.rs rename to crates/dxf/tests/it/model_objects.rs diff --git a/crates/dxf/tests/model_table.rs b/crates/dxf/tests/it/model_table.rs similarity index 100% rename from crates/dxf/tests/model_table.rs rename to crates/dxf/tests/it/model_table.rs diff --git a/crates/dxf/tests/model_write.rs b/crates/dxf/tests/it/model_write.rs similarity index 100% rename from crates/dxf/tests/model_write.rs rename to crates/dxf/tests/it/model_write.rs diff --git a/crates/dxf/tests/model_write_annotations.rs b/crates/dxf/tests/it/model_write_annotations.rs similarity index 100% rename from crates/dxf/tests/model_write_annotations.rs rename to crates/dxf/tests/it/model_write_annotations.rs diff --git a/crates/dxf/tests/recovering.rs b/crates/dxf/tests/it/recovering.rs similarity index 100% rename from crates/dxf/tests/recovering.rs rename to crates/dxf/tests/it/recovering.rs diff --git a/crates/dxf/tests/roundtrip.rs b/crates/dxf/tests/it/roundtrip.rs similarity index 100% rename from crates/dxf/tests/roundtrip.rs rename to crates/dxf/tests/it/roundtrip.rs From b1c19e5b8096b1e35d6a9631d99cb327d6982bc2 Mon Sep 17 00:00:00 2001 From: FredApps Date: Thu, 19 Nov 2026 12:57:10 +0100 Subject: [PATCH 04/22] Consolidate ipc integration tests --- crates/ipc/README.md | 2 +- crates/ipc/tests/{ => it}/bulk.rs | 0 crates/ipc/tests/{ => it}/connection_limits.rs | 0 crates/ipc/tests/{ => it}/discovery.rs | 2 +- crates/ipc/tests/{ => it}/fetch.rs | 0 crates/ipc/tests/{ => it}/hub.rs | 0 crates/ipc/tests/it/main.rs | 12 ++++++++++++ crates/ipc/tests/{ => it}/native_roundtrip.rs | 0 crates/ipc/tests/{ => it}/open_payload.rs | 0 crates/ipc/tests/{ => it}/protocol.rs | 0 crates/ipc/tests/{ => it}/provider_stall.rs | 0 crates/ipc/tests/{ => it}/schemas.rs | 0 crates/ipc/tests/{ => it}/security.rs | 0 crates/ipc/tests/{ => it}/watch.rs | 0 14 files changed, 14 insertions(+), 2 deletions(-) rename crates/ipc/tests/{ => it}/bulk.rs (100%) rename crates/ipc/tests/{ => it}/connection_limits.rs (100%) rename crates/ipc/tests/{ => it}/discovery.rs (95%) rename crates/ipc/tests/{ => it}/fetch.rs (100%) rename crates/ipc/tests/{ => it}/hub.rs (100%) create mode 100644 crates/ipc/tests/it/main.rs rename crates/ipc/tests/{ => it}/native_roundtrip.rs (100%) rename crates/ipc/tests/{ => it}/open_payload.rs (100%) rename crates/ipc/tests/{ => it}/protocol.rs (100%) rename crates/ipc/tests/{ => it}/provider_stall.rs (100%) rename crates/ipc/tests/{ => it}/schemas.rs (100%) rename crates/ipc/tests/{ => it}/security.rs (100%) rename crates/ipc/tests/{ => it}/watch.rs (100%) diff --git a/crates/ipc/README.md b/crates/ipc/README.md index 8bcdbea66..5a0ca5c20 100644 --- a/crates/ipc/README.md +++ b/crates/ipc/README.md @@ -31,7 +31,7 @@ ## Schemas and fixtures -`schemas/instance-record.schema.json` and `schemas/link-record.schema.json` describe the stored records. `tests/schemas.rs` checks that each schema and its Rust type agree, and that the stored records in `tests/fixtures/` stay valid. +`schemas/instance-record.schema.json` and `schemas/link-record.schema.json` describe the stored records. `tests/it/schemas.rs` checks that each schema and its Rust type agree, and that the stored records in `tests/fixtures/` stay valid. ## Tests diff --git a/crates/ipc/tests/bulk.rs b/crates/ipc/tests/it/bulk.rs similarity index 100% rename from crates/ipc/tests/bulk.rs rename to crates/ipc/tests/it/bulk.rs diff --git a/crates/ipc/tests/connection_limits.rs b/crates/ipc/tests/it/connection_limits.rs similarity index 100% rename from crates/ipc/tests/connection_limits.rs rename to crates/ipc/tests/it/connection_limits.rs diff --git a/crates/ipc/tests/discovery.rs b/crates/ipc/tests/it/discovery.rs similarity index 95% rename from crates/ipc/tests/discovery.rs rename to crates/ipc/tests/it/discovery.rs index 7d9f4a05f..6efab2f41 100644 --- a/crates/ipc/tests/discovery.rs +++ b/crates/ipc/tests/it/discovery.rs @@ -35,7 +35,7 @@ fn sigkill_drops_the_record() { let _ = std::fs::remove_dir_all(&path); let runtime = RuntimeDir::at(&path).unwrap(); let exe = std::env::current_exe().unwrap(); - let child = Command::new(exe).args(["--exact", "hold_until_killed", "--test-threads=1"]).env("CRAFT_HOLD_DIR", &path).spawn().unwrap(); + let child = Command::new(exe).args(["--exact", "discovery::hold_until_killed", "--test-threads=1"]).env("CRAFT_HOLD_DIR", &path).spawn().unwrap(); let mut guard = HoldCleanup { dir: path.clone(), child: Some(child) }; let ready = runtime.path().join("ready"); let deadline = Instant::now() + Duration::from_secs(10); diff --git a/crates/ipc/tests/fetch.rs b/crates/ipc/tests/it/fetch.rs similarity index 100% rename from crates/ipc/tests/fetch.rs rename to crates/ipc/tests/it/fetch.rs diff --git a/crates/ipc/tests/hub.rs b/crates/ipc/tests/it/hub.rs similarity index 100% rename from crates/ipc/tests/hub.rs rename to crates/ipc/tests/it/hub.rs diff --git a/crates/ipc/tests/it/main.rs b/crates/ipc/tests/it/main.rs new file mode 100644 index 000000000..0d95587ab --- /dev/null +++ b/crates/ipc/tests/it/main.rs @@ -0,0 +1,12 @@ +mod bulk; +mod connection_limits; +mod discovery; +mod fetch; +mod hub; +mod native_roundtrip; +mod open_payload; +mod protocol; +mod provider_stall; +mod schemas; +mod security; +mod watch; diff --git a/crates/ipc/tests/native_roundtrip.rs b/crates/ipc/tests/it/native_roundtrip.rs similarity index 100% rename from crates/ipc/tests/native_roundtrip.rs rename to crates/ipc/tests/it/native_roundtrip.rs diff --git a/crates/ipc/tests/open_payload.rs b/crates/ipc/tests/it/open_payload.rs similarity index 100% rename from crates/ipc/tests/open_payload.rs rename to crates/ipc/tests/it/open_payload.rs diff --git a/crates/ipc/tests/protocol.rs b/crates/ipc/tests/it/protocol.rs similarity index 100% rename from crates/ipc/tests/protocol.rs rename to crates/ipc/tests/it/protocol.rs diff --git a/crates/ipc/tests/provider_stall.rs b/crates/ipc/tests/it/provider_stall.rs similarity index 100% rename from crates/ipc/tests/provider_stall.rs rename to crates/ipc/tests/it/provider_stall.rs diff --git a/crates/ipc/tests/schemas.rs b/crates/ipc/tests/it/schemas.rs similarity index 100% rename from crates/ipc/tests/schemas.rs rename to crates/ipc/tests/it/schemas.rs diff --git a/crates/ipc/tests/security.rs b/crates/ipc/tests/it/security.rs similarity index 100% rename from crates/ipc/tests/security.rs rename to crates/ipc/tests/it/security.rs diff --git a/crates/ipc/tests/watch.rs b/crates/ipc/tests/it/watch.rs similarity index 100% rename from crates/ipc/tests/watch.rs rename to crates/ipc/tests/it/watch.rs From 2c972d9b48761428dea160010c8e5d029af28617 Mon Sep 17 00:00:00 2001 From: FredApps Date: Thu, 19 Nov 2026 12:57:31 +0100 Subject: [PATCH 05/22] Consolidate zip integration tests --- crates/zip/tests/{ => it}/aligned_writer.rs | 0 crates/zip/tests/{ => it}/archive.rs | 0 .../lenient_zip64_end_record_compatibility.rs | 5 ++--- .../{ => it}/lenient_zip64_extra_boundaries.rs | 3 +-- .../tests/{ => it}/lenient_zip_decoded_size.rs | 3 +-- .../{ => it}/lenient_zip_directory_bounds.rs | 5 ++--- .../tests/{ => it}/lenient_zip_entry_detection.rs | 5 ++--- .../tests/{ => it}/lenient_zip_split_volumes.rs | 5 ++--- .../zip/tests/{ => it}/lenient_zip_stored_cap.rs | 3 +-- crates/zip/tests/it/main.rs | 15 +++++++++++++++ crates/zip/tests/{ => it}/public_api.rs | 0 11 files changed, 26 insertions(+), 18 deletions(-) rename crates/zip/tests/{ => it}/aligned_writer.rs (100%) rename crates/zip/tests/{ => it}/archive.rs (100%) rename crates/zip/tests/{ => it}/lenient_zip64_end_record_compatibility.rs (99%) rename crates/zip/tests/{ => it}/lenient_zip64_extra_boundaries.rs (98%) rename crates/zip/tests/{ => it}/lenient_zip_decoded_size.rs (97%) rename crates/zip/tests/{ => it}/lenient_zip_directory_bounds.rs (98%) rename crates/zip/tests/{ => it}/lenient_zip_entry_detection.rs (97%) rename crates/zip/tests/{ => it}/lenient_zip_split_volumes.rs (99%) rename crates/zip/tests/{ => it}/lenient_zip_stored_cap.rs (95%) create mode 100644 crates/zip/tests/it/main.rs rename crates/zip/tests/{ => it}/public_api.rs (100%) diff --git a/crates/zip/tests/aligned_writer.rs b/crates/zip/tests/it/aligned_writer.rs similarity index 100% rename from crates/zip/tests/aligned_writer.rs rename to crates/zip/tests/it/aligned_writer.rs diff --git a/crates/zip/tests/archive.rs b/crates/zip/tests/it/archive.rs similarity index 100% rename from crates/zip/tests/archive.rs rename to crates/zip/tests/it/archive.rs diff --git a/crates/zip/tests/lenient_zip64_end_record_compatibility.rs b/crates/zip/tests/it/lenient_zip64_end_record_compatibility.rs similarity index 99% rename from crates/zip/tests/lenient_zip64_end_record_compatibility.rs rename to crates/zip/tests/it/lenient_zip64_end_record_compatibility.rs index ed599fbda..334bd5ae5 100644 --- a/crates/zip/tests/lenient_zip64_end_record_compatibility.rs +++ b/crates/zip/tests/it/lenient_zip64_end_record_compatibility.rs @@ -1,9 +1,8 @@ #![cfg(feature = "lenient")] // From Craft Anything crates/formats/tests/zip64_end_record_compatibility.rs. -use craft_zip::lenient::{self as zip, ZipArchive, ZipError}; -#[path = "lenient_common/mod.rs"] -mod common; +use super::common; use common::zip_stored; +use craft_zip::lenient::{self as zip, ZipArchive, ZipError}; fn warning_contains(archive: &ZipArchive, text: &str) -> bool { archive.warnings.iter().any(|warning| warning.contains(text)) diff --git a/crates/zip/tests/lenient_zip64_extra_boundaries.rs b/crates/zip/tests/it/lenient_zip64_extra_boundaries.rs similarity index 98% rename from crates/zip/tests/lenient_zip64_extra_boundaries.rs rename to crates/zip/tests/it/lenient_zip64_extra_boundaries.rs index fae4fd5f9..e7462a80d 100644 --- a/crates/zip/tests/lenient_zip64_extra_boundaries.rs +++ b/crates/zip/tests/it/lenient_zip64_extra_boundaries.rs @@ -1,8 +1,7 @@ #![cfg(feature = "lenient")] // From Craft Anything crates/formats/tests/zip64_extra_boundaries.rs. -#[path = "lenient_common/mod.rs"] -mod common; +use super::common; use craft_zip::lenient as zip; fn archive(extra: &[u8], sentinel: usize) -> Vec { diff --git a/crates/zip/tests/lenient_zip_decoded_size.rs b/crates/zip/tests/it/lenient_zip_decoded_size.rs similarity index 97% rename from crates/zip/tests/lenient_zip_decoded_size.rs rename to crates/zip/tests/it/lenient_zip_decoded_size.rs index 9db3ec80e..edea7c8a7 100644 --- a/crates/zip/tests/lenient_zip_decoded_size.rs +++ b/crates/zip/tests/it/lenient_zip_decoded_size.rs @@ -1,8 +1,7 @@ #![cfg(feature = "lenient")] // From Craft Anything crates/formats/tests/zip_decoded_size.rs. -#[path = "lenient_common/mod.rs"] -mod common; +use super::common; use craft_zip::lenient::{self as zip, ZipEntry, ZipError}; fn deflated(body: &[u8]) -> (Vec, ZipEntry) { diff --git a/crates/zip/tests/lenient_zip_directory_bounds.rs b/crates/zip/tests/it/lenient_zip_directory_bounds.rs similarity index 98% rename from crates/zip/tests/lenient_zip_directory_bounds.rs rename to crates/zip/tests/it/lenient_zip_directory_bounds.rs index 8e912fc3b..5831dc0e2 100644 --- a/crates/zip/tests/lenient_zip_directory_bounds.rs +++ b/crates/zip/tests/it/lenient_zip_directory_bounds.rs @@ -1,9 +1,8 @@ #![cfg(feature = "lenient")] // From Craft Anything crates/formats/tests/zip_directory_bounds.rs. -use craft_zip::lenient::{self as zip, ZipError}; -#[path = "lenient_common/mod.rs"] -mod common; +use super::common; use common::zip_stored; +use craft_zip::lenient::{self as zip, ZipError}; #[test] fn a_short_declared_entry_is_rejected_before_its_signature_is_checked() { diff --git a/crates/zip/tests/lenient_zip_entry_detection.rs b/crates/zip/tests/it/lenient_zip_entry_detection.rs similarity index 97% rename from crates/zip/tests/lenient_zip_entry_detection.rs rename to crates/zip/tests/it/lenient_zip_entry_detection.rs index 8708b6400..34dd64157 100644 --- a/crates/zip/tests/lenient_zip_entry_detection.rs +++ b/crates/zip/tests/it/lenient_zip_entry_detection.rs @@ -1,9 +1,8 @@ #![cfg(feature = "lenient")] // From Craft Anything crates/formats/tests/zip_entry_detection.rs. -use craft_zip::lenient::has_entry as zip_has_entry; -#[path = "lenient_common/mod.rs"] -mod common; +use super::common; use common::zip_stored; +use craft_zip::lenient::has_entry as zip_has_entry; /// A directory-shaped payload is ordinary file content, not an archive member. #[test] diff --git a/crates/zip/tests/lenient_zip_split_volumes.rs b/crates/zip/tests/it/lenient_zip_split_volumes.rs similarity index 99% rename from crates/zip/tests/lenient_zip_split_volumes.rs rename to crates/zip/tests/it/lenient_zip_split_volumes.rs index 9675177ce..9840cab45 100644 --- a/crates/zip/tests/lenient_zip_split_volumes.rs +++ b/crates/zip/tests/it/lenient_zip_split_volumes.rs @@ -1,9 +1,8 @@ #![cfg(feature = "lenient")] // From Craft Anything crates/formats/tests/zip_split_volumes.rs. -use craft_zip::lenient::{self as zip, ZipError}; -#[path = "lenient_common/mod.rs"] -mod common; +use super::common; use common::zip_stored; +use craft_zip::lenient::{self as zip, ZipError}; fn assert_split(data: &[u8]) { assert!(matches!(zip::parse(data, 10), Err(ZipError::Unsupported(_)))); diff --git a/crates/zip/tests/lenient_zip_stored_cap.rs b/crates/zip/tests/it/lenient_zip_stored_cap.rs similarity index 95% rename from crates/zip/tests/lenient_zip_stored_cap.rs rename to crates/zip/tests/it/lenient_zip_stored_cap.rs index a5424605f..1a23dc09f 100644 --- a/crates/zip/tests/lenient_zip_stored_cap.rs +++ b/crates/zip/tests/it/lenient_zip_stored_cap.rs @@ -1,8 +1,7 @@ #![cfg(feature = "lenient")] // From Craft Anything crates/formats/tests/zip_stored_cap.rs. -#[path = "lenient_common/mod.rs"] -mod common; +use super::common; use craft_zip::lenient::{self as zip, ZipError}; #[test] diff --git a/crates/zip/tests/it/main.rs b/crates/zip/tests/it/main.rs new file mode 100644 index 000000000..476a770fd --- /dev/null +++ b/crates/zip/tests/it/main.rs @@ -0,0 +1,15 @@ +//! The crate's integration tests, linked into one test binary. + +#[path = "../lenient_common/mod.rs"] +mod common; + +mod aligned_writer; +mod archive; +mod lenient_zip64_end_record_compatibility; +mod lenient_zip64_extra_boundaries; +mod lenient_zip_decoded_size; +mod lenient_zip_directory_bounds; +mod lenient_zip_entry_detection; +mod lenient_zip_split_volumes; +mod lenient_zip_stored_cap; +mod public_api; diff --git a/crates/zip/tests/public_api.rs b/crates/zip/tests/it/public_api.rs similarity index 100% rename from crates/zip/tests/public_api.rs rename to crates/zip/tests/it/public_api.rs From c4c3f08490823f3fb7243e2f08b5f80037c0f998 Mon Sep 17 00:00:00 2001 From: FredApps Date: Thu, 19 Nov 2026 12:57:58 +0100 Subject: [PATCH 06/22] Consolidate raster integration tests --- crates/raster-codecs/README.md | 2 +- crates/raster-codecs/tests/{ => it}/dds.rs | 0 crates/raster-codecs/tests/{ => it}/dds_write.rs | 2 +- crates/raster-codecs/tests/it/main.rs | 9 +++++++++ crates/raster-codecs/tests/{ => it}/pcx.rs | 0 crates/raster-codecs/tests/{ => it}/pnm.rs | 2 +- crates/raster-codecs/tests/{ => it}/roundtrip.rs | 0 crates/raster-codecs/tests/{ => it}/shared_contract.rs | 0 crates/raster-codecs/tests/{ => it}/xpm.rs | 0 9 files changed, 12 insertions(+), 3 deletions(-) rename crates/raster-codecs/tests/{ => it}/dds.rs (100%) rename crates/raster-codecs/tests/{ => it}/dds_write.rs (99%) create mode 100644 crates/raster-codecs/tests/it/main.rs rename crates/raster-codecs/tests/{ => it}/pcx.rs (100%) rename crates/raster-codecs/tests/{ => it}/pnm.rs (98%) rename crates/raster-codecs/tests/{ => it}/roundtrip.rs (100%) rename crates/raster-codecs/tests/{ => it}/shared_contract.rs (100%) rename crates/raster-codecs/tests/{ => it}/xpm.rs (100%) diff --git a/crates/raster-codecs/README.md b/crates/raster-codecs/README.md index fe8deace9..19b42b3dd 100644 --- a/crates/raster-codecs/README.md +++ b/crates/raster-codecs/README.md @@ -55,7 +55,7 @@ formats (plain PNM, XPM) reserve from the bytes present, not from the header. ## Tests -`cargo test -p craft-raster-codecs`. `tests/roundtrip.rs` writes every layout and depth each +`cargo test -p craft-raster-codecs`. `tests/it/roundtrip.rs` writes every layout and depth each writer stores and reads it back exactly, then truncates, bit-flips and overwrites header bytes of a valid file of every format: a reader may refuse, never panic. Two tests are ignored by default: a DDS encode timing, and a PNM peak-memory check that reads the process's RSS. diff --git a/crates/raster-codecs/tests/dds.rs b/crates/raster-codecs/tests/it/dds.rs similarity index 100% rename from crates/raster-codecs/tests/dds.rs rename to crates/raster-codecs/tests/it/dds.rs diff --git a/crates/raster-codecs/tests/dds_write.rs b/crates/raster-codecs/tests/it/dds_write.rs similarity index 99% rename from crates/raster-codecs/tests/dds_write.rs rename to crates/raster-codecs/tests/it/dds_write.rs index 7bfe339e0..bcec317dd 100644 --- a/crates/raster-codecs/tests/dds_write.rs +++ b/crates/raster-codecs/tests/it/dds_write.rs @@ -343,7 +343,7 @@ fn compression_names_round_trip() { /// Encode timings on a synthetic ~30 MP texture (6336×4752). Ignored by default; run in release: /// /// ```sh -/// cargo test --release -p craft-raster-codecs --test dds_write -- --ignored --nocapture +/// cargo test --release -p craft-raster-codecs --test it -- dds_write:: --ignored --nocapture /// ``` #[test] #[ignore] diff --git a/crates/raster-codecs/tests/it/main.rs b/crates/raster-codecs/tests/it/main.rs new file mode 100644 index 000000000..8127c1479 --- /dev/null +++ b/crates/raster-codecs/tests/it/main.rs @@ -0,0 +1,9 @@ +//! The crate's integration tests, linked into one test binary. + +mod dds; +mod dds_write; +mod pcx; +mod pnm; +mod roundtrip; +mod shared_contract; +mod xpm; diff --git a/crates/raster-codecs/tests/pcx.rs b/crates/raster-codecs/tests/it/pcx.rs similarity index 100% rename from crates/raster-codecs/tests/pcx.rs rename to crates/raster-codecs/tests/it/pcx.rs diff --git a/crates/raster-codecs/tests/pnm.rs b/crates/raster-codecs/tests/it/pnm.rs similarity index 98% rename from crates/raster-codecs/tests/pnm.rs rename to crates/raster-codecs/tests/it/pnm.rs index 1f2b6b9cf..55b7da2fc 100644 --- a/crates/raster-codecs/tests/pnm.rs +++ b/crates/raster-codecs/tests/it/pnm.rs @@ -184,7 +184,7 @@ fn pnm_valid_variants() { /// `Limits::max_alloc` budgets the decoded pixels, so the decoder must not build a wider scratch /// copy next to them (it once collected a `u32` per sample). Reads the process's peak RSS, so it -/// runs alone: `cargo test -p craft-raster-codecs --test pnm -- --ignored --test-threads 1`. +/// runs alone: `cargo test -p craft-raster-codecs --test it -- pnm::pnm_decode_peak_memory_stays_near_the_output_size --exact --ignored`. #[cfg(target_os = "linux")] #[test] #[ignore = "measures the peak RSS of the process; run it alone"] diff --git a/crates/raster-codecs/tests/roundtrip.rs b/crates/raster-codecs/tests/it/roundtrip.rs similarity index 100% rename from crates/raster-codecs/tests/roundtrip.rs rename to crates/raster-codecs/tests/it/roundtrip.rs diff --git a/crates/raster-codecs/tests/shared_contract.rs b/crates/raster-codecs/tests/it/shared_contract.rs similarity index 100% rename from crates/raster-codecs/tests/shared_contract.rs rename to crates/raster-codecs/tests/it/shared_contract.rs diff --git a/crates/raster-codecs/tests/xpm.rs b/crates/raster-codecs/tests/it/xpm.rs similarity index 100% rename from crates/raster-codecs/tests/xpm.rs rename to crates/raster-codecs/tests/it/xpm.rs From bcf05634ecb6b7422b3bd15ea3165f40ea78e683 Mon Sep 17 00:00:00 2001 From: FredApps Date: Thu, 19 Nov 2026 12:58:23 +0100 Subject: [PATCH 07/22] Consolidate pptx integration tests --- crates/pptx/tests/{ => it}/comments.rs | 2 +- crates/pptx/tests/it/main.rs | 10 ++++++++++ crates/pptx/tests/{ => it}/notes.rs | 2 +- crates/pptx/tests/{ => it}/read.rs | 0 crates/pptx/tests/{ => it}/timing.rs | 0 crates/pptx/tests/{ => it}/write.rs | 2 +- 6 files changed, 13 insertions(+), 3 deletions(-) rename crates/pptx/tests/{ => it}/comments.rs (99%) create mode 100644 crates/pptx/tests/it/main.rs rename crates/pptx/tests/{ => it}/notes.rs (99%) rename crates/pptx/tests/{ => it}/read.rs (100%) rename crates/pptx/tests/{ => it}/timing.rs (100%) rename crates/pptx/tests/{ => it}/write.rs (99%) diff --git a/crates/pptx/tests/comments.rs b/crates/pptx/tests/it/comments.rs similarity index 99% rename from crates/pptx/tests/comments.rs rename to crates/pptx/tests/it/comments.rs index 224ffec6e..66a44c510 100644 --- a/crates/pptx/tests/comments.rs +++ b/crates/pptx/tests/it/comments.rs @@ -1,7 +1,7 @@ //! Comment threads through PPTX: the modern part keeps replies and resolved state, the legacy //! part stays readable, and a package with both imports every thread once. -mod common; +use super::common; use std::sync::Arc; diff --git a/crates/pptx/tests/it/main.rs b/crates/pptx/tests/it/main.rs new file mode 100644 index 000000000..d128b81dc --- /dev/null +++ b/crates/pptx/tests/it/main.rs @@ -0,0 +1,10 @@ +//! The crate's integration tests, linked into one test binary. + +#[path = "../common/mod.rs"] +mod common; + +mod comments; +mod notes; +mod read; +mod timing; +mod write; diff --git a/crates/pptx/tests/notes.rs b/crates/pptx/tests/it/notes.rs similarity index 99% rename from crates/pptx/tests/notes.rs rename to crates/pptx/tests/it/notes.rs index 6d9500889..67600fba8 100644 --- a/crates/pptx/tests/notes.rs +++ b/crates/pptx/tests/it/notes.rs @@ -1,7 +1,7 @@ //! Speaker notes keep their run and paragraph formatting: a bold heading, indented points with //! custom bullets, plain lines. -mod common; +use super::common; use std::sync::Arc; diff --git a/crates/pptx/tests/read.rs b/crates/pptx/tests/it/read.rs similarity index 100% rename from crates/pptx/tests/read.rs rename to crates/pptx/tests/it/read.rs diff --git a/crates/pptx/tests/timing.rs b/crates/pptx/tests/it/timing.rs similarity index 100% rename from crates/pptx/tests/timing.rs rename to crates/pptx/tests/it/timing.rs diff --git a/crates/pptx/tests/write.rs b/crates/pptx/tests/it/write.rs similarity index 99% rename from crates/pptx/tests/write.rs rename to crates/pptx/tests/it/write.rs index 46f7513e7..46db7041d 100644 --- a/crates/pptx/tests/write.rs +++ b/crates/pptx/tests/it/write.rs @@ -1,6 +1,6 @@ //! The writer, read back with the reader. -mod common; +use super::common; use std::sync::Arc; From 4dec043f0f7b96ac572ea09ed5576a7092f43e74 Mon Sep 17 00:00:00 2001 From: FredApps Date: Thu, 19 Nov 2026 12:59:18 +0100 Subject: [PATCH 08/22] Consolidate sourcemap integration tests --- crates/sourcemap/tests/{ => it}/entry_budgets.rs | 0 crates/sourcemap/tests/{ => it}/external_sections.rs | 0 crates/sourcemap/tests/{ => it}/inventory_budgets.rs | 0 crates/sourcemap/tests/{ => it}/line_budgets.rs | 0 crates/sourcemap/tests/it/main.rs | 6 ++++++ crates/sourcemap/tests/{ => it}/root_prefix.rs | 0 crates/sourcemap/tests/{ => it}/section_columns.rs | 0 7 files changed, 6 insertions(+) rename crates/sourcemap/tests/{ => it}/entry_budgets.rs (100%) rename crates/sourcemap/tests/{ => it}/external_sections.rs (100%) rename crates/sourcemap/tests/{ => it}/inventory_budgets.rs (100%) rename crates/sourcemap/tests/{ => it}/line_budgets.rs (100%) create mode 100644 crates/sourcemap/tests/it/main.rs rename crates/sourcemap/tests/{ => it}/root_prefix.rs (100%) rename crates/sourcemap/tests/{ => it}/section_columns.rs (100%) diff --git a/crates/sourcemap/tests/entry_budgets.rs b/crates/sourcemap/tests/it/entry_budgets.rs similarity index 100% rename from crates/sourcemap/tests/entry_budgets.rs rename to crates/sourcemap/tests/it/entry_budgets.rs diff --git a/crates/sourcemap/tests/external_sections.rs b/crates/sourcemap/tests/it/external_sections.rs similarity index 100% rename from crates/sourcemap/tests/external_sections.rs rename to crates/sourcemap/tests/it/external_sections.rs diff --git a/crates/sourcemap/tests/inventory_budgets.rs b/crates/sourcemap/tests/it/inventory_budgets.rs similarity index 100% rename from crates/sourcemap/tests/inventory_budgets.rs rename to crates/sourcemap/tests/it/inventory_budgets.rs diff --git a/crates/sourcemap/tests/line_budgets.rs b/crates/sourcemap/tests/it/line_budgets.rs similarity index 100% rename from crates/sourcemap/tests/line_budgets.rs rename to crates/sourcemap/tests/it/line_budgets.rs diff --git a/crates/sourcemap/tests/it/main.rs b/crates/sourcemap/tests/it/main.rs new file mode 100644 index 000000000..a16f6704f --- /dev/null +++ b/crates/sourcemap/tests/it/main.rs @@ -0,0 +1,6 @@ +mod entry_budgets; +mod external_sections; +mod inventory_budgets; +mod line_budgets; +mod root_prefix; +mod section_columns; diff --git a/crates/sourcemap/tests/root_prefix.rs b/crates/sourcemap/tests/it/root_prefix.rs similarity index 100% rename from crates/sourcemap/tests/root_prefix.rs rename to crates/sourcemap/tests/it/root_prefix.rs diff --git a/crates/sourcemap/tests/section_columns.rs b/crates/sourcemap/tests/it/section_columns.rs similarity index 100% rename from crates/sourcemap/tests/section_columns.rs rename to crates/sourcemap/tests/it/section_columns.rs From f8b57146ff634a97b177a8014cf959b0f82916be Mon Sep 17 00:00:00 2001 From: FredApps Date: Thu, 19 Nov 2026 13:00:22 +0100 Subject: [PATCH 09/22] Consolidate idml integration tests --- crates/idml/tests/{ => it}/icml.rs | 0 crates/idml/tests/it/main.rs | 6 ++++++ crates/idml/tests/{ => it}/model.rs | 0 crates/idml/tests/{ => it}/package.rs | 0 crates/idml/tests/{ => it}/resources.rs | 0 crates/idml/tests/{ => it}/story.rs | 0 crates/idml/tests/{ => it}/value.rs | 0 7 files changed, 6 insertions(+) rename crates/idml/tests/{ => it}/icml.rs (100%) create mode 100644 crates/idml/tests/it/main.rs rename crates/idml/tests/{ => it}/model.rs (100%) rename crates/idml/tests/{ => it}/package.rs (100%) rename crates/idml/tests/{ => it}/resources.rs (100%) rename crates/idml/tests/{ => it}/story.rs (100%) rename crates/idml/tests/{ => it}/value.rs (100%) diff --git a/crates/idml/tests/icml.rs b/crates/idml/tests/it/icml.rs similarity index 100% rename from crates/idml/tests/icml.rs rename to crates/idml/tests/it/icml.rs diff --git a/crates/idml/tests/it/main.rs b/crates/idml/tests/it/main.rs new file mode 100644 index 000000000..a040c5662 --- /dev/null +++ b/crates/idml/tests/it/main.rs @@ -0,0 +1,6 @@ +mod icml; +mod model; +mod package; +mod resources; +mod story; +mod value; diff --git a/crates/idml/tests/model.rs b/crates/idml/tests/it/model.rs similarity index 100% rename from crates/idml/tests/model.rs rename to crates/idml/tests/it/model.rs diff --git a/crates/idml/tests/package.rs b/crates/idml/tests/it/package.rs similarity index 100% rename from crates/idml/tests/package.rs rename to crates/idml/tests/it/package.rs diff --git a/crates/idml/tests/resources.rs b/crates/idml/tests/it/resources.rs similarity index 100% rename from crates/idml/tests/resources.rs rename to crates/idml/tests/it/resources.rs diff --git a/crates/idml/tests/story.rs b/crates/idml/tests/it/story.rs similarity index 100% rename from crates/idml/tests/story.rs rename to crates/idml/tests/it/story.rs diff --git a/crates/idml/tests/value.rs b/crates/idml/tests/it/value.rs similarity index 100% rename from crates/idml/tests/value.rs rename to crates/idml/tests/it/value.rs From fd1dc355a5ea465c9130228d66f0be0915a1f006 Mon Sep 17 00:00:00 2001 From: FredApps Date: Thu, 19 Nov 2026 13:02:42 +0100 Subject: [PATCH 10/22] Consolidate cloud integration tests --- crates/cloud-local/tests/{ => it}/backend.rs | 0 crates/cloud-local/tests/{ => it}/confinement_regressions.rs | 0 crates/cloud-local/tests/it/main.rs | 3 +++ crates/cloud-local/tests/{ => it}/save_path_regressions.rs | 0 crates/cloud-ui/tests/it/main.rs | 4 ++++ crates/cloud-ui/tests/{ => it}/renders.rs | 0 crates/cloud-ui/tests/{ => it}/share_dialog.rs | 0 7 files changed, 7 insertions(+) rename crates/cloud-local/tests/{ => it}/backend.rs (100%) rename crates/cloud-local/tests/{ => it}/confinement_regressions.rs (100%) create mode 100644 crates/cloud-local/tests/it/main.rs rename crates/cloud-local/tests/{ => it}/save_path_regressions.rs (100%) create mode 100644 crates/cloud-ui/tests/it/main.rs rename crates/cloud-ui/tests/{ => it}/renders.rs (100%) rename crates/cloud-ui/tests/{ => it}/share_dialog.rs (100%) diff --git a/crates/cloud-local/tests/backend.rs b/crates/cloud-local/tests/it/backend.rs similarity index 100% rename from crates/cloud-local/tests/backend.rs rename to crates/cloud-local/tests/it/backend.rs diff --git a/crates/cloud-local/tests/confinement_regressions.rs b/crates/cloud-local/tests/it/confinement_regressions.rs similarity index 100% rename from crates/cloud-local/tests/confinement_regressions.rs rename to crates/cloud-local/tests/it/confinement_regressions.rs diff --git a/crates/cloud-local/tests/it/main.rs b/crates/cloud-local/tests/it/main.rs new file mode 100644 index 000000000..6b861a9dd --- /dev/null +++ b/crates/cloud-local/tests/it/main.rs @@ -0,0 +1,3 @@ +mod backend; +mod confinement_regressions; +mod save_path_regressions; diff --git a/crates/cloud-local/tests/save_path_regressions.rs b/crates/cloud-local/tests/it/save_path_regressions.rs similarity index 100% rename from crates/cloud-local/tests/save_path_regressions.rs rename to crates/cloud-local/tests/it/save_path_regressions.rs diff --git a/crates/cloud-ui/tests/it/main.rs b/crates/cloud-ui/tests/it/main.rs new file mode 100644 index 000000000..69cfaf5b0 --- /dev/null +++ b/crates/cloud-ui/tests/it/main.rs @@ -0,0 +1,4 @@ +//! The crate's integration tests, linked into one test binary. + +mod renders; +mod share_dialog; diff --git a/crates/cloud-ui/tests/renders.rs b/crates/cloud-ui/tests/it/renders.rs similarity index 100% rename from crates/cloud-ui/tests/renders.rs rename to crates/cloud-ui/tests/it/renders.rs diff --git a/crates/cloud-ui/tests/share_dialog.rs b/crates/cloud-ui/tests/it/share_dialog.rs similarity index 100% rename from crates/cloud-ui/tests/share_dialog.rs rename to crates/cloud-ui/tests/it/share_dialog.rs From 8003c9b8d22bd4f8e130da0aedd35e155060f07b Mon Sep 17 00:00:00 2001 From: FredApps Date: Thu, 19 Nov 2026 13:05:21 +0100 Subject: [PATCH 11/22] Consolidate related dxf and prc tests --- crates/prc/tests/{ => it}/container.rs | 0 crates/prc/tests/it/main.rs | 2 ++ crates/prc/tests/{ => it}/proptests.rs | 0 3 files changed, 2 insertions(+) rename crates/prc/tests/{ => it}/container.rs (100%) create mode 100644 crates/prc/tests/it/main.rs rename crates/prc/tests/{ => it}/proptests.rs (100%) diff --git a/crates/prc/tests/container.rs b/crates/prc/tests/it/container.rs similarity index 100% rename from crates/prc/tests/container.rs rename to crates/prc/tests/it/container.rs diff --git a/crates/prc/tests/it/main.rs b/crates/prc/tests/it/main.rs new file mode 100644 index 000000000..6f502444d --- /dev/null +++ b/crates/prc/tests/it/main.rs @@ -0,0 +1,2 @@ +mod container; +mod proptests; diff --git a/crates/prc/tests/proptests.rs b/crates/prc/tests/it/proptests.rs similarity index 100% rename from crates/prc/tests/proptests.rs rename to crates/prc/tests/it/proptests.rs From dfe722af6288cd0b9ac87880468f15472fefe534 Mon Sep 17 00:00:00 2001 From: FredApps Date: Thu, 19 Nov 2026 13:05:37 +0100 Subject: [PATCH 12/22] Consolidate related image tests --- .../image-codecs/tests/{ => it}/jxl_decode.rs | 0 .../image-codecs/tests/{ => it}/jxl_export.rs | 0 .../tests/{ => it}/legacy_tiff_raw.rs | 0 crates/image-codecs/tests/it/main.rs | 6 +++++ .../tests/{ => it}/pnm_peak_memory.rs | 26 ++++++++++++++++--- .../tests/{ => it}/ifd0_orientation_compat.rs | 0 crates/metadata/tests/it/main.rs | 2 ++ crates/psd/tests/{ => it}/atn_sidecar.rs | 0 crates/psd/tests/{ => it}/csh.rs | 0 crates/psd/tests/it/main.rs | 5 ++++ .../psd/tests/{ => it}/metadata_resources.rs | 0 crates/psd/tests/{ => it}/resource_limits.rs | 0 12 files changed, 36 insertions(+), 3 deletions(-) rename crates/image-codecs/tests/{ => it}/jxl_decode.rs (100%) rename crates/image-codecs/tests/{ => it}/jxl_export.rs (100%) rename crates/image-codecs/tests/{ => it}/legacy_tiff_raw.rs (100%) rename crates/image-codecs/tests/{ => it}/pnm_peak_memory.rs (57%) rename crates/metadata/tests/{ => it}/ifd0_orientation_compat.rs (100%) rename crates/psd/tests/{ => it}/atn_sidecar.rs (100%) rename crates/psd/tests/{ => it}/csh.rs (100%) rename crates/psd/tests/{ => it}/metadata_resources.rs (100%) rename crates/psd/tests/{ => it}/resource_limits.rs (100%) diff --git a/crates/image-codecs/tests/jxl_decode.rs b/crates/image-codecs/tests/it/jxl_decode.rs similarity index 100% rename from crates/image-codecs/tests/jxl_decode.rs rename to crates/image-codecs/tests/it/jxl_decode.rs diff --git a/crates/image-codecs/tests/jxl_export.rs b/crates/image-codecs/tests/it/jxl_export.rs similarity index 100% rename from crates/image-codecs/tests/jxl_export.rs rename to crates/image-codecs/tests/it/jxl_export.rs diff --git a/crates/image-codecs/tests/legacy_tiff_raw.rs b/crates/image-codecs/tests/it/legacy_tiff_raw.rs similarity index 100% rename from crates/image-codecs/tests/legacy_tiff_raw.rs rename to crates/image-codecs/tests/it/legacy_tiff_raw.rs diff --git a/crates/image-codecs/tests/it/main.rs b/crates/image-codecs/tests/it/main.rs index e3c0feaaf..8fba454b9 100644 --- a/crates/image-codecs/tests/it/main.rs +++ b/crates/image-codecs/tests/it/main.rs @@ -25,6 +25,8 @@ mod orientation; mod pcx; mod png_jpeg; mod pnm_headers; +#[cfg(target_os = "linux")] +mod pnm_peak_memory; mod resolution; mod roundtrip; mod source_settings; @@ -41,3 +43,7 @@ mod tiff_ycbcr; mod webp_frames; mod webp_lossy; mod xpm; + +mod jxl_decode; +mod jxl_export; +mod legacy_tiff_raw; diff --git a/crates/image-codecs/tests/pnm_peak_memory.rs b/crates/image-codecs/tests/it/pnm_peak_memory.rs similarity index 57% rename from crates/image-codecs/tests/pnm_peak_memory.rs rename to crates/image-codecs/tests/it/pnm_peak_memory.rs index 33bf39b3c..5a9cfecd9 100644 --- a/crates/image-codecs/tests/pnm_peak_memory.rs +++ b/crates/image-codecs/tests/it/pnm_peak_memory.rs @@ -1,10 +1,9 @@ //! #2938: `Limits::max_alloc` budgets the decoded pixel buffer, so the PNM decoder must not build a //! wider scratch copy (it used to collect one `u32` per sample, four times an 8-bit image) next to it. //! -//! This file holds a single test so it runs in its own process: it reads the process's peak RSS +//! This probe re-runs the test in an isolated process: it reads the process's peak RSS //! (`VmHWM`, Linux only) and nothing else may allocate meanwhile. -#[cfg(target_os = "linux")] fn peak_rss_bytes() -> Option { let status = std::fs::read_to_string("/proc/self/status").ok()?; let line = status.lines().find(|l| l.starts_with("VmHWM:"))?; @@ -12,9 +11,30 @@ fn peak_rss_bytes() -> Option { Some(kib * 1024) } -#[cfg(target_os = "linux")] #[test] fn pnm_decode_peak_memory_stays_near_the_output_size() { + const CHILD: &str = "CRAFT_IMAGE_CODECS_PNM_RSS_CHILD"; + const DONE: &str = "PNM RSS probe completed"; + if std::env::var_os(CHILD).is_some() { + measure_peak_memory(); + println!("{DONE}"); + return; + } + + // Cargo can run other tests concurrently in this harness. Start a fresh process + // with only this test selected so its allocations are the only ones being measured. + let output = std::process::Command::new(std::env::current_exe().expect("image codec test executable")) + .args(["--exact", "pnm_peak_memory::pnm_decode_peak_memory_stays_near_the_output_size", "--nocapture", "--test-threads=1"]) + .env(CHILD, "1") + .output() + .expect("start isolated PNM RSS probe"); + let stdout = String::from_utf8_lossy(&output.stdout); + let stderr = String::from_utf8_lossy(&output.stderr); + // A stale filter can select zero tests and exit successfully. + assert!(output.status.success() && stdout.lines().any(|line| line.ends_with(DONE)), "{stdout}\n{stderr}"); +} + +fn measure_peak_memory() { use craft_image_codecs::*; const SIDE: u32 = 4096; // 16 MiB of 8-bit gray output diff --git a/crates/metadata/tests/ifd0_orientation_compat.rs b/crates/metadata/tests/it/ifd0_orientation_compat.rs similarity index 100% rename from crates/metadata/tests/ifd0_orientation_compat.rs rename to crates/metadata/tests/it/ifd0_orientation_compat.rs diff --git a/crates/metadata/tests/it/main.rs b/crates/metadata/tests/it/main.rs index 4e460020c..8a2291727 100644 --- a/crates/metadata/tests/it/main.rs +++ b/crates/metadata/tests/it/main.rs @@ -5,3 +5,5 @@ mod edit_orientation; mod edit_pixel_size; mod edit_resolution; mod robust; + +mod ifd0_orientation_compat; diff --git a/crates/psd/tests/atn_sidecar.rs b/crates/psd/tests/it/atn_sidecar.rs similarity index 100% rename from crates/psd/tests/atn_sidecar.rs rename to crates/psd/tests/it/atn_sidecar.rs diff --git a/crates/psd/tests/csh.rs b/crates/psd/tests/it/csh.rs similarity index 100% rename from crates/psd/tests/csh.rs rename to crates/psd/tests/it/csh.rs diff --git a/crates/psd/tests/it/main.rs b/crates/psd/tests/it/main.rs index 3bb60a8d9..4e78641e6 100644 --- a/crates/psd/tests/it/main.rs +++ b/crates/psd/tests/it/main.rs @@ -32,3 +32,8 @@ fn tests_build_with_the_test_support_feature() { assert_eq!(file.header.version, craft_psd::Version::Psd); let _sample: fn(u32, u32, u32, bool) -> u8 = craft_psd::fixtures::sample; } + +mod atn_sidecar; +mod csh; +mod metadata_resources; +mod resource_limits; diff --git a/crates/psd/tests/metadata_resources.rs b/crates/psd/tests/it/metadata_resources.rs similarity index 100% rename from crates/psd/tests/metadata_resources.rs rename to crates/psd/tests/it/metadata_resources.rs diff --git a/crates/psd/tests/resource_limits.rs b/crates/psd/tests/it/resource_limits.rs similarity index 100% rename from crates/psd/tests/resource_limits.rs rename to crates/psd/tests/it/resource_limits.rs From 39de15147ce277463c749792e9825966f6f98fd8 Mon Sep 17 00:00:00 2001 From: FredApps Date: Thu, 19 Nov 2026 13:05:56 +0100 Subject: [PATCH 13/22] Consolidate related office tests --- crates/docx/tests/application_name.rs | 19 ------------ crates/docx/tests/it/application_name.rs | 31 +++++++++++++++++++ crates/docx/tests/it/main.rs | 4 +++ .../docx/tests/{ => it}/matrix_save_size.rs | 0 crates/docx/tests/{ => it}/protection.rs | 0 crates/xls/tests/it/main.rs | 9 ++++++ crates/xls/tests/{ => it}/objects.rs | 2 +- crates/xls/tests/{ => it}/read.rs | 2 +- crates/xls/tests/{ => it}/styles.rs | 2 +- crates/xls/tests/{ => it}/validation.rs | 2 +- crates/xlsx/tests/it/main.rs | 10 ++++++ crates/xlsx/tests/{ => it}/pivot.rs | 0 crates/xlsx/tests/{ => it}/richdata.rs | 0 crates/xlsx/tests/{ => it}/write.rs | 0 crates/xlsx/tests/{ => it}/xlsb.rs | 2 +- crates/xlsx/tests/{ => it}/xlsx.rs | 2 +- 16 files changed, 60 insertions(+), 25 deletions(-) delete mode 100644 crates/docx/tests/application_name.rs create mode 100644 crates/docx/tests/it/application_name.rs rename crates/docx/tests/{ => it}/matrix_save_size.rs (100%) rename crates/docx/tests/{ => it}/protection.rs (100%) create mode 100644 crates/xls/tests/it/main.rs rename crates/xls/tests/{ => it}/objects.rs (99%) rename crates/xls/tests/{ => it}/read.rs (99%) rename crates/xls/tests/{ => it}/styles.rs (99%) rename crates/xls/tests/{ => it}/validation.rs (99%) create mode 100644 crates/xlsx/tests/it/main.rs rename crates/xlsx/tests/{ => it}/pivot.rs (100%) rename crates/xlsx/tests/{ => it}/richdata.rs (100%) rename crates/xlsx/tests/{ => it}/write.rs (100%) rename crates/xlsx/tests/{ => it}/xlsb.rs (99%) rename crates/xlsx/tests/{ => it}/xlsx.rs (99%) diff --git a/crates/docx/tests/application_name.rs b/crates/docx/tests/application_name.rs deleted file mode 100644 index 1973e63ae..000000000 --- a/crates/docx/tests/application_name.rs +++ /dev/null @@ -1,19 +0,0 @@ -//! An app that embeds the writer names itself in `docProps/app.xml` (its own test binary: the -//! name is set once per process). - -use std::io::Read; - -#[test] -fn the_embedding_app_names_itself_in_app_xml() { - assert_eq!(craft_docx::application_name(), "WordCraft", "the default"); - craft_docx::set_application_name("Example Writer"); - craft_docx::set_application_name("Other"); - assert_eq!(craft_docx::application_name(), "Example Writer", "only the first call counts"); - let mut d = craft_wordmodel::Document::new(); - d.body = vec![craft_wordmodel::para_block(craft_wordmodel::Paragraph::with_text("Text", Default::default()))]; - let bytes = craft_docx::write(&d).unwrap(); - let mut z = zip::ZipArchive::new(std::io::Cursor::new(&bytes)).unwrap(); - let mut app = String::new(); - z.by_name("docProps/app.xml").unwrap().read_to_string(&mut app).unwrap(); - assert!(app.contains("Example Writer"), "{app}"); -} diff --git a/crates/docx/tests/it/application_name.rs b/crates/docx/tests/it/application_name.rs new file mode 100644 index 000000000..ea14f31e7 --- /dev/null +++ b/crates/docx/tests/it/application_name.rs @@ -0,0 +1,31 @@ +//! The embedding app sets its name once per process. Exercise the setter in a fresh copy of the test binary. + +use std::io::Read; + +#[test] +fn the_embedding_app_names_itself_in_app_xml() { + const CHILD: &str = "CRAFT_DOCX_APP_NAME_CHILD"; + if std::env::var_os(CHILD).is_none() { + let output = std::process::Command::new(std::env::current_exe().expect("DOCX test executable")) + .args(["--exact", "application_name::the_embedding_app_names_itself_in_app_xml", "--nocapture"]) + .env(CHILD, "1") + .output() + .expect("run the application name test in a fresh process"); + let stdout = String::from_utf8_lossy(&output.stdout); + let stderr = String::from_utf8_lossy(&output.stderr); + assert!(output.status.success() && stdout.contains("application name verified"), "{stdout}\n{stderr}"); + return; + } + assert_eq!(craft_docx::application_name(), "WordCraft", "the default"); + craft_docx::set_application_name("Example Writer"); + craft_docx::set_application_name("Other"); + assert_eq!(craft_docx::application_name(), "Example Writer", "only the first call counts"); + let mut d = craft_wordmodel::Document::new(); + d.body = vec![craft_wordmodel::para_block(craft_wordmodel::Paragraph::with_text("Text", Default::default()))]; + let bytes = craft_docx::write(&d).unwrap(); + let mut z = zip::ZipArchive::new(std::io::Cursor::new(&bytes)).unwrap(); + let mut app = String::new(); + z.by_name("docProps/app.xml").unwrap().read_to_string(&mut app).unwrap(); + assert!(app.contains("Example Writer"), "{app}"); + println!("application name verified"); +} diff --git a/crates/docx/tests/it/main.rs b/crates/docx/tests/it/main.rs index 2c44700ec..1a18aeaed 100644 --- a/crates/docx/tests/it/main.rs +++ b/crates/docx/tests/it/main.rs @@ -58,3 +58,7 @@ mod vml_shapes; mod word_xml; mod wordml2003_write; mod wps_fallback; + +mod application_name; +mod matrix_save_size; +mod protection; diff --git a/crates/docx/tests/matrix_save_size.rs b/crates/docx/tests/it/matrix_save_size.rs similarity index 100% rename from crates/docx/tests/matrix_save_size.rs rename to crates/docx/tests/it/matrix_save_size.rs diff --git a/crates/docx/tests/protection.rs b/crates/docx/tests/it/protection.rs similarity index 100% rename from crates/docx/tests/protection.rs rename to crates/docx/tests/it/protection.rs diff --git a/crates/xls/tests/it/main.rs b/crates/xls/tests/it/main.rs new file mode 100644 index 000000000..02814fe24 --- /dev/null +++ b/crates/xls/tests/it/main.rs @@ -0,0 +1,9 @@ +//! The crate's integration tests, linked into one test binary. + +#[path = "../common/mod.rs"] +mod common; + +mod objects; +mod read; +mod styles; +mod validation; diff --git a/crates/xls/tests/objects.rs b/crates/xls/tests/it/objects.rs similarity index 99% rename from crates/xls/tests/objects.rs rename to crates/xls/tests/it/objects.rs index 2c409b0f3..56f66cdae 100644 --- a/crates/xls/tests/objects.rs +++ b/crates/xls/tests/it/objects.rs @@ -2,7 +2,7 @@ //! from [MS-XLS] and [MS-ODRAW]; no Excel-produced file is used. Ported from //! storytold/gridcraft#3457, with tests for the fixes its review asked for. -mod common; +use super::common; use common::*; use craft_xls::{ClientAnchor, Color, ConditionRule, DxfFill, Operator, Pattern, Range, Workbook}; diff --git a/crates/xls/tests/read.rs b/crates/xls/tests/it/read.rs similarity index 99% rename from crates/xls/tests/read.rs rename to crates/xls/tests/it/read.rs index f4360b5e0..0c5e91eb8 100644 --- a/crates/xls/tests/read.rs +++ b/crates/xls/tests/it/read.rs @@ -1,6 +1,6 @@ //! Reading BIFF8 workbooks: values, formulas, layout, names, limits and hostile input. -mod common; +use super::common; use common::{ at, bof, cat, cell, compound, eof, exp, fmt, formula, ftext, num, ptg_int, ptg_ref, put32, read_limited, read_xls, rec, special, text, u16s, v, diff --git a/crates/xls/tests/styles.rs b/crates/xls/tests/it/styles.rs similarity index 99% rename from crates/xls/tests/styles.rs rename to crates/xls/tests/it/styles.rs index b948fd9c1..6ed43f49f 100644 --- a/crates/xls/tests/styles.rs +++ b/crates/xls/tests/it/styles.rs @@ -1,7 +1,7 @@ //! Cell formatting: Font, XF, Palette and Style records. Every workbook is assembled here from //! the [MS-XLS] structures; no Excel-produced file is used. -mod common; +use super::common; use common::{at, bof, compound, eof, read_xls, rec, u16s, v}; use craft_xls::{BorderLine, BorderStyle, CellFormat, Color, DEFAULT_PALETTE, Fill, HAlign, Pattern, Script, Underline, VAlign, Value, Workbook}; diff --git a/crates/xls/tests/validation.rs b/crates/xls/tests/it/validation.rs similarity index 99% rename from crates/xls/tests/validation.rs rename to crates/xls/tests/it/validation.rs index 5ff4a43e3..ed99c79cf 100644 --- a/crates/xls/tests/validation.rs +++ b/crates/xls/tests/it/validation.rs @@ -2,7 +2,7 @@ //! spec's structures; no Excel-produced file is used. The expected rules are what a //! SpreadsheetML reader gives for the same rule. Ported from storytold/gridcraft#3636. -mod common; +use super::common; use common::*; use craft_xls::{CellRef, DataValidation, ErrorStyle, Operator, Range, ValidationType, Workbook}; diff --git a/crates/xlsx/tests/it/main.rs b/crates/xlsx/tests/it/main.rs new file mode 100644 index 000000000..ca54b2347 --- /dev/null +++ b/crates/xlsx/tests/it/main.rs @@ -0,0 +1,10 @@ +//! The crate's integration tests, linked into one test binary. + +#[path = "../common/mod.rs"] +mod common; + +mod pivot; +mod richdata; +mod write; +mod xlsb; +mod xlsx; diff --git a/crates/xlsx/tests/pivot.rs b/crates/xlsx/tests/it/pivot.rs similarity index 100% rename from crates/xlsx/tests/pivot.rs rename to crates/xlsx/tests/it/pivot.rs diff --git a/crates/xlsx/tests/richdata.rs b/crates/xlsx/tests/it/richdata.rs similarity index 100% rename from crates/xlsx/tests/richdata.rs rename to crates/xlsx/tests/it/richdata.rs diff --git a/crates/xlsx/tests/write.rs b/crates/xlsx/tests/it/write.rs similarity index 100% rename from crates/xlsx/tests/write.rs rename to crates/xlsx/tests/it/write.rs diff --git a/crates/xlsx/tests/xlsb.rs b/crates/xlsx/tests/it/xlsb.rs similarity index 99% rename from crates/xlsx/tests/xlsb.rs rename to crates/xlsx/tests/it/xlsb.rs index ef1464dd4..8e0a25060 100644 --- a/crates/xlsx/tests/xlsb.rs +++ b/crates/xlsx/tests/it/xlsb.rs @@ -1,7 +1,7 @@ //! Binary workbooks: BIFF12 records and packages assembled here from [MS-XLSB]. //! Adapted from GridCraft's `crates/xlsx/src/tests/xlsb_tests.rs`. -mod common; +use super::common; use common::{read, read_with}; use craft_xlsx::testing::zip; diff --git a/crates/xlsx/tests/xlsx.rs b/crates/xlsx/tests/it/xlsx.rs similarity index 99% rename from crates/xlsx/tests/xlsx.rs rename to crates/xlsx/tests/it/xlsx.rs index b5ebdf2c7..6cf5ea2c8 100644 --- a/crates/xlsx/tests/xlsx.rs +++ b/crates/xlsx/tests/it/xlsx.rs @@ -1,6 +1,6 @@ //! SpreadsheetML workbooks through the part layer. -mod common; +use super::common; use common::{read, read_with}; use craft_xlsx::testing::{workbook, zip}; From 1b59913603493e7761ff1636830368f4823f1da3 Mon Sep 17 00:00:00 2001 From: FredApps Date: Thu, 19 Nov 2026 13:06:16 +0100 Subject: [PATCH 14/22] Consolidate related markup tests --- crates/plist/tests/{ => it}/limits.rs | 0 crates/plist/tests/it/main.rs | 5 +++++ crates/plist/tests/{ => it}/plist_line_endings.rs | 0 crates/plist/tests/{ => it}/plist_marker_widths.rs | 0 crates/plist/tests/{ => it}/plist_object_bounds.rs | 0 crates/plist/tests/{ => it}/plist_quoted_attributes.rs | 0 crates/xml/tests/{ => it}/apps.rs | 0 crates/xml/tests/{ => it}/hostile.rs | 0 crates/xml/tests/it/main.rs | 3 +++ crates/xml/tests/{ => it}/write.rs | 0 10 files changed, 8 insertions(+) rename crates/plist/tests/{ => it}/limits.rs (100%) create mode 100644 crates/plist/tests/it/main.rs rename crates/plist/tests/{ => it}/plist_line_endings.rs (100%) rename crates/plist/tests/{ => it}/plist_marker_widths.rs (100%) rename crates/plist/tests/{ => it}/plist_object_bounds.rs (100%) rename crates/plist/tests/{ => it}/plist_quoted_attributes.rs (100%) rename crates/xml/tests/{ => it}/apps.rs (100%) rename crates/xml/tests/{ => it}/hostile.rs (100%) create mode 100644 crates/xml/tests/it/main.rs rename crates/xml/tests/{ => it}/write.rs (100%) diff --git a/crates/plist/tests/limits.rs b/crates/plist/tests/it/limits.rs similarity index 100% rename from crates/plist/tests/limits.rs rename to crates/plist/tests/it/limits.rs diff --git a/crates/plist/tests/it/main.rs b/crates/plist/tests/it/main.rs new file mode 100644 index 000000000..c68e1f74d --- /dev/null +++ b/crates/plist/tests/it/main.rs @@ -0,0 +1,5 @@ +mod limits; +mod plist_line_endings; +mod plist_marker_widths; +mod plist_object_bounds; +mod plist_quoted_attributes; diff --git a/crates/plist/tests/plist_line_endings.rs b/crates/plist/tests/it/plist_line_endings.rs similarity index 100% rename from crates/plist/tests/plist_line_endings.rs rename to crates/plist/tests/it/plist_line_endings.rs diff --git a/crates/plist/tests/plist_marker_widths.rs b/crates/plist/tests/it/plist_marker_widths.rs similarity index 100% rename from crates/plist/tests/plist_marker_widths.rs rename to crates/plist/tests/it/plist_marker_widths.rs diff --git a/crates/plist/tests/plist_object_bounds.rs b/crates/plist/tests/it/plist_object_bounds.rs similarity index 100% rename from crates/plist/tests/plist_object_bounds.rs rename to crates/plist/tests/it/plist_object_bounds.rs diff --git a/crates/plist/tests/plist_quoted_attributes.rs b/crates/plist/tests/it/plist_quoted_attributes.rs similarity index 100% rename from crates/plist/tests/plist_quoted_attributes.rs rename to crates/plist/tests/it/plist_quoted_attributes.rs diff --git a/crates/xml/tests/apps.rs b/crates/xml/tests/it/apps.rs similarity index 100% rename from crates/xml/tests/apps.rs rename to crates/xml/tests/it/apps.rs diff --git a/crates/xml/tests/hostile.rs b/crates/xml/tests/it/hostile.rs similarity index 100% rename from crates/xml/tests/hostile.rs rename to crates/xml/tests/it/hostile.rs diff --git a/crates/xml/tests/it/main.rs b/crates/xml/tests/it/main.rs new file mode 100644 index 000000000..1be6582c1 --- /dev/null +++ b/crates/xml/tests/it/main.rs @@ -0,0 +1,3 @@ +mod apps; +mod hostile; +mod write; diff --git a/crates/xml/tests/write.rs b/crates/xml/tests/it/write.rs similarity index 100% rename from crates/xml/tests/write.rs rename to crates/xml/tests/it/write.rs From 66179f4eca5c9c0383bae8b7e8eab102e2ec9f61 Mon Sep 17 00:00:00 2001 From: FredApps Date: Thu, 19 Nov 2026 13:06:40 +0100 Subject: [PATCH 15/22] Consolidate related books tests --- crates/epub/tests/it/main.rs | 3 +++ crates/epub/tests/{ => it}/read.rs | 0 crates/epub/tests/{ => it}/toc.rs | 0 crates/epub/tests/{ => it}/write.rs | 0 crates/math/tests/{ => it}/corpus.rs | 0 crates/math/tests/it/main.rs | 2 ++ crates/math/tests/{ => it}/omml_latex.rs | 0 7 files changed, 5 insertions(+) create mode 100644 crates/epub/tests/it/main.rs rename crates/epub/tests/{ => it}/read.rs (100%) rename crates/epub/tests/{ => it}/toc.rs (100%) rename crates/epub/tests/{ => it}/write.rs (100%) rename crates/math/tests/{ => it}/corpus.rs (100%) create mode 100644 crates/math/tests/it/main.rs rename crates/math/tests/{ => it}/omml_latex.rs (100%) diff --git a/crates/epub/tests/it/main.rs b/crates/epub/tests/it/main.rs new file mode 100644 index 000000000..b2cf3a5cd --- /dev/null +++ b/crates/epub/tests/it/main.rs @@ -0,0 +1,3 @@ +mod read; +mod toc; +mod write; diff --git a/crates/epub/tests/read.rs b/crates/epub/tests/it/read.rs similarity index 100% rename from crates/epub/tests/read.rs rename to crates/epub/tests/it/read.rs diff --git a/crates/epub/tests/toc.rs b/crates/epub/tests/it/toc.rs similarity index 100% rename from crates/epub/tests/toc.rs rename to crates/epub/tests/it/toc.rs diff --git a/crates/epub/tests/write.rs b/crates/epub/tests/it/write.rs similarity index 100% rename from crates/epub/tests/write.rs rename to crates/epub/tests/it/write.rs diff --git a/crates/math/tests/corpus.rs b/crates/math/tests/it/corpus.rs similarity index 100% rename from crates/math/tests/corpus.rs rename to crates/math/tests/it/corpus.rs diff --git a/crates/math/tests/it/main.rs b/crates/math/tests/it/main.rs new file mode 100644 index 000000000..af10f69e2 --- /dev/null +++ b/crates/math/tests/it/main.rs @@ -0,0 +1,2 @@ +mod corpus; +mod omml_latex; diff --git a/crates/math/tests/omml_latex.rs b/crates/math/tests/it/omml_latex.rs similarity index 100% rename from crates/math/tests/omml_latex.rs rename to crates/math/tests/it/omml_latex.rs From 62f44de3d6b6ef6144e73ea797ce3feaf556b290 Mon Sep 17 00:00:00 2001 From: FredApps Date: Thu, 19 Nov 2026 13:07:16 +0100 Subject: [PATCH 16/22] Consolidate related support tests --- crates/proof/README.md | 2 +- crates/proof/tests/{ => it}/affix_compatibility.rs | 6 +++--- crates/proof/tests/{ => it}/french_dictionary.rs | 0 crates/proof/tests/{ => it}/french_packs.rs | 3 +-- crates/proof/tests/it/main.rs | 8 ++++++++ crates/testkit/tests/{ => it}/guards.rs | 0 crates/testkit/tests/it/main.rs | 4 ++++ crates/testkit/tests/{ => it}/source_limits.rs | 0 8 files changed, 17 insertions(+), 6 deletions(-) rename crates/proof/tests/{ => it}/affix_compatibility.rs (95%) rename crates/proof/tests/{ => it}/french_dictionary.rs (100%) rename crates/proof/tests/{ => it}/french_packs.rs (99%) create mode 100644 crates/proof/tests/it/main.rs rename crates/testkit/tests/{ => it}/guards.rs (100%) create mode 100644 crates/testkit/tests/it/main.rs rename crates/testkit/tests/{ => it}/source_limits.rs (100%) diff --git a/crates/proof/README.md b/crates/proof/README.md index 231b7b9dc..bbf39f7be 100644 --- a/crates/proof/README.md +++ b/crates/proof/README.md @@ -244,7 +244,7 @@ NFC/NFD lookup with original ranges, suggestions and pack hyphenation. The opt-i dictionary gate fails when its input is missing; it never silently skips its assertions: ```sh -WORDCRAFT_DICTIONARIES=/absolute/isolated/french-dictionary cargo test -p craft-proof --test french_dictionary -- --ignored +WORDCRAFT_DICTIONARIES=/absolute/isolated/french-dictionary cargo test -p craft-proof --test it -- french_dictionary:: --ignored ``` For a reproducible real-dictionary run, use Dicollecte 7.7 from LibreOffice/dictionaries diff --git a/crates/proof/tests/affix_compatibility.rs b/crates/proof/tests/it/affix_compatibility.rs similarity index 95% rename from crates/proof/tests/affix_compatibility.rs rename to crates/proof/tests/it/affix_compatibility.rs index 72b4d3041..23e746e17 100644 --- a/crates/proof/tests/affix_compatibility.rs +++ b/crates/proof/tests/it/affix_compatibility.rs @@ -6,7 +6,7 @@ use craft_proof::affix::{AffixDict, capitalize}; use std::fmt::Write; -#[path = "fixtures/affix_compatibility_cases.rs"] +#[path = "../fixtures/affix_compatibility_cases.rs"] mod fixtures; fn snapshot(case: &fixtures::Case, dict: &AffixDict) -> String { @@ -47,7 +47,7 @@ fn snapshot(case: &fixtures::Case, dict: &AffixDict) -> String { #[test] fn non_french_affix_outputs_match_pre_french_baseline() { - let expected = include_str!("fixtures/affix_compatibility.expected"); + let expected = include_str!("../fixtures/affix_compatibility.expected"); let mut actual = String::new(); for case in fixtures::cases() { let dict = AffixDict::from_hunspell(&case.aff, &case.dic, &["original compatibility fixture"]).unwrap(); @@ -80,7 +80,7 @@ fn non_french_affix_outputs_match_pre_french_baseline() { #[test] fn legacy_compact_data_is_refused_without_reinterpreting_homonyms() { - let encoded = include_str!("fixtures/affix_compatibility.compact"); + let encoded = include_str!("../fixtures/affix_compatibility.compact"); let cases = fixtures::cases(); let lines: Vec<_> = encoded.lines().collect(); assert_eq!(lines.len(), cases.len()); diff --git a/crates/proof/tests/french_dictionary.rs b/crates/proof/tests/it/french_dictionary.rs similarity index 100% rename from crates/proof/tests/french_dictionary.rs rename to crates/proof/tests/it/french_dictionary.rs diff --git a/crates/proof/tests/french_packs.rs b/crates/proof/tests/it/french_packs.rs similarity index 99% rename from crates/proof/tests/french_packs.rs rename to crates/proof/tests/it/french_packs.rs index 64ad46748..b17084f69 100644 --- a/crates/proof/tests/french_packs.rs +++ b/crates/proof/tests/it/french_packs.rs @@ -1,11 +1,10 @@ //! French uses ordinary Language packs and keeps each regional locale at the public API. #![allow(clippy::unwrap_used, clippy::expect_used)] -use craft_proof::affix; use craft_proof::{IssueKind, Options, ProofLang, check_text_with, is_correct_in_with, suggest_in}; use std::path::{Path, PathBuf}; -#[path = "../src/fr/test_dict.rs"] +#[path = "../../src/fr/test_dict.rs"] mod fixture; struct Tools(PathBuf); diff --git a/crates/proof/tests/it/main.rs b/crates/proof/tests/it/main.rs new file mode 100644 index 000000000..166d3fc29 --- /dev/null +++ b/crates/proof/tests/it/main.rs @@ -0,0 +1,8 @@ +//! The crate's integration tests, linked into one test binary. + +// The shared French dictionary fixture refers to the affix module through the crate root. +use craft_proof::affix; + +mod affix_compatibility; +mod french_dictionary; +mod french_packs; diff --git a/crates/testkit/tests/guards.rs b/crates/testkit/tests/it/guards.rs similarity index 100% rename from crates/testkit/tests/guards.rs rename to crates/testkit/tests/it/guards.rs diff --git a/crates/testkit/tests/it/main.rs b/crates/testkit/tests/it/main.rs new file mode 100644 index 000000000..f686c5c39 --- /dev/null +++ b/crates/testkit/tests/it/main.rs @@ -0,0 +1,4 @@ +//! The crate's integration tests, linked into one test binary. + +mod guards; +mod source_limits; diff --git a/crates/testkit/tests/source_limits.rs b/crates/testkit/tests/it/source_limits.rs similarity index 100% rename from crates/testkit/tests/source_limits.rs rename to crates/testkit/tests/it/source_limits.rs From a941f6475fd560f442be0cbc2d005db8c94cbd0a Mon Sep 17 00:00:00 2001 From: FredApps Date: Thu, 19 Nov 2026 13:07:39 +0100 Subject: [PATCH 17/22] Consolidate related time and evm tests --- crates/evm/tests/{ => it}/evm_metadata_arrays.rs | 0 crates/evm/tests/{ => it}/evm_metadata_map_keys.rs | 0 crates/evm/tests/{ => it}/evm_selector_dedup.rs | 0 crates/evm/tests/it/main.rs | 3 +++ crates/time/tests/{ => it}/differential.rs | 0 crates/time/tests/it/main.rs | 2 ++ crates/time/tests/{ => it}/timeline.rs | 0 7 files changed, 5 insertions(+) rename crates/evm/tests/{ => it}/evm_metadata_arrays.rs (100%) rename crates/evm/tests/{ => it}/evm_metadata_map_keys.rs (100%) rename crates/evm/tests/{ => it}/evm_selector_dedup.rs (100%) create mode 100644 crates/evm/tests/it/main.rs rename crates/time/tests/{ => it}/differential.rs (100%) create mode 100644 crates/time/tests/it/main.rs rename crates/time/tests/{ => it}/timeline.rs (100%) diff --git a/crates/evm/tests/evm_metadata_arrays.rs b/crates/evm/tests/it/evm_metadata_arrays.rs similarity index 100% rename from crates/evm/tests/evm_metadata_arrays.rs rename to crates/evm/tests/it/evm_metadata_arrays.rs diff --git a/crates/evm/tests/evm_metadata_map_keys.rs b/crates/evm/tests/it/evm_metadata_map_keys.rs similarity index 100% rename from crates/evm/tests/evm_metadata_map_keys.rs rename to crates/evm/tests/it/evm_metadata_map_keys.rs diff --git a/crates/evm/tests/evm_selector_dedup.rs b/crates/evm/tests/it/evm_selector_dedup.rs similarity index 100% rename from crates/evm/tests/evm_selector_dedup.rs rename to crates/evm/tests/it/evm_selector_dedup.rs diff --git a/crates/evm/tests/it/main.rs b/crates/evm/tests/it/main.rs new file mode 100644 index 000000000..a3851a4ff --- /dev/null +++ b/crates/evm/tests/it/main.rs @@ -0,0 +1,3 @@ +mod evm_metadata_arrays; +mod evm_metadata_map_keys; +mod evm_selector_dedup; diff --git a/crates/time/tests/differential.rs b/crates/time/tests/it/differential.rs similarity index 100% rename from crates/time/tests/differential.rs rename to crates/time/tests/it/differential.rs diff --git a/crates/time/tests/it/main.rs b/crates/time/tests/it/main.rs new file mode 100644 index 000000000..d8791e515 --- /dev/null +++ b/crates/time/tests/it/main.rs @@ -0,0 +1,2 @@ +mod differential; +mod timeline; diff --git a/crates/time/tests/timeline.rs b/crates/time/tests/it/timeline.rs similarity index 100% rename from crates/time/tests/timeline.rs rename to crates/time/tests/it/timeline.rs From fe0f8bf2bcaca104d0b068962c114bf4fb444890 Mon Sep 17 00:00:00 2001 From: haranishi <223786623+haranishi@users.noreply.github.com> Date: Fri, 20 Nov 2026 03:12:44 +0900 Subject: [PATCH 18/22] Remember the native Raw Develop window placement --- Cargo.lock | 2 + crates/imaging/Cargo.toml | 2 + crates/imaging/src/ui/raw_develop/mod.rs | 1 + crates/imaging/tests/it/raw_develop.rs | 85 ++++++++++++++++++- .../src/runtime/windows/placement.rs | 4 + .../src/runtime/windows/viewport.rs | 27 ++++-- 6 files changed, 111 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index efb9465f8..008eb19e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2960,6 +2960,8 @@ dependencies = [ "craft-keymap", "craft-theme", "craft-ui", + "craft-ui-test-kit", + "craft-window", "egui", "egui_kittest", "kurbo", diff --git a/crates/imaging/Cargo.toml b/crates/imaging/Cargo.toml index 5ae89a619..b1149aa36 100644 --- a/crates/imaging/Cargo.toml +++ b/crates/imaging/Cargo.toml @@ -38,6 +38,8 @@ serde_json = { workspace = true, optional = true } [dev-dependencies] craft-ui = { workspace = true, features = ["testing"] } +craft-ui-test-kit = { workspace = true } +craft-window = { workspace = true } egui = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] diff --git a/crates/imaging/src/ui/raw_develop/mod.rs b/crates/imaging/src/ui/raw_develop/mod.rs index 06f209fbd..66e3023c0 100644 --- a/crates/imaging/src/ui/raw_develop/mod.rs +++ b/crates/imaging/src/ui/raw_develop/mod.rs @@ -548,6 +548,7 @@ impl FullWindowWorkspace for RawDevelopWorkspace { let shown = FullWindowDialog::new(title) .own_window(WindowSpec::dialog()) + .remember(SaveKey::new("craft_imaging.raw_develop.window")) .opened(open) .command_scope(RawDevelopCommands::SCOPE) .buttons(buttons) diff --git a/crates/imaging/tests/it/raw_develop.rs b/crates/imaging/tests/it/raw_develop.rs index 35ff3d2b0..782930247 100644 --- a/crates/imaging/tests/it/raw_develop.rs +++ b/crates/imaging/tests/it/raw_develop.rs @@ -2,11 +2,13 @@ use std::cell::{Cell, RefCell}; use std::rc::Rc; -use std::sync::Arc; use std::sync::atomic::{AtomicUsize, Ordering}; +use std::sync::{Arc, Mutex}; use std::time::Duration; -use craft_behavior::PixelSize; +use craft_behavior::placement::Placement; +use craft_behavior::{Monitor, MonitorKey, PixelSize}; +use craft_host::target::ShellInfo; use craft_imaging::raw::{Demosaic, RawDevelopSettings}; use craft_imaging::scopes::ClippingMask; use craft_imaging::ui::raw_develop::{ @@ -15,13 +17,17 @@ use craft_imaging::ui::raw_develop::{ use craft_imaging::ui::scopes::{ScopeFrame, ScopeReadout}; use craft_imaging::ui::wide_angle::PreviewDone; use craft_imaging::ui::{ChannelColor, HistogramSet, ScopeChannel}; +use craft_ui::InstallSpec; use craft_ui::canvas::{PixelRect, RasterSource}; use craft_ui::dialog::{DialogHost, DialogResult, FullWindowWorkspace as _, HostedWorkspace}; use craft_ui::primitives::Revision; use craft_ui::runtime::access::Role; use craft_ui::runtime::pending::Job; +use craft_ui::testing::windows::{FakeSystem, NoWindows}; use craft_ui::testing::{Fixture, Target, pointer, trial}; -use egui::{Color32, ColorImage, Event, Key, Modifiers, Vec2, pos2}; +use craft_ui_test_kit::windows::Windows; +use craft_window::restore::Store; +use egui::{Color32, ColorImage, Event, Key, Modifiers, Rect, Vec2, ViewportId, ViewportInfo, pos2}; const IMAGE: [u32; 2] = [400, 200]; @@ -172,6 +178,79 @@ fn focus_canvas(fixture: &mut Fixture) -> Target { canvas } +#[trial] +fn raw_develop_remembers_its_native_window_between_open_and_filter() { + let store = Arc::new(Mutex::new(Store::in_memory())); + let context = || Windows::with(InstallSpec::new(ShellInfo::default(), Arc::new(NoWindows)).placement(store.clone())); + let first = context(); + let mut host = DialogHost::new(); + host.open(HostedWorkspace::new(RawDevelopWorkspace::new(open(RawTarget::OpenRaw)), Source::new())); + + let inner_size = Vec2::new(1040.0, 760.0); + let outer_pos = pos2(118.0, 60.0); + first.child_info(ViewportInfo { + inner_rect: Some(Rect::from_min_size(pos2(120.0, 90.0), inner_size)), + outer_rect: Some(Rect::from_min_size(outer_pos, inner_size + Vec2::new(4.0, 32.0))), + native_pixels_per_point: Some(2.0), + ..ViewportInfo::default() + }); + for _ in 0..3 { + first.frame(vec![], vec![], |ui| { + host.run(ui); + }); + } + let saved = store.lock().unwrap().get("craft_imaging.raw_develop.window").expect("the Raw Develop window's placement was saved"); + assert_eq!(saved.normal.size, <[f32; 2]>::from(inner_size)); + assert_eq!(saved.position_px, Some([236, 120])); + + // Windows can report a parked rectangle just before the minimized window stops painting. + let parked = Rect::from_min_size(pos2(-32000.0, -32000.0), Vec2::new(160.0, 40.0)); + first.child_info(ViewportInfo { + inner_rect: Some(parked), + outer_rect: Some(parked), + native_pixels_per_point: Some(2.0), + minimized: Some(true), + ..ViewportInfo::default() + }); + first.frame(vec![], vec![], |ui| { + host.run(ui); + }); + assert_eq!(store.lock().unwrap().get("craft_imaging.raw_develop.window"), Some(saved), "minimizing keeps the normal placement"); + + let second = context(); + let mut host = DialogHost::new(); + host.open(HostedWorkspace::new(RawDevelopWorkspace::new(open(RawTarget::Filter)), Source::new())); + let output = second.frame(vec![], vec![], |ui| { + host.run(ui); + }); + let (_, builder) = output.builders.iter().find(|(id, _)| *id != ViewportId::ROOT).expect("Raw Develop Filter opens a child window"); + assert_eq!(builder.inner_size, Some(inner_size)); + assert_eq!(builder.position, Some(outer_pos)); +} + +#[trial] +fn raw_develop_window_keeps_its_size_when_the_saved_screen_is_gone() { + let store = Arc::new(Mutex::new(Store::in_memory())); + let mut saved = Placement::new([1040.0, 760.0], 2.0); + saved.position_px = Some([-4400, 120]); + saved.monitor = Some(MonitorKey::new("Disconnected", [3840, 2160])); + store.lock().unwrap().set("craft_imaging.raw_develop.window", &saved); + + let screen = Monitor::new(MonitorKey::new("Attached", [3840, 2160]), [0, 0], [3840, 2160], 2.0); + let system = Arc::new(FakeSystem::new()); + system.set_monitors(vec![screen]); + let windows = Windows::with(InstallSpec::new(ShellInfo::default(), system).placement(store)); + let mut host = DialogHost::new(); + host.open(HostedWorkspace::new(RawDevelopWorkspace::new(open(RawTarget::OpenRaw)), Source::new())); + let output = windows.frame(vec![], vec![], |ui| { + host.run(ui); + }); + let (_, builder) = output.builders.iter().find(|(id, _)| *id != ViewportId::ROOT).expect("Raw Develop opens a child window"); + assert_eq!(builder.inner_size, Some(Vec2::new(1040.0, 760.0))); + let pos = builder.position.expect("the recovered position is on the attached screen"); + assert!((0.0..=880.0).contains(&pos.x) && (0.0..=320.0).contains(&pos.y), "restored position is in reach: {pos:?}"); +} + #[trial] fn raw_develop_switches_raws_and_finishes_with_each_footer_button() { let host = Rc::new(RefCell::new(DialogHost::new())); diff --git a/crates/ui-contract/src/runtime/windows/placement.rs b/crates/ui-contract/src/runtime/windows/placement.rs index 1a1b81e98..a179ed3d2 100644 --- a/crates/ui-contract/src/runtime/windows/placement.rs +++ b/crates/ui-contract/src/runtime/windows/placement.rs @@ -22,6 +22,10 @@ pub(crate) fn save_placement(ctx: &Context, key: &str, placement: &Placement) { /// Keeps the window's placement in the store, as [`placement_of`] records it. pub(super) fn record_placement(ctx: &Context, viewport: ViewportId, key: &str, facts: &viewports::Facts) { + // Some systems report a parked rectangle for a minimized window. + if facts.minimized { + return; + } let Some(inner) = facts.inner else { return }; let geometry = Geometry { inner, outer: facts.outer, scale: facts.native_scale, maximized: facts.maximized, fullscreen: facts.fullscreen }; let unchanged = PerViewport::::with(ctx, viewport, |record| record.placed.replace(geometry) == Some(geometry)); diff --git a/crates/ui-contract/src/runtime/windows/viewport.rs b/crates/ui-contract/src/runtime/windows/viewport.rs index 71302239c..02ac5fe9f 100644 --- a/crates/ui-contract/src/runtime/windows/viewport.rs +++ b/crates/ui-contract/src/runtime/windows/viewport.rs @@ -1,12 +1,14 @@ //! Viewport mounts: opening a mount's OS viewport and its close requests. +use super::host::monitors; use super::native::{WindowAction, act, route_hit_test}; use super::placement::{record_placement, saved_placement}; -use super::shell::{app_id, os_of, refresh}; +use super::shell::{app_id, base_shell, os_of, refresh}; use super::spec::{WindowSpec, frame_of_spec}; use super::{Record, refuse_close_under_modal, shared}; use crate::runtime::egui::viewports; use crate::runtime::frame::PerViewport; +use craft_behavior::placement::{Defaults, place}; use craft_host::target::{Os, WindowChrome, WindowKind}; use egui::{Context, Id, Pos2, Rect, Ui, Vec2, ViewportId}; @@ -45,13 +47,9 @@ pub(crate) struct ViewportOpen<'a> { /// resizable window's size goes out only to open it (`ViewportOpen::follows_size`). pub(crate) fn show_viewport(ctx: &Context, open: &ViewportOpen<'_>, mut body: impl FnMut(&mut Ui)) { let viewport = viewports::viewport_id(open.id); - let saved = open.save.and_then(|key| saved_placement(ctx, key)); - let (size, pos) = match &saved { - Some(placement) => (Some(Vec2::from(placement.normal.size)), placement.position().map(Pos2::from)), - None => (open.size, None), - }; - let pos = pos.or(open.position); let opened = PerViewport::::with(ctx, viewport, |record| record.seen.is_some()); + let (size, pos) = saved_geometry(ctx, open, opened).map_or((open.size, None), |(size, pos)| (Some(size), pos)); + let pos = pos.or(open.position); if opened { keep_placed(ctx, viewport, pos, size.filter(|_| open.follows_size)); } @@ -121,6 +119,21 @@ pub(crate) fn show_viewport(ctx: &Context, open: &ViewportOpen<'_>, mut body: im } } +/// Fits saved geometry to the current display layout once, before the viewport opens. +fn saved_geometry(ctx: &Context, open: &ViewportOpen<'_>, opened: bool) -> Option<(Vec2, Option)> { + let saved = saved_placement(ctx, open.save?)?.repaired()?; + let positions = base_shell(ctx).window_positions(); + let placement = if opened { + saved + } else { + let min = open.limits.0.map_or([1.0; 2], Into::into); + let defaults = Defaults::new(saved.normal.size, min).with_no_position(!positions); + place(Some(&saved), &monitors(ctx), None, &defaults) + }; + let pos = placement.position().filter(|_| positions).map(Pos2::from); + Some((placement.normal.size.into(), pos)) +} + /// Whether the OS asked the viewport of container `id` to close in this root frame; once. pub(crate) fn take_close_request(ctx: &Context, id: Id) -> bool { shared(ctx, |shared| { From 0290ef624aba6f8acefc80dd0c7f83c1e553f97b Mon Sep 17 00:00:00 2001 From: FredApps Date: Fri, 20 Nov 2026 00:54:24 +0100 Subject: [PATCH 19/22] Include track decoding trials in video integration suite --- crates/video/Cargo.toml | 4 ---- crates/video/tests/it/main.rs | 3 +++ crates/video/tests/{ => it}/track/av1.rs | 2 +- crates/video/tests/{ => it}/track/common/mod.rs | 0 crates/video/tests/{ => it}/track/h264.rs | 2 +- crates/video/tests/{ => it}/track/hevc.rs | 2 +- crates/video/tests/{ => it}/track/main.rs | 0 crates/video/tests/{ => it}/track/mpeg2.rs | 2 +- crates/video/tests/{ => it}/track/vp9.rs | 2 +- 9 files changed, 8 insertions(+), 9 deletions(-) rename crates/video/tests/{ => it}/track/av1.rs (99%) rename crates/video/tests/{ => it}/track/common/mod.rs (100%) rename crates/video/tests/{ => it}/track/h264.rs (99%) rename crates/video/tests/{ => it}/track/hevc.rs (99%) rename crates/video/tests/{ => it}/track/main.rs (100%) rename crates/video/tests/{ => it}/track/mpeg2.rs (99%) rename crates/video/tests/{ => it}/track/vp9.rs (96%) diff --git a/crates/video/Cargo.toml b/crates/video/Cargo.toml index b04450ad6..30cee4a92 100644 --- a/crates/video/Cargo.toml +++ b/crates/video/Cargo.toml @@ -85,10 +85,6 @@ craft-media-testkit = { workspace = true } # demuxers, for the track decoder's tests; the VMD demuxer, for the VMD decoder's. craft-media = { workspace = true, features = ["avi", "isobmff", "mpegts", "vmd"] } -# Built with any decoder feature; each codec's tests need its own. -[[test]] -name = "track" - [[example]] name = "vp8_fuzz" required-features = ["vp8-decode"] diff --git a/crates/video/tests/it/main.rs b/crates/video/tests/it/main.rs index 49be451ef..9c4dd414f 100644 --- a/crates/video/tests/it/main.rs +++ b/crates/video/tests/it/main.rs @@ -71,3 +71,6 @@ mod hevc; #[cfg(feature = "av1")] #[path = "av1/main.rs"] mod av1; + +#[path = "track/main.rs"] +mod track; diff --git a/crates/video/tests/track/av1.rs b/crates/video/tests/it/track/av1.rs similarity index 99% rename from crates/video/tests/track/av1.rs rename to crates/video/tests/it/track/av1.rs index cef856f2b..a282a80df 100644 --- a/crates/video/tests/track/av1.rs +++ b/crates/video/tests/it/track/av1.rs @@ -1,6 +1,6 @@ //! AV1 in MP4 (an `av1C` record whose config OBUs hold the sequence header). -use crate::common; +use super::common; use craft_media::CodecId; /// libaom when ffmpeg has it, else SVT-AV1: a fixture name and the encoder arguments. diff --git a/crates/video/tests/track/common/mod.rs b/crates/video/tests/it/track/common/mod.rs similarity index 100% rename from crates/video/tests/track/common/mod.rs rename to crates/video/tests/it/track/common/mod.rs diff --git a/crates/video/tests/track/h264.rs b/crates/video/tests/it/track/h264.rs similarity index 99% rename from crates/video/tests/track/h264.rs rename to crates/video/tests/it/track/h264.rs index 74a9477de..4cc56d148 100644 --- a/crates/video/tests/track/h264.rs +++ b/crates/video/tests/it/track/h264.rs @@ -1,7 +1,7 @@ //! H.264 in MP4 (an `avcC` record, length-prefixed packets), MPEG-TS (Annex B, no configuration) //! and AVI with the parameter sets in the stream header only (an Annex B configuration). -use crate::common; +use super::common; use craft_media::CodecId; use craft_video::{TrackDecoder, VideoError}; diff --git a/crates/video/tests/track/hevc.rs b/crates/video/tests/it/track/hevc.rs similarity index 99% rename from crates/video/tests/track/hevc.rs rename to crates/video/tests/it/track/hevc.rs index ac2cf672d..135870e5b 100644 --- a/crates/video/tests/track/hevc.rs +++ b/crates/video/tests/it/track/hevc.rs @@ -1,7 +1,7 @@ //! HEVC in MP4 (an `hvcC` record, length-prefixed packets) and MPEG-TS (Annex B, no //! configuration), 8-bit and 10-bit. -use crate::common; +use super::common; use craft_media::CodecId; /// Closed GOPs every 12 frames with B-frames, so decoding from a key packet gives every frame diff --git a/crates/video/tests/track/main.rs b/crates/video/tests/it/track/main.rs similarity index 100% rename from crates/video/tests/track/main.rs rename to crates/video/tests/it/track/main.rs diff --git a/crates/video/tests/track/mpeg2.rs b/crates/video/tests/it/track/mpeg2.rs similarity index 99% rename from crates/video/tests/track/mpeg2.rs rename to crates/video/tests/it/track/mpeg2.rs index e0fc19328..d465a7704 100644 --- a/crates/video/tests/track/mpeg2.rs +++ b/crates/video/tests/it/track/mpeg2.rs @@ -1,7 +1,7 @@ //! MPEG-2 video in MPEG-TS (no configuration), and with its sequence header moved from the //! packets into `extradata`. -use crate::common; +use super::common; use craft_media::CodecId; /// Closed GOPs every 12 frames with B-frames (ffmpeg's encoder needs scene change detection off diff --git a/crates/video/tests/track/vp9.rs b/crates/video/tests/it/track/vp9.rs similarity index 96% rename from crates/video/tests/track/vp9.rs rename to crates/video/tests/it/track/vp9.rs index 3fd75484c..421cc60e4 100644 --- a/crates/video/tests/track/vp9.rs +++ b/crates/video/tests/it/track/vp9.rs @@ -1,6 +1,6 @@ //! VP9 in MP4 (a `vpcC` record, which the decoder does not need). -use crate::common; +use super::common; use craft_media::CodecId; #[test] From ec3a32d0c2761f9481247d30d3e84808f77b1b11 Mon Sep 17 00:00:00 2001 From: FredApps Date: Fri, 20 Nov 2026 01:15:29 +0100 Subject: [PATCH 20/22] Isolate generated track fixtures per test --- crates/video/tests/it/track/common/mod.rs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/crates/video/tests/it/track/common/mod.rs b/crates/video/tests/it/track/common/mod.rs index bd3f14461..87bc5438f 100644 --- a/crates/video/tests/it/track/common/mod.rs +++ b/crates/video/tests/it/track/common/mod.rs @@ -29,6 +29,8 @@ pub struct Track { /// A fixture and ffmpeg's decode of it. pub struct Fixture { + /// This test's private fixture directory, removed when the fixture is dropped. + dir: PathBuf, pub file: PathBuf, /// Raw frames in display order, planes one after another, 16-bit samples little-endian. pub reference: Vec, @@ -36,6 +38,12 @@ pub struct Fixture { pub max_diff: u8, } +impl Drop for Fixture { + fn drop(&mut self) { + let _ = std::fs::remove_dir_all(&self.dir); + } +} + /// Lowest PSNR of a frame decoded within a tolerance, as the MPEG-2 oracle tests require. const MIN_PSNR: f64 = 58.0; @@ -44,11 +52,13 @@ const MIN_PSNR: f64 = 58.0; /// the encoder; a failure with `CRAFT_MEDIA_REQUIRE_ORACLES=1`. pub fn fixture(name: &str, ext: &str, args: &[&str], pix_fmt: &str) -> Option { let ff = craft_media_testkit::ffmpeg()?; - let dir = craft_media_testkit::fixture_subdir("video-track"); + // Tests can generate the same fixture concurrently in separate nextest processes. Give each + // one a private directory so it cannot replace a file another process is reading on Windows. + let dir = craft_media_testkit::private_dir("video-track"); let required = craft_media_testkit::oracles_required(); let file = dir.join(format!("{name}.{ext}")); let raw = dir.join(format!("{name}.{ext}.{pix_fmt}.raw")); - craft_media_testkit::generate_and_report(name, &[file.clone(), raw.clone()], || { + let result = craft_media_testkit::generate_and_report(name, &[file.clone(), raw.clone()], || { if !file.exists() { let tmp = craft_media_testkit::temp_path(&file); let mut cmd = Command::new(&ff); @@ -68,8 +78,12 @@ pub fn fixture(name: &str, ext: &str, args: &[&str], pix_fmt: &str) -> Option Date: Fri, 20 Nov 2026 05:14:50 +0100 Subject: [PATCH 21/22] Include DXF line and pattern tests in integration suite --- crates/dxf/tests/{ => it}/lin_pat.rs | 0 crates/dxf/tests/it/main.rs | 1 + 2 files changed, 1 insertion(+) rename crates/dxf/tests/{ => it}/lin_pat.rs (100%) diff --git a/crates/dxf/tests/lin_pat.rs b/crates/dxf/tests/it/lin_pat.rs similarity index 100% rename from crates/dxf/tests/lin_pat.rs rename to crates/dxf/tests/it/lin_pat.rs diff --git a/crates/dxf/tests/it/main.rs b/crates/dxf/tests/it/main.rs index db0ee235e..2229875f4 100644 --- a/crates/dxf/tests/it/main.rs +++ b/crates/dxf/tests/it/main.rs @@ -4,6 +4,7 @@ mod code_page_write; mod conformance; mod hardening; mod hex_chunks; +mod lin_pat; mod model; mod model_entities; mod model_mleader; From ccd4ae3887a77b5f3eb3cff45bfce723bbcd6000 Mon Sep 17 00:00:00 2001 From: FredApps Date: Fri, 20 Nov 2026 05:17:04 +0100 Subject: [PATCH 22/22] Include DDS texture cases in one integration binary --- crates/dds/tests/{ => it}/boundary.rs | 0 crates/dds/tests/{ => it}/known_answers.rs | 0 crates/dds/tests/it/main.rs | 4 ++++ 3 files changed, 4 insertions(+) rename crates/dds/tests/{ => it}/boundary.rs (100%) rename crates/dds/tests/{ => it}/known_answers.rs (100%) create mode 100644 crates/dds/tests/it/main.rs diff --git a/crates/dds/tests/boundary.rs b/crates/dds/tests/it/boundary.rs similarity index 100% rename from crates/dds/tests/boundary.rs rename to crates/dds/tests/it/boundary.rs diff --git a/crates/dds/tests/known_answers.rs b/crates/dds/tests/it/known_answers.rs similarity index 100% rename from crates/dds/tests/known_answers.rs rename to crates/dds/tests/it/known_answers.rs diff --git a/crates/dds/tests/it/main.rs b/crates/dds/tests/it/main.rs new file mode 100644 index 000000000..c247c8edb --- /dev/null +++ b/crates/dds/tests/it/main.rs @@ -0,0 +1,4 @@ +//! Integration tests for DDS texture handling. + +mod boundary; +mod known_answers;