refactor(gpu): move loose test files to src/tests/

This commit is contained in:
aiongg
2026-10-26 21:49:11 +00:00
parent 35e66b17a6
commit 959322dc38
30 changed files with 36 additions and 62 deletions
-56
View File
@@ -407,59 +407,3 @@ impl effectcraft_effects::psim::ParticleSim for Gpu {
#[cfg(test)]
mod tests;
#[cfg(test)]
mod tests_3d;
#[cfg(test)]
mod tests_adjust;
#[cfg(test)]
mod tests_adv3d;
#[cfg(test)]
mod tests_deferred;
#[cfg(test)]
mod tests_deferred_jobs;
#[cfg(test)]
mod tests_fx_color;
#[cfg(test)]
mod tests_fx_depth;
#[cfg(test)]
mod tests_fx_distort;
#[cfg(test)]
mod tests_fx_extra;
#[cfg(test)]
mod tests_fx_gen2;
#[cfg(test)]
mod tests_fx_generate;
#[cfg(test)]
mod tests_fx_key;
#[cfg(test)]
mod tests_fx_light;
#[cfg(test)]
mod tests_fx_lut;
#[cfg(test)]
mod tests_fx_noise;
#[cfg(test)]
mod tests_fx_particles;
#[cfg(test)]
mod tests_fx_pixel2;
#[cfg(test)]
mod tests_fx_sim;
#[cfg(test)]
mod tests_fx_stylize;
#[cfg(test)]
mod tests_fx_text;
#[cfg(test)]
mod tests_fx_time;
#[cfg(test)]
mod tests_fx_tone;
#[cfg(test)]
mod tests_fx_transition;
#[cfg(test)]
mod tests_fx_vr;
#[cfg(test)]
mod tests_fx_warp;
#[cfg(all(test, not(target_arch = "wasm32")))]
mod tests_init;
#[cfg(test)]
mod tests_particles;
#[cfg(test)]
mod tests_wgsl_grammar;
+30
View File
@@ -26,6 +26,36 @@ use effectcraft_time::{FrameRate, Tick};
use crate::Gpu;
mod three_d;
mod adjust;
mod adv3d;
mod deferred;
mod deferred_jobs;
mod fx_color;
mod fx_depth;
mod fx_distort;
mod fx_extra;
mod fx_gen2;
mod fx_generate;
mod fx_key;
mod fx_light;
mod fx_lut;
mod fx_noise;
mod fx_particles;
mod fx_pixel2;
mod fx_sim;
mod fx_stylize;
mod fx_text;
mod fx_time;
mod fx_tone;
mod fx_transition;
mod fx_vr;
mod fx_warp;
#[cfg(all(test, not(target_arch = "wasm32")))]
mod init;
mod particles;
mod wgsl_grammar;
/// One GPU test at a time in this process: the calling test thread holds a process-wide lock
/// until it exits (libtest runs every test on a thread of its own). wgpu's OpenGL backend (Mesa
/// llvmpipe on FreeBSD, Linux without Vulkan) has one context lock per adapter and panics when a
@@ -9,9 +9,9 @@ use effectcraft_render::{Accelerator, Backend, LayerCache, NoFootage, RenderOpts
use effectcraft_time::Tick;
use crate::tests::{Pattern, diff, n, tolerance};
use crate::tests_adv3d::{off_share, run_of, scene, scene_project};
use crate::tests_deferred::{deferred_gpu, render_passes};
use crate::tests_particles::{Host, agree, params};
use crate::tests::adv3d::{off_share, run_of, scene, scene_project};
use crate::tests::deferred::{deferred_gpu, render_passes};
use crate::tests::particles::{Host, agree, params};
/// The device's readbacks have landed (the browser's event loop; natively a poll).
fn settle(g: &crate::Gpu) {
@@ -87,7 +87,7 @@ fn advanced_3d_resolves_in_passes() {
#[test]
fn job_frames_render_in_passes() {
let Some((g, _lock)) = deferred_gpu() else { return };
let s = crate::tests_deferred::scene();
let s = crate::tests::deferred::scene();
let t = Tick::from_seconds_f64(0.5);
let cache = LayerCache::default();
cache.set_gate(g.miss_gate());
@@ -8,7 +8,7 @@ use effectcraft_keyframe::Value;
use effectcraft_time::Tick;
use crate::tests::{c, n};
use crate::tests_fx_pixel2::{e, env_case, env_case_allow, env_case_at, off, on, pt};
use crate::tests::fx_pixel2::{e, env_case, env_case_allow, env_case_at, off, on, pt};
fn layer(id: u64) -> Value {
Value::Layer(Some(id))
@@ -8,7 +8,7 @@ use effectcraft_render::RenderOpts;
use effectcraft_time::Tick;
use crate::tests::{Scene, check, compare_at, n, opts, set};
use crate::tests_fx_sim::{case, composited, e, off, on};
use crate::tests::fx_sim::{case, composited, e, off, on};
fn v2(x: f64, y: f64) -> Value {
Value::Vec2([x, y])