Unit Tests
This directory contains deterministic engine tests built into the generated test application. For the full maintained test map, validation routing, and coverage target details, see Testing.
Framework and target
- Framework: Catch2 (
catch_amalgamated.hpp) - Test application entry point:
Source/Applications/TestingApp.cpp - Test source list owner:
BuildTools/cmake/stages/EngineSources.cmake(FO_TESTS_SOURCE) - Generated executable target shape:
<ProjectDevName>_UnitTests - Generated run target:
RunUnitTests - Generated coverage target shape:
<ProjectDevName>_CodeCoverageplusRunCodeCoverage,GenerateCodeCoverageReport, andAnalyzeCodeCoveragewhen coverage is enabled
The executable target uses the embedding project’s development-name prefix (<ProjectDevName>_UnitTests); RunUnitTests is the generated runner target. Treat the prefix as project-generated, not universal engine API.
Current test suites
The complete source-backed filename list and count are generated in source-inventory.json. Testing provides the maintained ownership groups and validation routing.
Test_ClientEntityLifetime.cpp runs with either scripting backend. It verifies that registry lookups
retain their result across another thread’s final release and that an older entity cannot unregister
a successor with the same id.
After adding, removing, or renaming a Test_*.cpp file, regenerate the inventory from the engine root:
The configured executable contains the suites for its enabled scripting backend. AngelScript-only translation
units are selected only when FO_ANGELSCRIPT_SCRIPTING is enabled; Test_ManagedScriptBaker.cpp is selected only
when FO_MANAGED_SCRIPTING is enabled. Backend-neutral suites are always present.
python BuildTools/docs_inventory.py --write
python BuildTools/docs_inventory.py --check
Configuration, data sources, files, and caches
Source/Tests/Test_CacheStorage.cppSource/Tests/Test_ConfigFile.cppSource/Tests/Test_DataSource.cppSource/Tests/Test_FileSystem.cppSource/Tests/Test_Settings.cppSource/Tests/Test_SettingsStorage.cpp
Core platform, containers, and utilities
Source/Tests/Test_BaseLogging.cppSource/Tests/Test_BasicCore.cppSource/Tests/Test_CommonHelpers.cppSource/Tests/Test_Compressor.cppSource/Tests/Test_Containers.cppSource/Tests/Test_Cryptography.cppSource/Tests/Test_DequeObject.cppSource/Tests/Test_DataSerialization.cppSource/Tests/Test_DiskFileSystem.cppSource/Tests/Test_ExceptionHandling.cppSource/Tests/Test_ExtendedTypes.cppSource/Tests/Test_FunctionObjects.cppSource/Tests/Test_GenericUtils.cppSource/Tests/Test_GlobalData.cppSource/Tests/Test_HashedString.cppSource/Tests/Test_Logging.cppSource/Tests/Test_MemorySystem.cpp(OOM/commit failure policy and opt-in owner-thread occupancy, reusable holes and size-class totals without cache flushing)Source/Tests/Test_Platform.cppSource/Tests/Test_RandomGenerator.cppSource/Tests/Test_SafeArithmetics.cppSource/Tests/Test_SettingsStorage.cppSource/Tests/Test_SmartPointers.cppSource/Tests/Test_StackTrace.cppSource/Tests/Test_StringObject.cppSource/Tests/Test_StringUtils.cppSource/Tests/Test_StrongType.cppSource/Tests/Test_TimeRelated.cppSource/Tests/Test_Threading.cppSource/Tests/Test_WorkerPool.cppSource/Tests/Test_WorkThread.cpp
Common runtime model
Source/Tests/Test_AnyData.cppSource/Tests/Test_ApplicationHeadless.cppSource/Tests/Test_ClientEntityLifetime.cppSource/Tests/Test_Common.cppSource/Tests/Test_EngineMetadata.cppSource/Tests/Test_EntityLifecycle.cppSource/Tests/Test_EntityProtos.cppSource/Tests/Test_Geometry.cppSource/Tests/Test_LineTracer.cppSource/Tests/Test_MapLoader.cppSource/Tests/Test_MapSprite.cppSource/Tests/Test_MapViewHitTesting.cpp(self-contained faded-wall/floor picking, default and opt-in egg policy; either scripting backend)Source/Tests/Test_Movement.cppSource/Tests/Test_PathFinding.cppSource/Tests/Test_Properties.cppSource/Tests/Test_ProtoManager.cppSource/Tests/Test_TextPack.cppSource/Tests/Test_Timer.cppSource/Tests/Test_TransparentEgg.cppSource/Tests/Test_TwoDimensionalGrid.cpp
Networking and server/client integration
Source/Tests/Test_ClientDataValidation.cppSource/Tests/Test_ClientEngine.cppSource/Tests/Test_ClientRuntimeApi.cppSource/Tests/Test_ClientServerIntegration.cppSource/Tests/Test_ClientUpdater.cppSource/Tests/Test_DataBase.cppSource/Tests/Test_EntitySync.cppSource/Tests/Test_FogOfWar.cppSource/Tests/Test_LocationAndEntityMgmt.cppSource/Tests/Test_ModelAnimation.cppSource/Tests/Test_NetBuffer.cppSource/Tests/Test_NetSockets.cppSource/Tests/Test_NoiseProtocol.cppSource/Tests/Test_NetworkClient.cppSource/Tests/Test_NetworkServer.cppSource/Tests/Test_NetworkUdp.cppSource/Tests/Test_ServerAdvancedOps.cppSource/Tests/Test_ServerEngine.cppSource/Tests/Test_ServerEntityLoading.cppSource/Tests/Test_ServerEntityLifetime.cppSource/Tests/Test_ServerEventContracts.cppSource/Tests/Test_ServerItems.cppSource/Tests/Test_ServerMapOperations.cppSource/Tests/Test_ServerMoveReconciliation.cppSource/Tests/Test_SecureChannel.cppSource/Tests/Test_UpdaterBackend.cpp
Scripting and script-visible APIs
Source/Tests/Test_AngelScriptAlignment.cppSource/Tests/Test_AngelScriptAttributes.cppSource/Tests/Test_AngelScriptBytecode.cppSource/Tests/Test_AngelScriptCall.cppSource/Tests/Test_CommonScriptMethods.cppSource/Tests/Test_ScriptBuiltins.cppSource/Tests/Test_ScriptEntityOps.cppSource/Tests/Test_ServerScriptMethods.cpp
Bakers and tools
Source/Tests/Test_AngelScriptBaker.cppSource/Tests/Test_AudioBaker.cppSource/Tests/Test_BakerSetup.cppSource/Tests/Test_ConfigBaker.cppSource/Tests/Test_EffectBaker.cppSource/Tests/Test_ImageBaker.cppSource/Tests/Test_ImageWriter.cppSource/Tests/Test_MapBaker.cppSource/Tests/Test_Mapper.cppSource/Tests/Test_MetadataBaker.cppSource/Tests/Test_ManagedScriptBaker.cppSource/Tests/Test_ModelBaker.cppSource/Tests/Test_ModelBounds.cppSource/Tests/Test_ModelMeshData.cppSource/Tests/Test_ModelAnimationData.cppSource/Tests/Test_ModelAnimationConverter.cppSource/Tests/Test_ModelAnimationPoseProcedural.cppSource/Tests/Test_ModelAnimationRuntime.cppSource/Tests/Test_ModelSkeletonCompatibility.cppSource/Tests/Test_ModelSpriteLayout.cppSource/Tests/Test_ModelSourceLoader.cppSource/Tests/Test_OzzAnimation.cppSource/Tests/Test_ProtoBaker.cppSource/Tests/Test_ProtoTextBaker.cppSource/Tests/Test_RawCopyBaker.cppSource/Tests/Test_ResourceIndex.cppSource/Tests/Test_ResourcePack.cppSource/Tests/Test_TextBaker.cppSource/Tests/Test_TextureAtlas.cpp
The model-pipeline coverage is intentionally split. Test_ModelMeshData.cpp
owns the mesh-only wire contract; Test_ModelSourceLoader.cpp and
Test_ModelAnimationConverter.cpp own source extraction and canonical
conversion; Test_ModelAnimationData.cpp owns the versioned rig archive;
Test_ModelBaker.cpp crosses source-backed baking and binding resolution; and
the animation, runtime-pose, procedural, skeleton-compatibility, and Ozz suites
cover the production sampling and matrix path. Keep these boundaries green
independently, then use Test_ClientEngine.cpp for the baker-to-client parser
boundary.
Rendering and frontend tests
Source/Tests/Test_AudioManager.cpp— pins the panning law sample by sample, and runs a real baked Ogg through the mixer against a fake audio device to prove a placed sound is mixed where it was placed, thatUpdateSoundmoves one that is already playing, and that its handle stops answering once the sound has finished.Source/Tests/Test_ImGui.cpp— pins the backend-less widget activation and window-state harness used by diagnostic-panel coverage.Source/Tests/Test_EffekseerParticleRuntime.cpp- runs cooked legacy and modern Effekseer effects through the native runtime’s real Sprite/Ring callbacks and validates deterministic multi-instance topology, FOnline geometry, atlas UVs, all three Z-sort modes, Ring index-budget chunking, and facade-level scale reapplication without respawn or timing reset.Source/Tests/Test_ImGui.cppSource/Tests/Test_ModelSpriteLayout.cppSource/Tests/Test_ParticleBaker.cpp- covers.efkprojsource discovery,.spark/.efkprojoutput-key mapping, generated binary validation, rejection of authored.spk/.efkruntime inputs, and SPARK seeded-stream isolation across interleaved effects and independent engine contexts. The build/integration bake path exercises the native fixed-profile exporter on real XML projects.Source/Tests/Test_Rendering.cpp
The documentation CI job rejects stale generated inventory. The headings above mirror the current source files for navigation but do not replace the generated complete list.
Running tests
Prefer running the generated run target from a configured build directory:
cmake --build . --config RelWithDebInfo --target RunUnitTests
Use the executable target directly when you need Catch2 arguments. Generated test binaries are normally emitted under Binaries/Tests-*, for example:
- Windows:
Binaries/Tests-Windows-win64/<ProjectDevName>_UnitTests.exe - Linux:
Binaries/Tests-Linux-x64/<ProjectDevName>_UnitTests
Running code coverage
Coverage builds use the FO_CODE_COVERAGE path documented in Testing. The generated targets are:
RunCodeCoverageGenerateCodeCoverageReportAnalyzeCodeCoverage
Coverage reports are emitted under CodeCoverage/<Toolchain>/<Platform-Config>/
and exclude Source/Tests/ from the reported source denominator.
Shared test helpers
Header-only helpers live next to the suites and are not listed in FO_TESTS_SOURCE:
Source/Tests/Test_BakerHelpers.h- baked-resource fixtures (sprites, protos, metadata) and aTestRigthat runs the real bakers over in-memory sources.Source/Tests/Test_ParticleFixtures.h- particle asset fixtures.Source/Tests/Test_ImGuiHarness.h- presses ImGui widgets by label so the branch behind a button, checkbox, selectable or folded section runs in a headless frame. Pinned byImGuiTestHarnessPressesWidgetsByLabelinTest_ImGui.cpp; usage rules are in ../../Docs/Testing.md.Source/Tests/Test_DumpArtifacts.h- records theTexDump_*directories present in the working directory so a suite that triggers an atlas dump removes only the ones its own run wrote.
Notes
- Keep tests deterministic and platform-stable.
- Avoid network, filesystem, and timing-sensitive behavior in unit suites unless mocked or isolated.
- New test sources must be added to
FO_TESTS_SOURCEinBuildTools/cmake/stages/EngineSources.cmake. - Update Testing and this README when adding, removing, or regrouping test suites.
- Treat
RunUnitTestsas the minimum broad validation baseline for engine-side changes after focused tests pass.