Test utilities for Astrelis engine.
This crate provides testing infrastructure for the Astrelis game engine, including mock GPU contexts and render trait abstractions.
Overview
The main components are:
- [
RenderContext] - Trait abstracting GPU operations - [
MockRenderContext] - Mock implementation for testing - GPU wrapper types (
GpuBuffer,GpuTexture, etc.) - Can be real or mock
Example
#
#
Design Philosophy
This crate follows several key design principles:
1. No Lifetimes
All GPU wrapper types are owned and use reference counting internally. This eliminates lifetime parameters from propagating through the codebase.
2. Interior Mutability
Mock implementations use Mutex for interior mutability, allowing &self
methods to record calls.
3. Object Safety
The RenderContext trait is object-safe (dyn RenderContext), allowing
for polymorphic usage with both real and mock contexts.