Fling Engine uses Catch2 3 for first-party
tests. The test target is FlingTests, built from FlingTests/src, and links the
full FlingEngine library, so tests can exercise real engine
code, not just isolated units.
Build the FlingTests target as part of a normal build, then run the resulting
binary directly:
# Linux
./build/FlingTests/bin/FlingTests
# Windows (path includes the build config)
build\FlingTests\bin\<Debug|Release>\FlingTests.exeCatch2's CLI flags work as usual, e.g. ./build/FlingTests/bin/FlingTests "[tag]"
to filter, or --list-tests to see everything.
Logs/ should exist before running (CI does mkdir -p Logs first) — the engine
writes runtime logs there.
- Add a new
.cppunderFlingTests/src(see existing files likeResourceTests.cpp,UtilsTests.cpp,RendererTests.cppfor structure/naming).FlingTests/CMakeLists.txtglobs sources, so a new file is picked up automatically — no CMake edit needed for a new test file, just re-run CMake configure if it doesn't show up. - Use Catch2's
TEST_CASE/SECTIONmacros; follow the coding-style rules incoding-style.mdfor any doc comments you add. - Prefer testing first-party engine code (
FlingEngine/). Do not add tests that exerciseexternal/internals directly.
Every PR runs FlingTests on Linux (GCC + Clang) and Windows (MSVC Debug/Release +
MinGW64) via .github/workflows/build.yml. A test that only passes on one platform
is not done — check for platform-specific assumptions (path separators, endianness,
float precision) before considering a new test finished.