From a963f48ab06faca7675a91e6f50096a5564cc3c3 Mon Sep 17 00:00:00 2001 From: Razakhel Date: Thu, 22 Feb 2024 18:07:53 +0100 Subject: [PATCH] [Tests] Added tags to test cases - This will allow running only tests of certain categories --- tests/src/RaZ/Animation/Skeleton.cpp | 2 +- tests/src/RaZ/Audio/AudioSystem.cpp | 8 ++-- tests/src/RaZ/Audio/Listener.cpp | 2 +- tests/src/RaZ/Audio/Sound.cpp | 6 +-- tests/src/RaZ/Component.cpp | 2 +- tests/src/RaZ/Data/Bitset.cpp | 8 ++-- tests/src/RaZ/Data/BvhFormat.cpp | 3 +- tests/src/RaZ/Data/BvhSystem.cpp | 8 ++-- tests/src/RaZ/Data/Color.cpp | 6 +-- tests/src/RaZ/Data/FbxFormat.cpp | 2 +- tests/src/RaZ/Data/GltfFormat.cpp | 6 +-- tests/src/RaZ/Data/Graph.cpp | 4 +- tests/src/RaZ/Data/Image.cpp | 10 ++-- tests/src/RaZ/Data/ImageFormat.cpp | 14 +++--- tests/src/RaZ/Data/Mesh.cpp | 16 +++---- tests/src/RaZ/Data/ObjFormat.cpp | 8 ++-- tests/src/RaZ/Data/OwnerValue.cpp | 2 +- tests/src/RaZ/Data/PngFormat.cpp | 4 +- tests/src/RaZ/Data/Submesh.cpp | 4 +- tests/src/RaZ/Data/TgaFormat.cpp | 2 +- tests/src/RaZ/Data/WavFormat.cpp | 2 +- tests/src/RaZ/Entity.cpp | 6 +-- tests/src/RaZ/Math/Angle.cpp | 6 +-- tests/src/RaZ/Math/MathUtils.cpp | 16 +++---- tests/src/RaZ/Math/Matrix.cpp | 26 +++++------ tests/src/RaZ/Math/Quaternion.cpp | 18 ++++---- tests/src/RaZ/Math/Transform.cpp | 8 ++-- tests/src/RaZ/Math/Vector.cpp | 34 +++++++------- tests/src/RaZ/Physics/Collider.cpp | 2 +- tests/src/RaZ/Physics/PhysicsSystem.cpp | 6 +-- tests/src/RaZ/Physics/RigidBody.cpp | 2 +- tests/src/RaZ/Render/Camera.cpp | 10 ++-- tests/src/RaZ/Render/Cubemap.cpp | 5 +- tests/src/RaZ/Render/Framebuffer.cpp | 4 +- tests/src/RaZ/Render/Material.cpp | 2 +- tests/src/RaZ/Render/MeshRenderer.cpp | 6 +-- tests/src/RaZ/Render/RenderGraph.cpp | 2 +- tests/src/RaZ/Render/RenderPass.cpp | 4 +- tests/src/RaZ/Render/RenderProcess.cpp | 10 ++-- tests/src/RaZ/Render/RenderSystem.cpp | 6 +-- tests/src/RaZ/Render/Shader.cpp | 24 +++++----- tests/src/RaZ/Render/ShaderProgram.cpp | 16 +++---- tests/src/RaZ/Render/SubmeshRenderer.cpp | 6 +-- tests/src/RaZ/Render/Texture.cpp | 6 +-- tests/src/RaZ/Script/LuaAnimation.cpp | 2 +- tests/src/RaZ/Script/LuaAudio.cpp | 12 ++--- tests/src/RaZ/Script/LuaCore.cpp | 6 +-- tests/src/RaZ/Script/LuaData.cpp | 12 ++--- tests/src/RaZ/Script/LuaEnvironment.cpp | 2 +- tests/src/RaZ/Script/LuaMath.cpp | 16 +++---- tests/src/RaZ/Script/LuaPhysics.cpp | 6 +-- tests/src/RaZ/Script/LuaRender.cpp | 36 +++++++-------- tests/src/RaZ/Script/LuaScript.cpp | 10 ++-- tests/src/RaZ/Script/LuaUtils.cpp | 12 ++--- tests/src/RaZ/Script/LuaWrapper.cpp | 4 +- tests/src/RaZ/Script/ScriptSystem.cpp | 8 ++-- tests/src/RaZ/System.cpp | 2 +- tests/src/RaZ/Utils/EnumUtils.cpp | 2 +- tests/src/RaZ/Utils/FilePath.cpp | 12 ++--- tests/src/RaZ/Utils/FileUtils.cpp | 6 +-- tests/src/RaZ/Utils/FloatUtils.cpp | 2 +- tests/src/RaZ/Utils/Logger.cpp | 4 +- tests/src/RaZ/Utils/Plugin.cpp | 2 +- tests/src/RaZ/Utils/Ray.cpp | 18 ++++---- tests/src/RaZ/Utils/Shape.cpp | 58 ++++++++++++------------ tests/src/RaZ/Utils/StrUtils.cpp | 8 ++-- tests/src/RaZ/Utils/ThreadPool.cpp | 2 +- tests/src/RaZ/Utils/Threading.cpp | 16 +++---- tests/src/RaZ/Utils/TypeUtils.cpp | 6 +-- tests/src/RaZ/World.cpp | 6 +-- 70 files changed, 305 insertions(+), 309 deletions(-) diff --git a/tests/src/RaZ/Animation/Skeleton.cpp b/tests/src/RaZ/Animation/Skeleton.cpp index c6f4a083..831d38a5 100644 --- a/tests/src/RaZ/Animation/Skeleton.cpp +++ b/tests/src/RaZ/Animation/Skeleton.cpp @@ -7,7 +7,7 @@ using namespace Raz::Literals; -TEST_CASE("Skeleton rotation chain") { +TEST_CASE("Skeleton rotation chain", "[animation]") { // Creating a skeleton so that the following configuration is reproduced: // // / child11 diff --git a/tests/src/RaZ/Audio/AudioSystem.cpp b/tests/src/RaZ/Audio/AudioSystem.cpp index 49cd9c4b..ff8386a6 100644 --- a/tests/src/RaZ/Audio/AudioSystem.cpp +++ b/tests/src/RaZ/Audio/AudioSystem.cpp @@ -11,7 +11,7 @@ using namespace Raz::Literals; -TEST_CASE("AudioSystem accepted components") { +TEST_CASE("AudioSystem accepted components", "[audio]") { Raz::World world(2); auto& audio = world.addSystem(); @@ -25,7 +25,7 @@ TEST_CASE("AudioSystem accepted components") { CHECK(audio.containsEntity(listener)); } -TEST_CASE("AudioSystem initialization") { +TEST_CASE("AudioSystem initialization", "[audio]") { { const Raz::AudioSystem audio; CHECK_FALSE(audio.recoverCurrentDevice().empty()); // If it is actually empty, audio features won't be available on this platform @@ -37,7 +37,7 @@ TEST_CASE("AudioSystem initialization") { } } -TEST_CASE("AudioSystem devices recovery") { +TEST_CASE("AudioSystem devices recovery", "[audio]") { const std::vector devices = Raz::AudioSystem::recoverDevices(); const Raz::AudioSystem audio; @@ -46,7 +46,7 @@ TEST_CASE("AudioSystem devices recovery") { CHECK(std::find(devices.cbegin(), devices.cend(), currentDevice) != devices.cend()); } -TEST_CASE("AudioSystem attributes update") { +TEST_CASE("AudioSystem attributes update", "[audio]") { Raz::World world; world.addSystem(); diff --git a/tests/src/RaZ/Audio/Listener.cpp b/tests/src/RaZ/Audio/Listener.cpp index cf811afc..9639cc7e 100644 --- a/tests/src/RaZ/Audio/Listener.cpp +++ b/tests/src/RaZ/Audio/Listener.cpp @@ -4,7 +4,7 @@ #include "RaZ/Audio/Listener.hpp" #include "RaZ/Math/Vector.hpp" -TEST_CASE("Listener data") { +TEST_CASE("Listener data", "[audio]") { const Raz::AudioSystem audio; // Initializing the audio device & context, needed before all audio action Raz::Listener listener; diff --git a/tests/src/RaZ/Audio/Sound.cpp b/tests/src/RaZ/Audio/Sound.cpp index 856e9f31..2bc7b715 100644 --- a/tests/src/RaZ/Audio/Sound.cpp +++ b/tests/src/RaZ/Audio/Sound.cpp @@ -6,14 +6,14 @@ #include "RaZ/Math/Vector.hpp" #include "RaZ/Utils/Threading.hpp" -TEST_CASE("Sound initialization") { +TEST_CASE("Sound initialization", "[audio]") { const Raz::AudioSystem audio; // Initializing the audio device & context, needed before all audio action const Raz::Sound sound; CHECK(sound.getBufferIndex() != std::numeric_limits::max()); } -TEST_CASE("Sound move") { +TEST_CASE("Sound move", "[audio]") { const Raz::AudioSystem audio; Raz::Sound sound = Raz::WavFormat::load(RAZ_TESTS_ROOT "assets/sounds/notif_ting.wav"); @@ -86,7 +86,7 @@ TEST_CASE("Sound move") { CHECK(movedSoundCtor.recoverVelocity() == movedSoundOpVelocity); } -TEST_CASE("Sound operations") { +TEST_CASE("Sound operations", "[audio]") { const Raz::AudioSystem audio; const Raz::Sound sound = Raz::WavFormat::load(RAZ_TESTS_ROOT "assets/sounds/notif_ting.wav"); diff --git a/tests/src/RaZ/Component.cpp b/tests/src/RaZ/Component.cpp index da9e0c6c..e3c4c6b0 100644 --- a/tests/src/RaZ/Component.cpp +++ b/tests/src/RaZ/Component.cpp @@ -6,7 +6,7 @@ #include "RaZ/Render/Camera.hpp" #include "RaZ/Render/Light.hpp" -TEST_CASE("Components IDs") { +TEST_CASE("Components IDs", "[core]") { // With the CRTP, every component gets a different constant ID with the first call // The ID is incremented with every distinct component call // No matter how many times one component is checked, it will always have the same ID diff --git a/tests/src/RaZ/Data/Bitset.cpp b/tests/src/RaZ/Data/Bitset.cpp index 1ec758ce..cedac161 100644 --- a/tests/src/RaZ/Data/Bitset.cpp +++ b/tests/src/RaZ/Data/Bitset.cpp @@ -15,7 +15,7 @@ const Raz::Bitset alternated2({ false, true, false, true, false, true }); // 0 1 } // namespace -TEST_CASE("Bitset basic") { +TEST_CASE("Bitset basic", "[data]") { CHECK(fullZeros.isEmpty()); CHECK_FALSE(fullOnes.isEmpty()); @@ -41,7 +41,7 @@ TEST_CASE("Bitset basic") { CHECK(copy.isEmpty()); } -TEST_CASE("Bitset manipulations") { +TEST_CASE("Bitset manipulations", "[data]") { CHECK((alternated1 & alternated1) == alternated1); CHECK((alternated2 & alternated2) == alternated2); @@ -81,7 +81,7 @@ TEST_CASE("Bitset manipulations") { CHECK(~alternated2 == alternated1); } -TEST_CASE("Bitset shifts") { +TEST_CASE("Bitset shifts", "[data]") { CHECK((alternated1 << 1) == Raz::Bitset({ true, false, true, false, true, false, false })); // 1 0 1 0 1 0 0 CHECK((alternated1 >> 1) == Raz::Bitset({ true, false, true, false, true })); // 1 0 1 0 1 @@ -94,7 +94,7 @@ TEST_CASE("Bitset shifts") { CHECK(shiftTest == alternated1); } -TEST_CASE("Bitset printing") { +TEST_CASE("Bitset printing", "[data]") { std::stringstream stream; stream << fullOnes; diff --git a/tests/src/RaZ/Data/BvhFormat.cpp b/tests/src/RaZ/Data/BvhFormat.cpp index 48a25da5..602bc919 100644 --- a/tests/src/RaZ/Data/BvhFormat.cpp +++ b/tests/src/RaZ/Data/BvhFormat.cpp @@ -2,10 +2,9 @@ #include "RaZ/Animation/Skeleton.hpp" #include "RaZ/Data/BvhFormat.hpp" -#include "RaZ/Math/Vector.hpp" #include "RaZ/Utils/FilePath.hpp" -TEST_CASE("BvhFormat load") { +TEST_CASE("BvhFormat load", "[data]") { const Raz::Skeleton skeleton = Raz::BvhFormat::load(RAZ_TESTS_ROOT "assets/animation/ànîm.bvh"); // child1 (10, 10, 10) diff --git a/tests/src/RaZ/Data/BvhSystem.cpp b/tests/src/RaZ/Data/BvhSystem.cpp index f1543286..3d3053c8 100644 --- a/tests/src/RaZ/Data/BvhSystem.cpp +++ b/tests/src/RaZ/Data/BvhSystem.cpp @@ -5,7 +5,7 @@ #include "RaZ/Data/BvhSystem.hpp" #include "RaZ/Data/Mesh.hpp" -TEST_CASE("BvhSystem accepted components") { +TEST_CASE("BvhSystem accepted components", "[data]") { Raz::World world(1); auto& bvh = world.addSystem(); @@ -17,7 +17,7 @@ TEST_CASE("BvhSystem accepted components") { CHECK(bvh.containsEntity(mesh)); } -TEST_CASE("BvhSystem basic") { +TEST_CASE("BvhSystem basic", "[data]") { Raz::BvhSystem bvh; CHECK(bvh.getRootNode().isLeaf()); CHECK(bvh.getRootNode().getBoundingBox() == Raz::AABB(Raz::Vec3f(0.f), Raz::Vec3f(0.f))); @@ -31,7 +31,7 @@ TEST_CASE("BvhSystem basic") { CHECK_FALSE(bvh.query(Raz::Ray(Raz::Vec3f(0.f), Raz::Axis::Z))); } -TEST_CASE("BvhSystem build") { +TEST_CASE("BvhSystem build", "[data]") { Raz::World world(4); auto& bvh = world.addSystem(); @@ -173,7 +173,7 @@ TEST_CASE("BvhSystem build") { } } -TEST_CASE("BvhSystem query") { +TEST_CASE("BvhSystem query", "[data]") { // See: https://www.geogebra.org/m/tabbfjfd Raz::World world(3); diff --git a/tests/src/RaZ/Data/Color.cpp b/tests/src/RaZ/Data/Color.cpp index 9d34ff1e..fbaa0769 100644 --- a/tests/src/RaZ/Data/Color.cpp +++ b/tests/src/RaZ/Data/Color.cpp @@ -2,7 +2,7 @@ #include "RaZ/Data/Color.hpp" -TEST_CASE("Color components") { +TEST_CASE("Color components", "[data]") { Raz::Color color; CHECK(color.red() == 0.f); CHECK(color.green() == 0.f); @@ -16,7 +16,7 @@ TEST_CASE("Color components") { CHECK(color.blue() == 3.f); } -TEST_CASE("Color float/byte conversion") { +TEST_CASE("Color float/byte conversion", "[data]") { CHECK(Raz::Vec3b(Raz::Color(0.f, 0.f, 0.f)).strictlyEquals(Raz::Vec3b(0, 0, 0))); CHECK(Raz::Vec3f(Raz::Color(0, 0, 0)).strictlyEquals(Raz::Vec3f(0.f, 0.f, 0.f))); @@ -27,7 +27,7 @@ TEST_CASE("Color float/byte conversion") { CHECK(Raz::Vec3f(Raz::Color(255, 255, 255)).strictlyEquals(Raz::Vec3f(1.f, 1.f, 1.f))); } -TEST_CASE("Color hexadecimal") { +TEST_CASE("Color hexadecimal", "[data]") { CHECK(Raz::Color(0x000000) == Raz::Color(0.f, 0.f, 0.f)); CHECK(Raz::Color(0x808080) == Raz::Color(0.5019608f, 0.5019608f, 0.5019608f)); CHECK(Raz::Color(0x00FFFF) == Raz::Color(0.f, 1.f, 1.f)); diff --git a/tests/src/RaZ/Data/FbxFormat.cpp b/tests/src/RaZ/Data/FbxFormat.cpp index b5c9d75d..1aea7148 100644 --- a/tests/src/RaZ/Data/FbxFormat.cpp +++ b/tests/src/RaZ/Data/FbxFormat.cpp @@ -5,7 +5,7 @@ #include "RaZ/Render/MeshRenderer.hpp" #include "RaZ/Utils/FilePath.hpp" -TEST_CASE("FbxFormat load basic") { +TEST_CASE("FbxFormat load basic", "[data]") { const auto [mesh, meshRenderer] = Raz::FbxFormat::load(RAZ_TESTS_ROOT "../assets/meshes/shaderBall.fbx"); CHECK(mesh.getSubmeshes().size() == 7); diff --git a/tests/src/RaZ/Data/GltfFormat.cpp b/tests/src/RaZ/Data/GltfFormat.cpp index 23421bdd..a7654f0e 100644 --- a/tests/src/RaZ/Data/GltfFormat.cpp +++ b/tests/src/RaZ/Data/GltfFormat.cpp @@ -6,7 +6,7 @@ #include "RaZ/Data/Mesh.hpp" #include "RaZ/Render/MeshRenderer.hpp" -TEST_CASE("GltfFormat load glTF") { +TEST_CASE("GltfFormat load glTF", "[data]") { const auto [mesh, meshRenderer] = Raz::GltfFormat::load(RAZ_TESTS_ROOT "assets/meshes/çûbè.gltf"); REQUIRE(mesh.getSubmeshes().size() == 3); @@ -235,7 +235,7 @@ TEST_CASE("GltfFormat load glTF") { } } -TEST_CASE("GltfFormat load GLB simple") { +TEST_CASE("GltfFormat load GLB simple", "[data]") { const auto [mesh, meshRenderer] = Raz::GltfFormat::load(RAZ_TESTS_ROOT "assets/meshes/ßøӾ.glb"); REQUIRE(mesh.getSubmeshes().size() == 1); @@ -263,7 +263,7 @@ TEST_CASE("GltfFormat load GLB simple") { CHECK(matProgram.getAttribute(Raz::MaterialAttribute::Roughness) == 1.f); } -TEST_CASE("GltfFormat load GLB textured") { +TEST_CASE("GltfFormat load GLB textured", "[data]") { const auto [mesh, meshRenderer] = Raz::GltfFormat::load(RAZ_TESTS_ROOT "assets/meshes/ßøӾTêxtùrëd.glb"); REQUIRE(mesh.getSubmeshes().size() == 1); diff --git a/tests/src/RaZ/Data/Graph.cpp b/tests/src/RaZ/Data/Graph.cpp index b30dcecc..5361fb9c 100644 --- a/tests/src/RaZ/Data/Graph.cpp +++ b/tests/src/RaZ/Data/Graph.cpp @@ -8,7 +8,7 @@ class TestNode final : public Raz::GraphNode {}; } // namespace -TEST_CASE("Graph linking test") { +TEST_CASE("Graph linking test", "[data]") { Raz::Graph graph(5); TestNode& root = graph.addNode(); @@ -148,7 +148,7 @@ TEST_CASE("Graph linking test") { CHECK_THROWS(graph.removeNode(testNode)); } -TEST_CASE("Graph extremities test") { +TEST_CASE("Graph extremities test", "[data]") { Raz::Graph graph(5); TestNode& root = graph.addNode(); diff --git a/tests/src/RaZ/Data/Image.cpp b/tests/src/RaZ/Data/Image.cpp index 2fb43dc1..366a6ab4 100644 --- a/tests/src/RaZ/Data/Image.cpp +++ b/tests/src/RaZ/Data/Image.cpp @@ -5,7 +5,7 @@ #include -TEST_CASE("Image colorspace/data type creation") { +TEST_CASE("Image colorspace/data type creation", "[data]") { const Raz::Image imgByte(Raz::ImageColorspace::RGBA); CHECK(imgByte.getWidth() == 0); CHECK(imgByte.getHeight() == 0); @@ -23,7 +23,7 @@ TEST_CASE("Image colorspace/data type creation") { CHECK(imgFloat.isEmpty()); } -TEST_CASE("Image dimensions creation") { +TEST_CASE("Image dimensions creation", "[data]") { const Raz::Image imgEmpty(0, 0, Raz::ImageColorspace::RGBA); CHECK(imgEmpty.getWidth() == 0); CHECK(imgEmpty.getHeight() == 0); @@ -41,7 +41,7 @@ TEST_CASE("Image dimensions creation") { CHECK_FALSE(imgSmall.isEmpty()); } -TEST_CASE("Image value access") { +TEST_CASE("Image value access", "[data]") { { Raz::Image imgByte(1, 1, Raz::ImageColorspace::RGB, Raz::ImageDataType::BYTE); REQUIRE(imgByte.getChannelCount() == 3); @@ -100,7 +100,7 @@ TEST_CASE("Image value access") { } } -TEST_CASE("Image equality") { +TEST_CASE("Image equality", "[data]") { const Raz::Image imgB1(1, 1, Raz::ImageColorspace::GRAY, Raz::ImageDataType::BYTE); const Raz::Image imgB2(2, 2, Raz::ImageColorspace::GRAY, Raz::ImageDataType::BYTE); const Raz::Image imgB3(2, 2, Raz::ImageColorspace::GRAY_ALPHA, Raz::ImageDataType::BYTE); @@ -147,7 +147,7 @@ TEST_CASE("Image equality") { } } -TEST_CASE("Image copy/move") { +TEST_CASE("Image copy/move", "[data]") { Raz::Image imgBase(3, 3, Raz::ImageColorspace::RGB); auto* imgData = static_cast(imgBase.getDataPtr()); diff --git a/tests/src/RaZ/Data/ImageFormat.cpp b/tests/src/RaZ/Data/ImageFormat.cpp index 52681c78..a3d40136 100644 --- a/tests/src/RaZ/Data/ImageFormat.cpp +++ b/tests/src/RaZ/Data/ImageFormat.cpp @@ -81,30 +81,30 @@ void checkImage(const Raz::FilePath& filePath, uint8_t expectedChannelCount, con } // namespace -TEST_CASE("ImageFormat load BMP") { +TEST_CASE("ImageFormat load BMP", "[data]") { checkImage(RAZ_TESTS_ROOT "assets/images/dëfàùltTêst.bmp", 4, rawValues); } -TEST_CASE("ImageFormat load GIF") { +TEST_CASE("ImageFormat load GIF", "[data]") { checkImage(RAZ_TESTS_ROOT "assets/images/dëfàùltTêst.gif", 4, rawValues); } -TEST_CASE("ImageFormat load JPEG") { +TEST_CASE("ImageFormat load JPEG", "[data]") { checkImage(RAZ_TESTS_ROOT "assets/images/dëfàùltTêst.jpg", 3, jpegValues); } -TEST_CASE("ImageFormat load PGM") { +TEST_CASE("ImageFormat load PGM", "[data]") { checkImage(RAZ_TESTS_ROOT "assets/images/dëfàùltTêst.pgm", 1, rawValues); } -TEST_CASE("ImageFormat load PNG") { +TEST_CASE("ImageFormat load PNG", "[data]") { checkImage(RAZ_TESTS_ROOT "assets/images/dëfàùltTêst.png", 4, rawValues); } -TEST_CASE("ImageFormat load PPM") { +TEST_CASE("ImageFormat load PPM", "[data]") { checkImage(RAZ_TESTS_ROOT "assets/images/dëfàùltTêst.ppm", 3, rawValues); } -TEST_CASE("ImageFormat load TGA") { +TEST_CASE("ImageFormat load TGA", "[data]") { checkImage(RAZ_TESTS_ROOT "assets/images/dëfàùltTêst.tga", 3, rawValues); } diff --git a/tests/src/RaZ/Data/Mesh.cpp b/tests/src/RaZ/Data/Mesh.cpp index df85a23c..65caef67 100644 --- a/tests/src/RaZ/Data/Mesh.cpp +++ b/tests/src/RaZ/Data/Mesh.cpp @@ -2,7 +2,7 @@ #include "RaZ/Data/Mesh.hpp" -TEST_CASE("Mesh basic") { +TEST_CASE("Mesh basic", "[data]") { Raz::Mesh mesh; CHECK(mesh.getSubmeshes().empty()); CHECK(mesh.getBoundingBox() == Raz::AABB(Raz::Vec3f(0.f), Raz::Vec3f(0.f))); @@ -30,7 +30,7 @@ TEST_CASE("Mesh basic") { CHECK(boundingBox == mesh.getBoundingBox()); } -TEST_CASE("Mesh tangents") { +TEST_CASE("Mesh tangents", "[data]") { Raz::Mesh mesh; CHECK_NOTHROW(mesh.computeTangents()); // Attempting to compute tangents on an empty mesh does nothing @@ -80,7 +80,7 @@ TEST_CASE("Mesh tangents") { CHECK(submesh.getVertices()[3].tangent == triangle2Tangent); } -TEST_CASE("Mesh plane") { +TEST_CASE("Mesh plane", "[data]") { const Raz::Plane plane(1.5f, Raz::Axis::Y); constexpr float width = 1.f; @@ -133,7 +133,7 @@ TEST_CASE("Mesh plane") { CHECK(boundingBox.getMaxPosition() == expectedMaxPos); } -TEST_CASE("Mesh triangle") { +TEST_CASE("Mesh triangle", "[data]") { const Raz::Triangle triangle(Raz::Vec3f(-1.f, 0.f, 0.f), Raz::Vec3f(1.f, 0.f, 0.f), Raz::Vec3f(0.f, 1.f, 0.f)); CHECK(triangle.computeNormal() == Raz::Axis::Z); CHECK(triangle.isCounterClockwise(Raz::Axis::Z)); @@ -175,7 +175,7 @@ TEST_CASE("Mesh triangle") { CHECK(boundingBox.getMaxPosition() == expectedMaxPos); } -TEST_CASE("Mesh quad") { +TEST_CASE("Mesh quad", "[data]") { const Raz::Quad quad(Raz::Vec3f(0.f, 2.f, 0.f), Raz::Vec3f(1.f, 2.f, 0.f), Raz::Vec3f(1.f, 0.f, 0.f), Raz::Vec3f(0.f, 0.f, 0.f)); Raz::Mesh mesh(quad); @@ -211,7 +211,7 @@ TEST_CASE("Mesh quad") { CHECK(boundingBox.getMaxPosition() == expectedMaxPos); } -TEST_CASE("Mesh UV sphere") { +TEST_CASE("Mesh UV sphere", "[data]") { const Raz::Sphere sphere(Raz::Vec3f(1.f, 2.f, 3.f), 2.5f); auto checkWindingOrder = [&sphere] (const Raz::Mesh& mesh) { @@ -294,7 +294,7 @@ TEST_CASE("Mesh UV sphere") { CHECK_NOTHROW(Raz::Mesh(sphere, 1, Raz::SphereMeshType::UV)); // Although it doesn't make much sense, a subdivision as low as one is currently allowed } -TEST_CASE("Mesh icosphere") { +TEST_CASE("Mesh icosphere", "[data]") { const Raz::Sphere sphere(Raz::Vec3f(1.f, 2.f, 3.f), 2.5f); auto checkWindingOrder = [&sphere] (const Raz::Mesh& mesh) { @@ -370,7 +370,7 @@ TEST_CASE("Mesh icosphere") { CHECK_THROWS(Raz::Mesh(sphere, 0, Raz::SphereMeshType::ICO)); // Creating a sphere with no subdivision throws an exception } -TEST_CASE("Mesh AABB") { +TEST_CASE("Mesh AABB", "[data]") { const Raz::AABB box(Raz::Vec3f(-1.f), Raz::Vec3f(1.f)); Raz::Mesh mesh(box); diff --git a/tests/src/RaZ/Data/ObjFormat.cpp b/tests/src/RaZ/Data/ObjFormat.cpp index e7096ce5..69bdc920 100644 --- a/tests/src/RaZ/Data/ObjFormat.cpp +++ b/tests/src/RaZ/Data/ObjFormat.cpp @@ -69,7 +69,7 @@ Raz::MeshRenderer createMeshRenderer() { } // namespace -TEST_CASE("ObjFormat load quad faces") { +TEST_CASE("ObjFormat load quad faces", "[data]") { const auto [mesh, meshRenderer] = Raz::ObjFormat::load(RAZ_TESTS_ROOT "../assets/meshes/ballQuads.obj"); CHECK(mesh.getSubmeshes().size() == 1); @@ -81,7 +81,7 @@ TEST_CASE("ObjFormat load quad faces") { CHECK(meshRenderer.getMaterials().size() == 1); } -TEST_CASE("ObjFormat load Blinn-Phong") { +TEST_CASE("ObjFormat load Blinn-Phong", "[data]") { const auto [mesh, meshRenderer] = Raz::ObjFormat::load(RAZ_TESTS_ROOT "assets/meshes/çûbè_BP.obj"); CHECK(mesh.getSubmeshes().size() == 1); @@ -330,7 +330,7 @@ TEST_CASE("ObjFormat load Blinn-Phong") { } } -TEST_CASE("ObjFormat load Cook-Torrance") { +TEST_CASE("ObjFormat load Cook-Torrance", "[data]") { const auto [mesh, meshRenderer] = Raz::ObjFormat::load(RAZ_TESTS_ROOT "assets/meshes/çûbè_CT.obj"); CHECK(mesh.getSubmeshes().size() == 1); @@ -579,7 +579,7 @@ TEST_CASE("ObjFormat load Cook-Torrance") { } } -TEST_CASE("ObjFormat save") { +TEST_CASE("ObjFormat save", "[data]") { const auto checkMeshData = [] (const Raz::Mesh& mesh) { CHECK(mesh.getSubmeshes().size() == 2); diff --git a/tests/src/RaZ/Data/OwnerValue.cpp b/tests/src/RaZ/Data/OwnerValue.cpp index 39fa5e9b..3adae8d9 100644 --- a/tests/src/RaZ/Data/OwnerValue.cpp +++ b/tests/src/RaZ/Data/OwnerValue.cpp @@ -4,7 +4,7 @@ #include -TEST_CASE("OwnerValue move") { +TEST_CASE("OwnerValue move", "[data]") { Raz::OwnerValue::max()> valLimit; CHECK(valLimit == std::numeric_limits::max()); CHECK_FALSE(valLimit.isValid()); // If an initial value is unspecified, the invalid one is assigned diff --git a/tests/src/RaZ/Data/PngFormat.cpp b/tests/src/RaZ/Data/PngFormat.cpp index fa076425..526196f1 100644 --- a/tests/src/RaZ/Data/PngFormat.cpp +++ b/tests/src/RaZ/Data/PngFormat.cpp @@ -3,7 +3,7 @@ #include "RaZ/Data/Image.hpp" #include "RaZ/Data/PngFormat.hpp" -TEST_CASE("PngFormat load") { +TEST_CASE("PngFormat load", "[data]") { const Raz::Image img = Raz::PngFormat::load(RAZ_TESTS_ROOT "assets/images/dëfàùltTêst.png"); CHECK(img.getWidth() == 2); @@ -58,7 +58,7 @@ TEST_CASE("PngFormat load") { CHECK(imgFlipped.recoverByteValue(1, 1, 3) == 255); } -TEST_CASE("PngFormat save") { +TEST_CASE("PngFormat save", "[data]") { Raz::Image img(3, 3, Raz::ImageColorspace::RGBA); // Creating a 3x3 image, configured as such (x are white pixels): diff --git a/tests/src/RaZ/Data/Submesh.cpp b/tests/src/RaZ/Data/Submesh.cpp index 8cb7e3ef..3d27db12 100644 --- a/tests/src/RaZ/Data/Submesh.cpp +++ b/tests/src/RaZ/Data/Submesh.cpp @@ -2,7 +2,7 @@ #include "RaZ/Data/Submesh.hpp" -TEST_CASE("Vertex basic") { +TEST_CASE("Vertex basic", "[data]") { constexpr Raz::Vertex vertex1{ Raz::Vec3f(0.f), Raz::Vec2f(1.f), Raz::Axis::Z, Raz::Axis::X }; CHECK(vertex1.position == Raz::Vec3f(0.f)); CHECK(vertex1.texcoords == Raz::Vec2f(1.f)); @@ -21,7 +21,7 @@ TEST_CASE("Vertex basic") { CHECK_FALSE(std::hash()(vertex1) == std::hash()(vertex2)); } -TEST_CASE("Submesh basic") { +TEST_CASE("Submesh basic", "[data]") { Raz::Submesh submesh; CHECK(submesh.getVertexCount() == 0); CHECK(submesh.getLineIndexCount() == 0); diff --git a/tests/src/RaZ/Data/TgaFormat.cpp b/tests/src/RaZ/Data/TgaFormat.cpp index 8ce29041..9843db50 100644 --- a/tests/src/RaZ/Data/TgaFormat.cpp +++ b/tests/src/RaZ/Data/TgaFormat.cpp @@ -3,7 +3,7 @@ #include "RaZ/Data/Image.hpp" #include "RaZ/Data/TgaFormat.hpp" -TEST_CASE("TgaFormat load") { +TEST_CASE("TgaFormat load", "[data]") { const Raz::Image img = Raz::TgaFormat::load(RAZ_TESTS_ROOT "assets/images/dëfàùltTêst.tga"); CHECK(img.getWidth() == 2); diff --git a/tests/src/RaZ/Data/WavFormat.cpp b/tests/src/RaZ/Data/WavFormat.cpp index 0709898e..fe417992 100644 --- a/tests/src/RaZ/Data/WavFormat.cpp +++ b/tests/src/RaZ/Data/WavFormat.cpp @@ -4,7 +4,7 @@ #include "RaZ/Data/WavFormat.hpp" #include "RaZ/Utils/FilePath.hpp" -TEST_CASE("WavFormat load/save") { +TEST_CASE("WavFormat load/save", "[data]") { const Raz::Sound origSound = Raz::WavFormat::load(RAZ_TESTS_ROOT "assets/sounds/notif_ting.wav"); // Since no AudioSystem has been created, the Sound's buffer index cannot be valid. This is not the purpose of this test anyway diff --git a/tests/src/RaZ/Entity.cpp b/tests/src/RaZ/Entity.cpp index 8b268111..908122d6 100644 --- a/tests/src/RaZ/Entity.cpp +++ b/tests/src/RaZ/Entity.cpp @@ -14,7 +14,7 @@ Raz::Entity entity2(2); } // namespace -TEST_CASE("Entity basic") { +TEST_CASE("Entity basic", "[core]") { CHECK(entity0.getId() == 0); CHECK(entity1.getId() == 1); CHECK(entity2.getId() == 2); @@ -28,7 +28,7 @@ TEST_CASE("Entity basic") { CHECK(entity0.isEnabled()); } -TEST_CASE("Entity-component manipulations") { +TEST_CASE("Entity-component manipulations", "[core]") { CHECK(entity0.getComponents().empty()); CHECK_FALSE(entity0.hasComponent()); @@ -46,7 +46,7 @@ TEST_CASE("Entity-component manipulations") { CHECK_THROWS(entity0.getComponent()); } -TEST_CASE("Entity bitset") { +TEST_CASE("Entity bitset", "[core]") { CHECK(entity1.getEnabledComponents().isEmpty()); entity1.addComponent(); CHECK_FALSE(entity1.getEnabledComponents().isEmpty()); diff --git a/tests/src/RaZ/Math/Angle.cpp b/tests/src/RaZ/Math/Angle.cpp index a3815ece..6306724c 100644 --- a/tests/src/RaZ/Math/Angle.cpp +++ b/tests/src/RaZ/Math/Angle.cpp @@ -2,7 +2,7 @@ #include "RaZ/Math/Angle.hpp" -TEST_CASE("Degrees to Radians") { +TEST_CASE("Degrees to Radians", "[math]") { constexpr Raz::Degreesf deg45(45.f); constexpr Raz::Degreesf deg90(90.f); constexpr Raz::Degreesf deg180(180.f); @@ -14,7 +14,7 @@ TEST_CASE("Degrees to Radians") { CHECK_THAT(Raz::Radiansf(deg360).value, IsNearlyEqualTo(Raz::Pi * 2)); } -TEST_CASE("Radians to Degrees") { +TEST_CASE("Radians to Degrees", "[math]") { constexpr Raz::Radiansf radFourthPi(Raz::Pi / 4); constexpr Raz::Radiansf radHalfPi(Raz::Pi / 2); constexpr Raz::Radiansf radPi(Raz::Pi); @@ -26,7 +26,7 @@ TEST_CASE("Radians to Degrees") { CHECK_THAT(Raz::Degreesf(radDoublePi).value, IsNearlyEqualTo(360.f)); } -TEST_CASE("Angle operators") { +TEST_CASE("Angle operators", "[math]") { // Literal operators using namespace Raz::Literals; diff --git a/tests/src/RaZ/Math/MathUtils.cpp b/tests/src/RaZ/Math/MathUtils.cpp index 73677dae..5ac572a9 100644 --- a/tests/src/RaZ/Math/MathUtils.cpp +++ b/tests/src/RaZ/Math/MathUtils.cpp @@ -3,7 +3,7 @@ #include "RaZ/Math/MathUtils.hpp" #include "RaZ/Math/Vector.hpp" -TEST_CASE("MathUtils lerp arithmetic types") { +TEST_CASE("MathUtils lerp arithmetic types", "[math]") { CHECK(Raz::MathUtils::lerp(0.f, 1.f, 0.f) == 0.f); CHECK(Raz::MathUtils::lerp(0.f, 1.f, 0.25f) == 0.25f); CHECK(Raz::MathUtils::lerp(0.f, 1.f, 0.5f) == 0.5f); @@ -29,7 +29,7 @@ TEST_CASE("MathUtils lerp arithmetic types") { CHECK(Raz::MathUtils::lerp(457, 5324, 1.f) == 5324); } -TEST_CASE("MathUtils lerp vector") { +TEST_CASE("MathUtils lerp vector", "[math]") { CHECK(Raz::MathUtils::lerp(Raz::Vec3f(0.f), Raz::Vec3f(1.f), 0.f) == Raz::Vec3f(0.f)); CHECK(Raz::MathUtils::lerp(Raz::Vec3f(0.f), Raz::Vec3f(1.f), 0.25f) == Raz::Vec3f(0.25f)); CHECK(Raz::MathUtils::lerp(Raz::Vec3f(0.f), Raz::Vec3f(1.f), 0.5f) == Raz::Vec3f(0.5f)); @@ -55,7 +55,7 @@ TEST_CASE("MathUtils lerp vector") { CHECK(Raz::MathUtils::lerp(Raz::Vec3b(255, 140, 27), Raz::Vec3b(75, 241, 173), 1.f) == Raz::Vec3b(75, 241, 173)); } -TEST_CASE("MathUtils smoothstep value") { +TEST_CASE("MathUtils smoothstep value", "[math]") { CHECK(Raz::MathUtils::smoothstep(0.f) == 0.f); CHECK(Raz::MathUtils::smoothstep(0.25f) == 0.15625f); CHECK(Raz::MathUtils::smoothstep(0.5f) == 0.5f); @@ -63,7 +63,7 @@ TEST_CASE("MathUtils smoothstep value") { CHECK(Raz::MathUtils::smoothstep(1.f) == 1.f); } -TEST_CASE("MathUtils smoothstep range") { +TEST_CASE("MathUtils smoothstep range", "[math]") { CHECK(Raz::MathUtils::smoothstep(0.f, 1.f, -1.f) == 0.f); // If value < minThresh, returns 0 CHECK(Raz::MathUtils::smoothstep(0.f, 1.f, 0.f) == 0.f); CHECK(Raz::MathUtils::smoothstep(0.f, 1.f, 0.25f) == 0.15625f); @@ -87,7 +87,7 @@ TEST_CASE("MathUtils smoothstep range") { CHECK(Raz::MathUtils::smoothstep(-5.f, 5.f, 10.f) == 1.f); } -TEST_CASE("MathUtils smootherstep value") { +TEST_CASE("MathUtils smootherstep value", "[math]") { CHECK(Raz::MathUtils::smootherstep(0.f) == 0.f); CHECK(Raz::MathUtils::smootherstep(0.25f) == 0.103515625f); CHECK(Raz::MathUtils::smootherstep(0.5f) == 0.5f); @@ -95,7 +95,7 @@ TEST_CASE("MathUtils smootherstep value") { CHECK(Raz::MathUtils::smootherstep(1.f) == 1.f); } -TEST_CASE("MathUtils smootherstep range") { +TEST_CASE("MathUtils smootherstep range", "[math]") { CHECK(Raz::MathUtils::smootherstep(0.f, 1.f, -1.f) == 0.f); // If value < minThresh, returns 0 CHECK(Raz::MathUtils::smootherstep(0.f, 1.f, 0.f) == 0.f); CHECK(Raz::MathUtils::smootherstep(0.f, 1.f, 0.25f) == 0.103515625f); @@ -119,7 +119,7 @@ TEST_CASE("MathUtils smootherstep range") { CHECK(Raz::MathUtils::smootherstep(-5.f, 5.f, 10.f) == 1.f); } -TEST_CASE("MathUtils orthonormal basis") { +TEST_CASE("MathUtils orthonormal basis", "[math]") { Raz::Vec3f axis2; Raz::Vec3f axis3; @@ -146,7 +146,7 @@ TEST_CASE("MathUtils orthonormal basis") { CHECK(axis2.dot(axis3) == 0.f); } -TEST_CASE("MathUtils Fibonacci sphere") { +TEST_CASE("MathUtils Fibonacci sphere", "[math]") { std::vector fiboPoints = Raz::MathUtils::computeFibonacciSpherePoints(0); CHECK(fiboPoints.empty()); diff --git a/tests/src/RaZ/Math/Matrix.cpp b/tests/src/RaZ/Math/Matrix.cpp index c11c1b83..72bf8ac5 100644 --- a/tests/src/RaZ/Math/Matrix.cpp +++ b/tests/src/RaZ/Math/Matrix.cpp @@ -26,7 +26,7 @@ constexpr Raz::Mat4f mat42( 5.5f, 98.14f, -8.24f, 42.f, } // namespace -TEST_CASE("Matrix resize") { +TEST_CASE("Matrix resize", "[math]") { constexpr Raz::Mat3f truncatedMat(mat41); constexpr Raz::Mat4f expandedMat(truncatedMat); @@ -49,7 +49,7 @@ TEST_CASE("Matrix resize") { 0.f, 0.f, 0.f, 1.f)); } -TEST_CASE("Matrix from vectors") { +TEST_CASE("Matrix from vectors", "[math]") { constexpr auto testMatRows = Raz::Matrix::fromRows(Raz::Vec3f( 1.f, 2.f, 3.f), Raz::Vec3f( 4.f, 5.f, 6.f), Raz::Vec3f( 7.f, 8.f, 9.f), @@ -71,7 +71,7 @@ TEST_CASE("Matrix from vectors") { CHECK(testMat41 == mat41); } -TEST_CASE("Matrix elements fetching") { +TEST_CASE("Matrix elements fetching", "[math]") { { constexpr Raz::Mat3i testMat(0, 3, 6, 1, 4, 7, @@ -175,7 +175,7 @@ TEST_CASE("Matrix elements fetching") { CHECK(testMatTrans.recoverColumn(0) == Raz::Vector(1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f)); } -TEST_CASE("Matrix transposition") { +TEST_CASE("Matrix transposition", "[math]") { CHECK(mat31.transpose() == Raz::Mat3f(4.12f, 3.04f, -1.f, 25.1f, 5.f, -7.54f, 30.7842f, -64.5f, 8.41f)); @@ -197,7 +197,7 @@ TEST_CASE("Matrix transposition") { CHECK(mat3x2.transpose() == mat2x3); } -TEST_CASE("Matrix inversion") { +TEST_CASE("Matrix inversion", "[math]") { // Results taken from Wolfram Alpha: https://tinyurl.com/dve4wvbs CHECK(Raz::FloatUtils::areNearlyEqual(mat31.computeDeterminant(), -1404.90235872f)); CHECK(mat31.inverse() == Raz::Mat3f( 0.3162355f, 0.315469503f, 1.26191771f, @@ -215,7 +215,7 @@ TEST_CASE("Matrix inversion") { CHECK(Raz::Mat3f::identity().inverse() == Raz::Mat3f::identity()); } -TEST_CASE("Matrix/scalar operations") { +TEST_CASE("Matrix/scalar operations", "[math]") { CHECK(mat31 * 3.f == Raz::Mat3f( 12.36f, 75.3f, 92.3526f, 9.12f, 15.f, -193.5f, -3.f, -22.62f, 25.23f)); @@ -237,7 +237,7 @@ TEST_CASE("Matrix/scalar operations") { 0.f, 0.f, 0.f, 0.f)); } -TEST_CASE("Matrix/matrix operations") { +TEST_CASE("Matrix/matrix operations", "[math]") { CHECK(mat31 - mat31 == Raz::Mat3f(0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f)); @@ -285,7 +285,7 @@ TEST_CASE("Matrix/matrix operations") { 49.f, 64.f)); } -TEST_CASE("Matrix/vector multiplication") { +TEST_CASE("Matrix/vector multiplication", "[math]") { const Raz::Mat3f matRotX(1.f, 0.f, 0.f, 0.f, 0.70710677f, -0.70710677f, 0.f, 0.70710677f, 0.70710677f); @@ -367,7 +367,7 @@ TEST_CASE("Matrix/vector multiplication") { CHECK(mat2x4 * vec2 == Raz::Vec4f(10.2f, 30.4f, 50.6f, 70.8f)); // https://tinyurl.com/3k5p9uyk } -TEST_CASE("Matrix hash") { +TEST_CASE("Matrix hash", "[math]") { CHECK(mat31.hash() == mat31.hash()); CHECK_FALSE(mat31.hash() == mat32.hash()); @@ -398,7 +398,7 @@ TEST_CASE("Matrix hash") { CHECK(map.find(mat31Epsilon) == map.cend()); } -TEST_CASE("Matrix near-equality") { +TEST_CASE("Matrix near-equality", "[math]") { CHECK_FALSE(mat31 == mat32); const Raz::Mat2f baseMat = Raz::Mat2f::identity(); @@ -426,7 +426,7 @@ TEST_CASE("Matrix near-equality") { CHECK(baseMat == compMat); // Matrix::operator== does a near-equality check on floating point types } -TEST_CASE("Matrix strict equality") { +TEST_CASE("Matrix strict equality", "[math]") { CHECK(mat31.strictlyEquals(mat31)); CHECK(mat41.strictlyEquals(mat41)); @@ -461,7 +461,7 @@ TEST_CASE("Matrix strict equality") { CHECK_FALSE(std::equal(matrices.cbegin(), matrices.cend(), swappedMatrices.cbegin(), std::equal_to())); } -TEST_CASE("Matrix less-than") { +TEST_CASE("Matrix less-than", "[math]") { CHECK(std::less()(mat31, mat32)); CHECK_FALSE(std::less()(mat32, mat31)); CHECK_FALSE(std::less()(mat31, mat31)); // Equal matrices are not strictly less than the other @@ -475,7 +475,7 @@ TEST_CASE("Matrix less-than") { CHECK_FALSE(std::less()(mat41 + std::numeric_limits::epsilon(), mat41)); } -TEST_CASE("Matrix printing") { +TEST_CASE("Matrix printing", "[math]") { std::stringstream stream; stream << mat31; diff --git a/tests/src/RaZ/Math/Quaternion.cpp b/tests/src/RaZ/Math/Quaternion.cpp index 7a1815d2..b179aec2 100644 --- a/tests/src/RaZ/Math/Quaternion.cpp +++ b/tests/src/RaZ/Math/Quaternion.cpp @@ -14,7 +14,7 @@ const Raz::Quaternionf quat3(180_deg, 1.f, -2.f, 5.f); } // namespace -TEST_CASE("Quaternion deduction guides") { +TEST_CASE("Quaternion deduction guides", "[math]") { const Raz::Quaternion quatfVal(1.f, 1.f, 1.f, 1.f); const Raz::Quaternion quatfDeg(Raz::Degrees(0.f), Raz::Axis::X); const Raz::Quaternion quatdRad(Raz::Radians(0.0), 1.0, 0.0, 0.0); @@ -24,7 +24,7 @@ TEST_CASE("Quaternion deduction guides") { CHECK(std::is_same_v, Raz::Quaterniond>); } -TEST_CASE("Quaternion dot product") { +TEST_CASE("Quaternion dot product", "[math]") { const Raz::Quaternionf normedQuat1 = quat1.normalize(); const Raz::Quaternionf normedQuat2 = quat2.normalize(); const Raz::Quaternionf normedQuat3 = quat3.normalize(); @@ -47,7 +47,7 @@ TEST_CASE("Quaternion dot product") { CHECK(quat3.dot(quat1) == quat1.dot(quat3)); } -TEST_CASE("Quaternion norm computation") { +TEST_CASE("Quaternion norm computation", "[math]") { CHECK_THAT(quat1.computeSquaredNorm(), IsNearlyEqualTo(1.f)); CHECK_THAT(quat1.computeNorm(), IsNearlyEqualTo(1.f)); @@ -58,7 +58,7 @@ TEST_CASE("Quaternion norm computation") { CHECK_THAT(quat3.computeNorm(), IsNearlyEqualTo(5.47722578f)); } -TEST_CASE("Quaternion interpolation") { +TEST_CASE("Quaternion interpolation", "[math]") { // Results taken from Rust's nalgebra crate: https://play.rust-lang.org/?version=stable&mode=release&edition=2018&gist=fb93e96b13f3708b3b54aacef65365c2 CHECK(quat1.lerp(quat2, 0.f) == quat1); @@ -91,7 +91,7 @@ TEST_CASE("Quaternion interpolation") { CHECK(normedQuat1.slerp(normedQuat2, 1.f) == normedQuat2); } -TEST_CASE("Quaternion matrix computation") { +TEST_CASE("Quaternion matrix computation", "[math]") { const Raz::Mat4f quat1Mat = quat1.computeMatrix(); const Raz::Mat4f quat2Mat = quat2.computeMatrix(); const Raz::Mat4f quat3Mat = quat3.computeMatrix(); @@ -117,7 +117,7 @@ TEST_CASE("Quaternion matrix computation") { 0.f, 0.f, 0.f, 1.f))); } -TEST_CASE("Quaternion/vector multiplication") { +TEST_CASE("Quaternion/vector multiplication", "[math]") { // See: https://www.geogebra.org/m/aderzasm const Raz::Quaternionf quatRotX(45_deg, Raz::Axis::X); @@ -156,7 +156,7 @@ TEST_CASE("Quaternion/vector multiplication") { CHECK_THAT(pos * quatRotZ, IsNearlyEqualToVector(pos * Raz::Mat3f(quatRotZ.computeMatrix()), 0.000001f)); } -TEST_CASE("Quaternion/quaternion multiplication") { +TEST_CASE("Quaternion/quaternion multiplication", "[math]") { constexpr Raz::Quaternionf unitQuat = Raz::Quaternionf::identity(); constexpr Raz::Mat4f unitQuatMat = unitQuat.computeMatrix(); CHECK(unitQuatMat == Raz::Mat4f::identity()); @@ -203,7 +203,7 @@ TEST_CASE("Quaternion/quaternion multiplication") { 0.f, 0.f, 0.f, 1.f))); } -TEST_CASE("Quaternion near-equality") { +TEST_CASE("Quaternion near-equality", "[math]") { CHECK_FALSE(quat1 == quat2); constexpr Raz::Quaternionf baseQuat(1.f, 1.f, 1.f, 1.f); @@ -234,7 +234,7 @@ TEST_CASE("Quaternion near-equality") { CHECK(baseQuat == compQuat); // Quaternion::operator== does a near-equality check } -TEST_CASE("Quaternion printing") { +TEST_CASE("Quaternion printing", "[math]") { std::stringstream stream; stream << quat1; diff --git a/tests/src/RaZ/Math/Transform.cpp b/tests/src/RaZ/Math/Transform.cpp index 6577503d..5048bf64 100644 --- a/tests/src/RaZ/Math/Transform.cpp +++ b/tests/src/RaZ/Math/Transform.cpp @@ -6,7 +6,7 @@ using namespace Raz::Literals; -TEST_CASE("Transform position") { +TEST_CASE("Transform position", "[math]") { Raz::Transform transform; CHECK(transform.getPosition() == Raz::Vec3f(0.f, 0.f, 0.f)); CHECK(transform.hasUpdated()); // By default, a transform always has an updated status @@ -45,7 +45,7 @@ TEST_CASE("Transform position") { CHECK_FALSE(transform.hasUpdated()); } -TEST_CASE("Transform rotation") { +TEST_CASE("Transform rotation", "[math]") { Raz::Transform transform; CHECK(transform.getRotation() == Raz::Quaternionf::identity()); CHECK(transform.hasUpdated()); // By default, a transform always has an updated status @@ -76,7 +76,7 @@ TEST_CASE("Transform rotation") { //CHECK(transform.hasUpdated()); } -TEST_CASE("Transform scale") { +TEST_CASE("Transform scale", "[math]") { Raz::Transform transform; CHECK(transform.getScale() == Raz::Vec3f(1.f, 1.f, 1.f)); CHECK(transform.hasUpdated()); // By default, a transform always has an updated status @@ -97,7 +97,7 @@ TEST_CASE("Transform scale") { CHECK(transform.hasUpdated()); } -TEST_CASE("Transform operations") { +TEST_CASE("Transform operations", "[math]") { Raz::Transform transform(Raz::Vec3f(1.f, 0.f, 1.f), Raz::Quaternionf(90_deg, Raz::Axis::Y), Raz::Vec3f(2.f)); CHECK(transform.getPosition() == Raz::Vec3f(1.f, 0.f, 1.f)); diff --git a/tests/src/RaZ/Math/Vector.cpp b/tests/src/RaZ/Math/Vector.cpp index 3ccfc6de..c4a4fa22 100644 --- a/tests/src/RaZ/Math/Vector.cpp +++ b/tests/src/RaZ/Math/Vector.cpp @@ -27,7 +27,7 @@ constexpr Raz::Vec3d vec3d2(13.01, -0.00000001, 351.025465545); } // namespace -TEST_CASE("Vector deduction guides") { +TEST_CASE("Vector deduction guides", "[math]") { constexpr Raz::Vector vec3b(static_cast(1), 2, 3); constexpr Raz::Vector vec2i(1, 2); constexpr Raz::Vector vec4u(1u, 2u, 3u, 4u); @@ -41,7 +41,7 @@ TEST_CASE("Vector deduction guides") { CHECK(std::is_same_v, Raz::Vector>); } -TEST_CASE("Vector indexing") { +TEST_CASE("Vector indexing", "[math]") { CHECK(vec3f1[0] == 3.18f); CHECK(vec3f1[1] == 42.f); CHECK(vec3f1[2] == 0.874f); @@ -73,7 +73,7 @@ TEST_CASE("Vector indexing") { CHECK(vecCopy.w() == vec4f1.w() + 2.f); } -TEST_CASE("Vector dot") { +TEST_CASE("Vector dot", "[math]") { CHECK(std::is_same_v().dot(std::declval())), uint64_t>); CHECK(vec3b1.dot(vec3b2) == 3528); @@ -92,7 +92,7 @@ TEST_CASE("Vector dot") { CHECK_THAT(vec3d1.dot(vec3d2), IsNearlyEqualTo(-295798.92303641)); } -TEST_CASE("Vector cross") { +TEST_CASE("Vector cross", "[math]") { // The cross product cannot be computed for unsigned types or sizes other than 3 CHECK(vec3i1.cross(vec3i1) == Raz::Vec3i(0)); @@ -106,7 +106,7 @@ TEST_CASE("Vector cross") { CHECK_THAT(vec3d1.cross(vec3d2), IsNearlyEqualToVector(Raz::Vec3d(1668073.3632868854, -4600.859073635499, -61823.533009819))); } -TEST_CASE("Vector/scalar operations") { +TEST_CASE("Vector/scalar operations", "[math]") { CHECK((vec3b1 + 4) == Raz::Vec3b(35, 12, 16)); CHECK((vec3b2 - 8) == Raz::Vec3b(40, 247, 248)); // Underflowing from 0 to 248 (255 - 7) CHECK((vec3b1 * 2) == Raz::Vec3b(62, 16, 24)); @@ -161,7 +161,7 @@ TEST_CASE("Vector/scalar operations") { } } -TEST_CASE("Vector/vector operations") { +TEST_CASE("Vector/vector operations", "[math]") { CHECK((vec3b1 + vec3b2) == Raz::Vec3b(79, 7, 12)); // Values are overflowed CHECK((vec3b1 - vec3b2) == Raz::Vec3b(239, 9, 12)); // Values are underflowed CHECK((vec3b1 * vec3b2) == Raz::Vec3b(208, 248, 0)); // Values are overflowed @@ -189,7 +189,7 @@ TEST_CASE("Vector/vector operations") { CHECK_THAT(vec3d1 / vec3d2, IsNearlyEqualToVector(Raz::Vec3d(-1.391237509607994, -475200100000.0, -2.3986863707814358))); } -TEST_CASE("Vector/matrix operations") { +TEST_CASE("Vector/matrix operations", "[math]") { const Raz::Mat3f mat3( 4.12f, 25.1f, 30.7842f, 3.04f, 5.f, -64.5f, -1.f, -7.54f, 8.41f); @@ -207,7 +207,7 @@ TEST_CASE("Vector/matrix operations") { CHECK((vec4f1 * Raz::Mat4f::identity()) == vec4f1); } -TEST_CASE("Vector reflection") { +TEST_CASE("Vector reflection", "[math]") { // IncVec N Reflection // \ ^ ^ // \ | / @@ -224,7 +224,7 @@ TEST_CASE("Vector reflection") { CHECK_THAT(vec3d1.reflect(vec3d2), IsNearlyEqualToVector(Raz::Vec3d(7696669.877407388, 4751.995084021539, 207665067.33313086))); } -TEST_CASE("Vector length") { +TEST_CASE("Vector length", "[math]") { CHECK(std::is_same_v().computeSquaredLength()), uint64_t>); CHECK(std::is_same_v().computeLength()), float>); CHECK(vec3b1.computeSquaredLength() == 1169); @@ -249,7 +249,7 @@ TEST_CASE("Vector length") { CHECK(vec3d1.computeLength() == 4826.054818793607); } -TEST_CASE("Vector normalization") { +TEST_CASE("Vector normalization", "[math]") { CHECK(std::is_same_v().normalize()), Raz::Vec3f>); CHECK_THAT(vec3b1.normalize(), IsNearlyEqualToVector(Raz::Vec3f(0.9066808f, 0.2339821f, 0.3509732f))); @@ -273,7 +273,7 @@ TEST_CASE("Vector normalization") { CHECK(Raz::Vec3d(0.0).normalize() == Raz::Vec3d(0.f)); } -TEST_CASE("Vector interpolation") { +TEST_CASE("Vector interpolation", "[math]") { CHECK(vec3b1.lerp(vec3b2, 0.f) == vec3b1); CHECK(vec3b1.lerp(vec3b2, 0.25f) == Raz::Vec3b(35, 69, 9)); // Results are truncated, not rounded CHECK(vec3b1.lerp(vec3b2, 0.5f) == Raz::Vec3b(39, 131, 6)); @@ -320,7 +320,7 @@ TEST_CASE("Vector interpolation") { CHECK_THAT(vec3d1.lerp(vec3d2, 1.0), IsNearlyEqualToVector(vec3d2, 0.000000000001)); } -TEST_CASE("Vector hash") { +TEST_CASE("Vector hash", "[math]") { CHECK(vec3b1.hash() == vec3b1.hash()); CHECK_FALSE(vec3b1.hash() == vec3b2.hash()); @@ -360,7 +360,7 @@ TEST_CASE("Vector hash") { CHECK(map.find(vec3f1Epsilon) == map.cend()); } -TEST_CASE("Vector near-equality") { +TEST_CASE("Vector near-equality", "[math]") { // Near-equality applies only to vectors of floating-point values CHECK_FALSE(vec3f1 == vec3f2); @@ -387,7 +387,7 @@ TEST_CASE("Vector near-equality") { CHECK(baseVec == compVec); // Vector::operator== does a near-equality check on floating point types } -TEST_CASE("Vector strict equality") { +TEST_CASE("Vector strict equality", "[math]") { CHECK(vec3b1.strictlyEquals(vec3b1)); CHECK_FALSE(vec3b1.strictlyEquals(vec3b1 + Raz::Vec3b(1, 0, 0))); @@ -433,7 +433,7 @@ TEST_CASE("Vector strict equality") { CHECK_FALSE(std::equal(vectors.cbegin(), vectors.cend(), swappedVectors.cbegin(), std::equal_to())); } -TEST_CASE("Vector less-than") { +TEST_CASE("Vector less-than", "[math]") { CHECK(std::less()(vec3b1, vec3b2)); CHECK_FALSE(std::less()(vec3b2, vec3b1)); @@ -459,7 +459,7 @@ TEST_CASE("Vector less-than") { CHECK_FALSE(std::less()(vec3d2 + std::numeric_limits::epsilon(), vec3d2)); } -TEST_CASE("Vector conversion") { +TEST_CASE("Vector conversion", "[math]") { CHECK(Raz::Vec3f(vec3b1) == Raz::Vec3f(31.f, 8.f, 12.f)); CHECK(Raz::Vec3b(vec3i1) == Raz::Vec3b(208, 0, 54)); // Values are underflowed & overflowed CHECK(Raz::Vec3i(vec3f1) == Raz::Vec3i(3, 42, 0)); // Results are truncated, not rounded @@ -469,7 +469,7 @@ TEST_CASE("Vector conversion") { CHECK(Raz::Vec3i(vec3d1) == Raz::Vec3i(-18, 4752, -842)); } -TEST_CASE("Vector printing") { +TEST_CASE("Vector printing", "[math]") { std::stringstream stream; stream << vec3b1; diff --git a/tests/src/RaZ/Physics/Collider.cpp b/tests/src/RaZ/Physics/Collider.cpp index 98101de3..6542e0eb 100644 --- a/tests/src/RaZ/Physics/Collider.cpp +++ b/tests/src/RaZ/Physics/Collider.cpp @@ -3,7 +3,7 @@ #include "RaZ/Physics/Collider.hpp" #include "RaZ/Utils/Shape.hpp" -TEST_CASE("Collider basic") { +TEST_CASE("Collider basic", "[physics]") { Raz::Collider collider(Raz::Plane(1.5f)); CHECK(collider.getShapeType() == Raz::ShapeType::PLANE); CHECK(collider.getShape().getDistance() == 1.5f); diff --git a/tests/src/RaZ/Physics/PhysicsSystem.cpp b/tests/src/RaZ/Physics/PhysicsSystem.cpp index 1816773a..6adfe11f 100644 --- a/tests/src/RaZ/Physics/PhysicsSystem.cpp +++ b/tests/src/RaZ/Physics/PhysicsSystem.cpp @@ -8,7 +8,7 @@ #include "RaZ/Physics/RigidBody.hpp" #include "RaZ/Utils/Shape.hpp" -TEST_CASE("PhysicsSystem basic") { +TEST_CASE("PhysicsSystem basic", "[physics]") { Raz::PhysicsSystem physics; CHECK(physics.getGravity() == Raz::Vec3f(0.f, -9.80665f, 0.f)); CHECK(physics.getFriction() == 0.95f); @@ -19,7 +19,7 @@ TEST_CASE("PhysicsSystem basic") { CHECK(physics.getFriction() == 0.25f); } -TEST_CASE("PhysicsSystem accepted components") { +TEST_CASE("PhysicsSystem accepted components", "[physics]") { Raz::World world(2); auto& physics = world.addSystem(); @@ -33,7 +33,7 @@ TEST_CASE("PhysicsSystem accepted components") { CHECK(physics.containsEntity(collider)); } -TEST_CASE("PhysicsSystem rigid bodies collision") { +TEST_CASE("PhysicsSystem rigid bodies collision", "[physics]") { Raz::World world(4); float remainingTime {}; diff --git a/tests/src/RaZ/Physics/RigidBody.cpp b/tests/src/RaZ/Physics/RigidBody.cpp index 54ba774a..99d85e9a 100644 --- a/tests/src/RaZ/Physics/RigidBody.cpp +++ b/tests/src/RaZ/Physics/RigidBody.cpp @@ -2,7 +2,7 @@ #include "RaZ/Physics/RigidBody.hpp" -TEST_CASE("RigidBody basic") { +TEST_CASE("RigidBody basic", "[physics]") { Raz::RigidBody rigidBody(1.1f, 0.25f); CHECK(rigidBody.getMass() == 1.1f); CHECK(rigidBody.getInvMass() == 0.909090877f); diff --git a/tests/src/RaZ/Render/Camera.cpp b/tests/src/RaZ/Render/Camera.cpp index ad5f2b79..e8598069 100644 --- a/tests/src/RaZ/Render/Camera.cpp +++ b/tests/src/RaZ/Render/Camera.cpp @@ -5,7 +5,7 @@ using namespace Raz::Literals; -TEST_CASE("Camera view") { +TEST_CASE("Camera view", "[render]") { Raz::Camera camera; const Raz::Quaternionf rotation(45_deg, Raz::Axis::Y); @@ -27,7 +27,7 @@ TEST_CASE("Camera view") { CHECK(viewMat == Raz::Mat4f::identity()); } -TEST_CASE("Camera look-at") { +TEST_CASE("Camera look-at", "[render]") { Raz::Camera camera; const Raz::Mat4f& viewMat = camera.computeLookAt(Raz::Vec3f(0.f)); @@ -61,7 +61,7 @@ TEST_CASE("Camera look-at") { 0.f, 0.f, 0.f, 1.f))); } -TEST_CASE("Camera perspective projection") { +TEST_CASE("Camera perspective projection", "[render]") { Raz::Camera camera(800, 400, 45_deg, 0.1f, 1000.f, Raz::ProjectionType::PERSPECTIVE); CHECK(camera.computeProjectionMatrix().strictlyEquals(camera.computePerspectiveMatrix())); // Checking that the camera is a perspective one @@ -79,7 +79,7 @@ TEST_CASE("Camera perspective projection") { 0.f, 0.f, -1.f, 0.f))); } -TEST_CASE("Camera orthographic projection") { +TEST_CASE("Camera orthographic projection", "[render]") { Raz::Camera camera(800, 400, 45_deg, 0.1f, 1000.f, Raz::ProjectionType::ORTHOGRAPHIC); CHECK(camera.computeProjectionMatrix().strictlyEquals(camera.computeOrthographicMatrix())); // Checking that the camera is an orthographic one @@ -97,7 +97,7 @@ TEST_CASE("Camera orthographic projection") { 0.f, 0.f, 0.f, 1.f))); } -TEST_CASE("Camera point unprojection") { +TEST_CASE("Camera point unprojection", "[render]") { Raz::Camera camera(320, 180); Raz::Transform camTrans(Raz::Vec3f(5.f)); diff --git a/tests/src/RaZ/Render/Cubemap.cpp b/tests/src/RaZ/Render/Cubemap.cpp index e2d9fde5..3f0210ff 100644 --- a/tests/src/RaZ/Render/Cubemap.cpp +++ b/tests/src/RaZ/Render/Cubemap.cpp @@ -4,9 +4,8 @@ #include "RaZ/Data/ImageFormat.hpp" #include "RaZ/Render/Cubemap.hpp" #include "RaZ/Render/Renderer.hpp" -#include "RaZ/Utils/FilePath.hpp" -TEST_CASE("Cubemap move") { +TEST_CASE("Cubemap move", "[render]") { Raz::Cubemap cubemap; const unsigned int cubemapIndex = cubemap.getIndex(); @@ -36,7 +35,7 @@ TEST_CASE("Cubemap move") { CHECK(movedCubemapCtor.getIndex() == movedCubemapOpIndex); } -TEST_CASE("Cubemap textures") { +TEST_CASE("Cubemap textures", "[render]") { Raz::Renderer::recoverErrors(); // Flushing errors const Raz::Image refImgPosX = Raz::ImageFormat::load(RAZ_TESTS_ROOT "assets/textures/₀₀₀₀.png"); diff --git a/tests/src/RaZ/Render/Framebuffer.cpp b/tests/src/RaZ/Render/Framebuffer.cpp index 51508194..c0e95b19 100644 --- a/tests/src/RaZ/Render/Framebuffer.cpp +++ b/tests/src/RaZ/Render/Framebuffer.cpp @@ -3,7 +3,7 @@ #include "RaZ/Render/Framebuffer.hpp" #include "RaZ/Render/Texture.hpp" -TEST_CASE("Framebuffer buffers") { +TEST_CASE("Framebuffer buffers", "[render]") { Raz::Framebuffer framebuffer; CHECK_FALSE(framebuffer.hasDepthBuffer()); CHECK(framebuffer.getColorBufferCount() == 0); @@ -57,7 +57,7 @@ TEST_CASE("Framebuffer buffers") { CHECK(framebuffer.isEmpty()); // Both depth & color buffers have been removed } -TEST_CASE("Framebuffer move") { +TEST_CASE("Framebuffer move", "[render]") { Raz::Framebuffer framebuffer; const unsigned int framebufferIndex = framebuffer.getIndex(); diff --git a/tests/src/RaZ/Render/Material.cpp b/tests/src/RaZ/Render/Material.cpp index 926949ba..2ccf3b8f 100644 --- a/tests/src/RaZ/Render/Material.cpp +++ b/tests/src/RaZ/Render/Material.cpp @@ -2,7 +2,7 @@ #include "RaZ/Render/Material.hpp" -TEST_CASE("Material predefined types") { +TEST_CASE("Material predefined types", "[render]") { Raz::Material material(Raz::MaterialType::COOK_TORRANCE); CHECK(material.getProgram().getAttributeCount() == 4); diff --git a/tests/src/RaZ/Render/MeshRenderer.cpp b/tests/src/RaZ/Render/MeshRenderer.cpp index 2777ddfa..502a6ef5 100644 --- a/tests/src/RaZ/Render/MeshRenderer.cpp +++ b/tests/src/RaZ/Render/MeshRenderer.cpp @@ -4,7 +4,7 @@ #include "RaZ/Render/MeshRenderer.hpp" #include "RaZ/Utils/Shape.hpp" -TEST_CASE("MeshRenderer materials") { +TEST_CASE("MeshRenderer materials", "[render]") { Raz::MeshRenderer meshRenderer; CHECK(meshRenderer.getSubmeshRenderers().empty()); @@ -54,7 +54,7 @@ TEST_CASE("MeshRenderer materials") { CHECK(meshRenderer.getSubmeshRenderers()[2].getMaterialIndex() == std::numeric_limits::max()); } -TEST_CASE("MeshRenderer clone") { +TEST_CASE("MeshRenderer clone", "[render]") { Raz::MeshRenderer meshRenderer; meshRenderer.addSubmeshRenderer().setMaterialIndex(42); @@ -74,7 +74,7 @@ TEST_CASE("MeshRenderer clone") { CHECK(clonedMeshRenderer.getMaterials()[1].getProgram().getAttribute(Raz::MaterialAttribute::BaseColor) == Raz::Vec3f(0.5f)); } -TEST_CASE("MeshRenderer loading") { +TEST_CASE("MeshRenderer loading", "[render]") { Raz::MeshRenderer meshRenderer(Raz::Mesh(Raz::Sphere(Raz::Vec3f(0.f), 1.f), 1, Raz::SphereMeshType::UV)); CHECK(meshRenderer.getSubmeshRenderers().size() == 1); diff --git a/tests/src/RaZ/Render/RenderGraph.cpp b/tests/src/RaZ/Render/RenderGraph.cpp index 9aa5af08..6ae79956 100644 --- a/tests/src/RaZ/Render/RenderGraph.cpp +++ b/tests/src/RaZ/Render/RenderGraph.cpp @@ -2,7 +2,7 @@ #include "RaZ/Render/RenderGraph.hpp" -TEST_CASE("RenderGraph validity") { +TEST_CASE("RenderGraph validity", "[render]") { Raz::RenderGraph graph; CHECK(graph.isValid()); diff --git a/tests/src/RaZ/Render/RenderPass.cpp b/tests/src/RaZ/Render/RenderPass.cpp index a87b1e77..9cce57db 100644 --- a/tests/src/RaZ/Render/RenderPass.cpp +++ b/tests/src/RaZ/Render/RenderPass.cpp @@ -3,7 +3,7 @@ #include "RaZ/Render/RenderPass.hpp" #include "RaZ/Render/Texture.hpp" -TEST_CASE("RenderPass validity") { +TEST_CASE("RenderPass validity", "[render]") { Raz::RenderPass initialPass; CHECK(initialPass.isValid()); // The pass has no buffer, thus is valid @@ -40,7 +40,7 @@ TEST_CASE("RenderPass validity") { CHECK(nextPass.isValid()); // The color buffer is only set as read, the pass is valid again } -TEST_CASE("RenderPass textures") { +TEST_CASE("RenderPass textures", "[render]") { Raz::RenderPass initialPass; CHECK(initialPass.getReadTextureCount() == 0); CHECK_FALSE(initialPass.getFramebuffer().hasDepthBuffer()); diff --git a/tests/src/RaZ/Render/RenderProcess.cpp b/tests/src/RaZ/Render/RenderProcess.cpp index 30c11183..82ceaa3e 100644 --- a/tests/src/RaZ/Render/RenderProcess.cpp +++ b/tests/src/RaZ/Render/RenderProcess.cpp @@ -51,7 +51,7 @@ Raz::Image renderFrame(Raz::World& world, const Raz::Texture2DPtr& output, const } // namespace -TEST_CASE("ChromaticAberrationRenderProcess execution") { +TEST_CASE("ChromaticAberrationRenderProcess execution", "[render]") { Raz::World world; const Raz::Window& window = TestUtils::getWindow(); @@ -93,7 +93,7 @@ TEST_CASE("ChromaticAberrationRenderProcess execution") { IsNearlyEqualToImage(Raz::ImageFormat::load(RAZ_TESTS_ROOT "assets/renders/cook-torrance_ball_chromatic_aberration.png", true))); } -TEST_CASE("ConvolutionRenderProcess execution") { +TEST_CASE("ConvolutionRenderProcess execution", "[render]") { Raz::World world; const Raz::Window& window = TestUtils::getWindow(); @@ -125,7 +125,7 @@ TEST_CASE("ConvolutionRenderProcess execution") { CHECK_THAT(renderFrame(world, output), IsNearlyEqualToImage(Raz::ImageFormat::load(RAZ_TESTS_ROOT "assets/renders/cook-torrance_ball_convolved.png", true))); } -TEST_CASE("FilmGrainRenderProcess execution") { +TEST_CASE("FilmGrainRenderProcess execution", "[render]") { Raz::World world; const Raz::Window& window = TestUtils::getWindow(); @@ -148,7 +148,7 @@ TEST_CASE("FilmGrainRenderProcess execution") { CHECK_THAT(renderFrame(world, output), IsNearlyEqualToImage(Raz::ImageFormat::load(RAZ_TESTS_ROOT "assets/renders/film_grain_strong.png", true), 0.062f)); } -TEST_CASE("PixelizationRenderProcess execution") { +TEST_CASE("PixelizationRenderProcess execution", "[render]") { Raz::World world; const Raz::Window& window = TestUtils::getWindow(); @@ -175,7 +175,7 @@ TEST_CASE("PixelizationRenderProcess execution") { CHECK_THAT(renderFrame(world, output), IsNearlyEqualToImage(Raz::ImageFormat::load(RAZ_TESTS_ROOT "assets/renders/cook-torrance_ball_pixelated.png", true))); } -TEST_CASE("VignetteRenderProcess execution") { +TEST_CASE("VignetteRenderProcess execution", "[render]") { Raz::World world; const Raz::Window& window = TestUtils::getWindow(); diff --git a/tests/src/RaZ/Render/RenderSystem.cpp b/tests/src/RaZ/Render/RenderSystem.cpp index 4a926e8f..2d85a76c 100644 --- a/tests/src/RaZ/Render/RenderSystem.cpp +++ b/tests/src/RaZ/Render/RenderSystem.cpp @@ -34,7 +34,7 @@ Raz::Image renderFrame(Raz::World& world, const Raz::FilePath& renderedImgPath = } // namespace -TEST_CASE("RenderSystem accepted components") { +TEST_CASE("RenderSystem accepted components", "[render]") { Raz::World world(3); auto& renderSystem = world.addSystem(0, 0); @@ -51,7 +51,7 @@ TEST_CASE("RenderSystem accepted components") { CHECK(renderSystem.containsEntity(light)); } -TEST_CASE("RenderSystem Cook-Torrance ball") { +TEST_CASE("RenderSystem Cook-Torrance ball", "[render]") { Raz::World world(7); const Raz::Window& window = TestUtils::getWindow(); @@ -93,7 +93,7 @@ TEST_CASE("RenderSystem Cook-Torrance ball") { } #if !defined(RAZ_NO_OVERLAY) -TEST_CASE("RenderSystem overlay render") { +TEST_CASE("RenderSystem overlay render", "[render]") { Raz::World world(1); Raz::Window& window = TestUtils::getWindow(); diff --git a/tests/src/RaZ/Render/Shader.cpp b/tests/src/RaZ/Render/Shader.cpp index 5dce9d36..b040d538 100644 --- a/tests/src/RaZ/Render/Shader.cpp +++ b/tests/src/RaZ/Render/Shader.cpp @@ -17,7 +17,7 @@ inline void checkShader(const Raz::Shader& shader, const Raz::FilePath& path = { } // namespace -TEST_CASE("Shader validity") { +TEST_CASE("Shader validity", "[render]") { Raz::Renderer::recoverErrors(); // Flushing errors { @@ -89,7 +89,7 @@ TEST_CASE("Shader validity") { #endif } -TEST_CASE("Shader clone") { +TEST_CASE("Shader clone", "[render]") { // The content of the shaders does not need to be valid for this test const Raz::FilePath shaderPath = RAZ_TESTS_ROOT "assets/shaders/basic.comp"; constexpr std::string_view shaderSource = "Shader source test"; @@ -158,7 +158,7 @@ TEST_CASE("Shader clone") { #endif } -TEST_CASE("Vertex shader from source") { +TEST_CASE("Vertex shader from source", "[render]") { Raz::Renderer::recoverErrors(); // Flushing errors const std::string vertSource = R"( @@ -173,7 +173,7 @@ TEST_CASE("Vertex shader from source") { } #if !defined(USE_OPENGL_ES) -TEST_CASE("Tessellation control shader from source") { +TEST_CASE("Tessellation control shader from source", "[render]") { // Tessellation shaders are only available in OpenGL 4.0+ or with the 'GL_ARB_tessellation_shader' extension if (!Raz::Renderer::checkVersion(4, 0) && !Raz::Renderer::isExtensionSupported("GL_ARB_tessellation_shader")) return; @@ -201,7 +201,7 @@ TEST_CASE("Tessellation control shader from source") { checkShader(Raz::TessellationControlShader::loadFromSource("#version 400\n" + tessCtrlSource)); } -TEST_CASE("Tessellation evaluation shader from source") { +TEST_CASE("Tessellation evaluation shader from source", "[render]") { // Tessellation shaders are only available in OpenGL 4.0+ or with the 'GL_ARB_tessellation_shader' extension if (!Raz::Renderer::checkVersion(4, 0) && !Raz::Renderer::isExtensionSupported("GL_ARB_tessellation_shader")) return; @@ -224,7 +224,7 @@ TEST_CASE("Tessellation evaluation shader from source") { } #endif -TEST_CASE("Fragment shader from source") { +TEST_CASE("Fragment shader from source", "[render]") { Raz::Renderer::recoverErrors(); // Flushing errors const std::string fragSource = R"( @@ -241,7 +241,7 @@ TEST_CASE("Fragment shader from source") { } #if !defined(USE_WEBGL) -TEST_CASE("Compute shader from source") { +TEST_CASE("Compute shader from source", "[render]") { // Compute shaders are only available in OpenGL 4.3+ or with the relevant extension if (!Raz::Renderer::checkVersion(4, 3) && !Raz::Renderer::isExtensionSupported("GL_ARB_compute_shader")) return; @@ -266,7 +266,7 @@ TEST_CASE("Compute shader from source") { } #endif -TEST_CASE("Vertex shader imported") { +TEST_CASE("Vertex shader imported", "[render]") { Raz::Renderer::recoverErrors(); // Flushing errors const Raz::FilePath vertShaderPath = RAZ_TESTS_ROOT "../shaders/common.vert"; @@ -276,7 +276,7 @@ TEST_CASE("Vertex shader imported") { } #if !defined(USE_OPENGL_ES) -TEST_CASE("Tessellation control shader imported") { +TEST_CASE("Tessellation control shader imported", "[render]") { // Tessellation shaders are only available in OpenGL 4.0+ or with the 'GL_ARB_tessellation_shader' extension if (!Raz::Renderer::checkVersion(4, 0) && !Raz::Renderer::isExtensionSupported("GL_ARB_tessellation_shader")) return; @@ -289,7 +289,7 @@ TEST_CASE("Tessellation control shader imported") { checkShader(tessCtrlShader, tessCtrlShaderPath); } -TEST_CASE("Tessellation evaluation shader imported") { +TEST_CASE("Tessellation evaluation shader imported", "[render]") { // Tessellation shaders are only available in OpenGL 4.0+ or with the 'GL_ARB_tessellation_shader' extension if (!Raz::Renderer::checkVersion(4, 0) && !Raz::Renderer::isExtensionSupported("GL_ARB_tessellation_shader")) return; @@ -303,7 +303,7 @@ TEST_CASE("Tessellation evaluation shader imported") { } #endif -TEST_CASE("Fragment shader imported") { +TEST_CASE("Fragment shader imported", "[render]") { Raz::Renderer::recoverErrors(); // Flushing errors const Raz::FilePath fragShaderPath = RAZ_TESTS_ROOT "../shaders/lambert.frag"; @@ -313,7 +313,7 @@ TEST_CASE("Fragment shader imported") { } #if !defined(USE_WEBGL) -TEST_CASE("Compute shader imported") { +TEST_CASE("Compute shader imported", "[render]") { // Compute shaders are only available in OpenGL 4.3+ or with the relevant extension if (!Raz::Renderer::checkVersion(4, 3) && !Raz::Renderer::isExtensionSupported("GL_ARB_compute_shader")) return; diff --git a/tests/src/RaZ/Render/ShaderProgram.cpp b/tests/src/RaZ/Render/ShaderProgram.cpp index f9f46490..1e70aa60 100644 --- a/tests/src/RaZ/Render/ShaderProgram.cpp +++ b/tests/src/RaZ/Render/ShaderProgram.cpp @@ -115,7 +115,7 @@ void checkUniformInfo(const std::unordered_map& corres } // namespace -TEST_CASE("ShaderProgram move") { +TEST_CASE("ShaderProgram move", "[render]") { { Raz::RenderShaderProgram programBase; @@ -198,7 +198,7 @@ TEST_CASE("ShaderProgram move") { #endif } -TEST_CASE("ShaderProgram attributes") { +TEST_CASE("ShaderProgram attributes", "[render]") { TestShaderProgram program; CHECK(program.getAttributeCount() == 0); @@ -229,7 +229,7 @@ TEST_CASE("ShaderProgram attributes") { CHECK_FALSE(program.hasAttribute("attrib2")); } -TEST_CASE("ShaderProgram textures") { +TEST_CASE("ShaderProgram textures", "[render]") { TestShaderProgram program; CHECK(program.getTextureCount() == 0); @@ -287,7 +287,7 @@ TEST_CASE("ShaderProgram textures") { } #if !defined(USE_WEBGL) -TEST_CASE("ShaderProgram image textures") { +TEST_CASE("ShaderProgram image textures", "[render]") { TestShaderProgram program; CHECK(program.getImageTextureCount() == 0); @@ -348,7 +348,7 @@ TEST_CASE("ShaderProgram image textures") { } #endif -TEST_CASE("RenderShaderProgram creation") { +TEST_CASE("RenderShaderProgram creation", "[render]") { Raz::Renderer::recoverErrors(); // Flushing errors { @@ -422,7 +422,7 @@ TEST_CASE("RenderShaderProgram creation") { } } -TEST_CASE("RenderShaderProgram uniforms") { +TEST_CASE("RenderShaderProgram uniforms", "[render]") { Raz::Renderer::recoverErrors(); // Flushing errors Raz::RenderShaderProgram program(Raz::VertexShader::loadFromSource(vertSource), Raz::FragmentShader::loadFromSource(fragSource)); @@ -477,7 +477,7 @@ TEST_CASE("RenderShaderProgram uniforms") { } #if !defined(USE_WEBGL) -TEST_CASE("ComputeShaderProgram creation") { +TEST_CASE("ComputeShaderProgram creation", "[render]") { // Compute shaders are only available in OpenGL 4.3+ or with the relevant extension if (!Raz::Renderer::checkVersion(4, 3) && !Raz::Renderer::isExtensionSupported("GL_ARB_compute_shader")) return; @@ -514,7 +514,7 @@ TEST_CASE("ComputeShaderProgram creation") { } } -TEST_CASE("ComputeShaderProgram uniforms") { +TEST_CASE("ComputeShaderProgram uniforms", "[render]") { // Compute shaders are only available in OpenGL 4.3+ or with the relevant extension if (!Raz::Renderer::checkVersion(4, 3) && !Raz::Renderer::isExtensionSupported("GL_ARB_compute_shader")) return; diff --git a/tests/src/RaZ/Render/SubmeshRenderer.cpp b/tests/src/RaZ/Render/SubmeshRenderer.cpp index cfbe085d..ce97cb5a 100644 --- a/tests/src/RaZ/Render/SubmeshRenderer.cpp +++ b/tests/src/RaZ/Render/SubmeshRenderer.cpp @@ -1,13 +1,11 @@ #include "Catch.hpp" -#include "RaZ/Data/Mesh.hpp" #include "RaZ/Render/SubmeshRenderer.hpp" -#include "RaZ/Utils/Shape.hpp" -TEST_CASE("SubmeshRenderer clone") { +TEST_CASE("SubmeshRenderer clone", "[render]") { Raz::SubmeshRenderer submeshRenderer; submeshRenderer.setMaterialIndex(42); - Raz::SubmeshRenderer clonedSubmeshRenderer = submeshRenderer.clone(); + const Raz::SubmeshRenderer clonedSubmeshRenderer = submeshRenderer.clone(); CHECK(clonedSubmeshRenderer.getMaterialIndex() == 42); } diff --git a/tests/src/RaZ/Render/Texture.cpp b/tests/src/RaZ/Render/Texture.cpp index a76d11e2..b52bbdcf 100644 --- a/tests/src/RaZ/Render/Texture.cpp +++ b/tests/src/RaZ/Render/Texture.cpp @@ -5,7 +5,7 @@ #include "RaZ/Render/Renderer.hpp" #include "RaZ/Render/Texture.hpp" -TEST_CASE("Texture creation") { +TEST_CASE("Texture creation", "[render]") { Raz::Renderer::recoverErrors(); // Flushing errors #if !defined(USE_OPENGL_ES) // 1D textures are unavailable with OpenGL ES @@ -44,7 +44,7 @@ TEST_CASE("Texture creation") { CHECK(texture3D.getDataType() == Raz::TextureDataType::BYTE); } -TEST_CASE("Texture move") { +TEST_CASE("Texture move", "[render]") { Raz::Renderer::recoverErrors(); // Flushing errors #if !defined(USE_OPENGL_ES) // 1D textures are unavailable with OpenGL ES @@ -217,7 +217,7 @@ TEST_CASE("Texture3D load image slices") { Raz::Image(1, 1, Raz::ImageColorspace::GRAY, Raz::ImageDataType::FLOAT) })); // Different data types } -TEST_CASE("Texture fill") { +TEST_CASE("Texture fill", "[render]") { Raz::Renderer::recoverErrors(); // Flushing errors #if !defined(USE_OPENGL_ES) diff --git a/tests/src/RaZ/Script/LuaAnimation.cpp b/tests/src/RaZ/Script/LuaAnimation.cpp index fa758df6..d0ae3bbe 100644 --- a/tests/src/RaZ/Script/LuaAnimation.cpp +++ b/tests/src/RaZ/Script/LuaAnimation.cpp @@ -2,7 +2,7 @@ #include "RaZ/Script/LuaWrapper.hpp" -TEST_CASE("LuaAnimation Skeleton") { +TEST_CASE("LuaAnimation Skeleton", "[script][lua][animation]") { CHECK(Raz::LuaWrapper::execute(R"( local skeleton = Skeleton.new() skeleton = Skeleton.new(0) diff --git a/tests/src/RaZ/Script/LuaAudio.cpp b/tests/src/RaZ/Script/LuaAudio.cpp index 654fa9b6..7029149e 100644 --- a/tests/src/RaZ/Script/LuaAudio.cpp +++ b/tests/src/RaZ/Script/LuaAudio.cpp @@ -2,7 +2,7 @@ #include "RaZ/Script/LuaWrapper.hpp" -TEST_CASE("LuaAudio AudioSystem") { +TEST_CASE("LuaAudio AudioSystem", "[script][lua][audio]") { CHECK(Raz::LuaWrapper::execute(R"( local audioSystem = AudioSystem.new() audioSystem = AudioSystem.new("") @@ -20,7 +20,7 @@ TEST_CASE("LuaAudio AudioSystem") { )")); } -TEST_CASE("LuaAudio Listener") { +TEST_CASE("LuaAudio Listener", "[script][lua][audio]") { CHECK(Raz::LuaWrapper::execute(R"( local audioSystem = AudioSystem.new() -- Initializing the audio device & context, needed before all audio action @@ -49,7 +49,7 @@ TEST_CASE("LuaAudio Listener") { )")); } -TEST_CASE("LuaAudio Microphone") { +TEST_CASE("LuaAudio Microphone", "[script][lua][audio]") { CHECK(Raz::LuaWrapper::execute(R"( local microphone = Microphone.new(AudioFormat.MONO_U8, 8000, 1) microphone = Microphone.new(AudioFormat.MONO_I16, 8000, 1, "") @@ -67,7 +67,7 @@ TEST_CASE("LuaAudio Microphone") { )")); } -TEST_CASE("LuaAudio Sound") { +TEST_CASE("LuaAudio Sound", "[script][lua][audio]") { CHECK(Raz::LuaWrapper::execute(R"( local audioSystem = AudioSystem.new() -- Initializing the audio device & context, needed before all audio action @@ -113,7 +113,7 @@ TEST_CASE("LuaAudio Sound") { } #if !defined(RAZ_PLATFORM_EMSCRIPTEN) -TEST_CASE("LuaAudio SoundEffect") { +TEST_CASE("LuaAudio SoundEffect", "[script][lua][audio]") { CHECK(Raz::LuaWrapper::execute(R"( local audioSystem = AudioSystem.new() -- Initializing the audio device & context, needed before all audio action @@ -178,7 +178,7 @@ TEST_CASE("LuaAudio SoundEffect") { )")); } -TEST_CASE("LuaAudio SoundEffectSlot") { +TEST_CASE("LuaAudio SoundEffectSlot", "[script][lua][audio]") { CHECK(Raz::LuaWrapper::execute(R"( local audioSystem = AudioSystem.new() -- Initializing the audio device & context, needed before all audio action diff --git a/tests/src/RaZ/Script/LuaCore.cpp b/tests/src/RaZ/Script/LuaCore.cpp index 95447d3f..a9632c46 100644 --- a/tests/src/RaZ/Script/LuaCore.cpp +++ b/tests/src/RaZ/Script/LuaCore.cpp @@ -2,7 +2,7 @@ #include "RaZ/Script/LuaWrapper.hpp" -TEST_CASE("LuaCore Application") { +TEST_CASE("LuaCore Application", "[script][lua][core]") { CHECK(Raz::LuaWrapper::execute(R"( local frameTimeInfo = FrameTimeInfo.new() @@ -31,7 +31,7 @@ TEST_CASE("LuaCore Application") { )")); } -TEST_CASE("LuaCore Entity") { +TEST_CASE("LuaCore Entity", "[script][lua][core]") { CHECK(Raz::LuaWrapper::execute(R"( local entity = Entity.new(0) entity = Entity.new(0, true) @@ -84,7 +84,7 @@ TEST_CASE("LuaCore Entity") { #endif } -TEST_CASE("LuaCore World") { +TEST_CASE("LuaCore World", "[script][lua][core]") { CHECK(Raz::LuaWrapper::execute(R"( local world = World.new() world = World.new(0) diff --git a/tests/src/RaZ/Script/LuaData.cpp b/tests/src/RaZ/Script/LuaData.cpp index 437e7508..7728f4dd 100644 --- a/tests/src/RaZ/Script/LuaData.cpp +++ b/tests/src/RaZ/Script/LuaData.cpp @@ -2,7 +2,7 @@ #include "RaZ/Script/LuaWrapper.hpp" -TEST_CASE("LuaData Bitset") { +TEST_CASE("LuaData Bitset", "[script][lua][data]") { CHECK(Raz::LuaWrapper::execute(R"( local bitset = Bitset.new() bitset = Bitset.new(1) @@ -32,7 +32,7 @@ TEST_CASE("LuaData Bitset") { )")); } -TEST_CASE("LuaData BvhSystem") { +TEST_CASE("LuaData BvhSystem", "[script][lua][data]") { CHECK(Raz::LuaWrapper::execute(R"( local bvhSystem = BvhSystem.new() @@ -61,7 +61,7 @@ TEST_CASE("LuaData BvhSystem") { )")); } -TEST_CASE("LuaData Color") { +TEST_CASE("LuaData Color", "[script][lua][data]") { CHECK(Raz::LuaWrapper::execute(R"( assert(Color.new() == ColorPreset.Black) assert(Color.new(Vec3f.new(1, 0, 0)) == ColorPreset.Red) @@ -74,7 +74,7 @@ TEST_CASE("LuaData Color") { )")); } -TEST_CASE("LuaData Image") { +TEST_CASE("LuaData Image", "[script][lua][data]") { CHECK(Raz::LuaWrapper::execute(R"( local img = Image.new() img = Image.new(ImageColorspace.GRAY) @@ -106,7 +106,7 @@ TEST_CASE("LuaData Image") { )")); } -TEST_CASE("LuaData Mesh") { +TEST_CASE("LuaData Mesh", "[script][lua][data]") { CHECK(Raz::LuaWrapper::execute(R"( local mesh = Mesh.new() mesh = Mesh.new(Plane.new(0), 0, 0) @@ -148,7 +148,7 @@ TEST_CASE("LuaData Mesh") { #endif } -TEST_CASE("LuaData Submesh") { +TEST_CASE("LuaData Submesh", "[script][lua][data]") { CHECK(Raz::LuaWrapper::execute(R"( local submesh = Submesh.new() diff --git a/tests/src/RaZ/Script/LuaEnvironment.cpp b/tests/src/RaZ/Script/LuaEnvironment.cpp index 08356190..d5976e03 100644 --- a/tests/src/RaZ/Script/LuaEnvironment.cpp +++ b/tests/src/RaZ/Script/LuaEnvironment.cpp @@ -3,7 +3,7 @@ #include "RaZ/Script/LuaEnvironment.hpp" #include "RaZ/Script/LuaWrapper.hpp" -TEST_CASE("LuaEnvironment exists") { +TEST_CASE("LuaEnvironment exists", "[script][lua]") { Raz::LuaWrapper::execute(R"( tests_env_var = 0 tests_env_func = function () end diff --git a/tests/src/RaZ/Script/LuaMath.cpp b/tests/src/RaZ/Script/LuaMath.cpp index 586b0945..6a76a174 100644 --- a/tests/src/RaZ/Script/LuaMath.cpp +++ b/tests/src/RaZ/Script/LuaMath.cpp @@ -2,7 +2,7 @@ #include "RaZ/Script/LuaWrapper.hpp" -TEST_CASE("LuaMath Angle") { +TEST_CASE("LuaMath Angle", "[script][lua][math]") { CHECK(Raz::LuaWrapper::execute(R"( local deg = Degreesf.new(180) assert(-deg == Degreesf.new(-180)) @@ -22,7 +22,7 @@ TEST_CASE("LuaMath Angle") { )")); } -TEST_CASE("LuaMath MathUtils") { +TEST_CASE("LuaMath MathUtils", "[script][lua][math]") { CHECK(Raz::LuaWrapper::execute(R"( assert(MathUtils.lerp(1, 2, 0.25) == 1.25) assert(MathUtils.lerp(Vec3f.new(1), Vec3f.new(2), 0.25) == Vec3f.new(1.25)) @@ -35,7 +35,7 @@ TEST_CASE("LuaMath MathUtils") { )")); } -TEST_CASE("LuaMath Matrix") { +TEST_CASE("LuaMath Matrix", "[script][lua][math]") { CHECK(Raz::LuaWrapper::execute(R"( local mat2 = Mat2f.new() mat2 = Mat2f.new(Mat3f.identity()) @@ -182,7 +182,7 @@ TEST_CASE("LuaMath Matrix") { )")); } -TEST_CASE("LuaMath PerlinNoise") { +TEST_CASE("LuaMath PerlinNoise", "[script][lua][math]") { CHECK(Raz::LuaWrapper::execute(R"( assert(FloatUtils.areNearlyEqual(PerlinNoise.compute1D(0.1), -0.106848)) assert(FloatUtils.areNearlyEqual(PerlinNoise.compute1D(0.1, 2), -0.224224)) @@ -198,7 +198,7 @@ TEST_CASE("LuaMath PerlinNoise") { )")); } -TEST_CASE("LuaMath Quaternion") { +TEST_CASE("LuaMath Quaternion", "[script][lua][math]") { CHECK(Raz::LuaWrapper::execute(R"( local quat = Quaternionf.new(1, 0, 0, 0) quat = Quaternionf.identity() @@ -233,7 +233,7 @@ TEST_CASE("LuaMath Quaternion") { )")); } -TEST_CASE("LuaMath Transform") { +TEST_CASE("LuaMath Transform", "[script][lua][math]") { CHECK(Raz::LuaWrapper::execute(R"( local trans = Transform.new() trans = Transform.new(Vec3f.new()) @@ -280,7 +280,7 @@ TEST_CASE("LuaMath Transform") { )")); } -TEST_CASE("LuaMath Vector byte") { +TEST_CASE("LuaMath Vector byte", "[script][lua][math]") { CHECK(Raz::LuaWrapper::execute(R"( local vec2 = Vec2b.new() vec2 = Vec2b.new(1) @@ -354,7 +354,7 @@ TEST_CASE("LuaMath Vector byte") { )")); } -TEST_CASE("LuaMath Vector float") { +TEST_CASE("LuaMath Vector float", "[script][lua][math]") { CHECK(Raz::LuaWrapper::execute(R"( local vec2 = Vec2f.new() vec2 = Vec2f.new(1) diff --git a/tests/src/RaZ/Script/LuaPhysics.cpp b/tests/src/RaZ/Script/LuaPhysics.cpp index a718163a..6561f730 100644 --- a/tests/src/RaZ/Script/LuaPhysics.cpp +++ b/tests/src/RaZ/Script/LuaPhysics.cpp @@ -2,7 +2,7 @@ #include "RaZ/Script/LuaWrapper.hpp" -TEST_CASE("LuaPhysics Collider") { +TEST_CASE("LuaPhysics Collider", "[script][lua][physics]") { CHECK(Raz::LuaWrapper::execute(R"( local collider = Collider.new() @@ -20,7 +20,7 @@ TEST_CASE("LuaPhysics Collider") { )")); } -TEST_CASE("LuaPhysics PhysicsSystem") { +TEST_CASE("LuaPhysics PhysicsSystem", "[script][lua][physics]") { CHECK(Raz::LuaWrapper::execute(R"( local physicsSystem = PhysicsSystem.new() @@ -36,7 +36,7 @@ TEST_CASE("LuaPhysics PhysicsSystem") { )")); } -TEST_CASE("LuaPhysics RigidBody") { +TEST_CASE("LuaPhysics RigidBody", "[script][lua][physics]") { CHECK(Raz::LuaWrapper::execute(R"( local rigidBody = RigidBody.new(0, 0) diff --git a/tests/src/RaZ/Script/LuaRender.cpp b/tests/src/RaZ/Script/LuaRender.cpp index b2f65f2f..ec90752d 100644 --- a/tests/src/RaZ/Script/LuaRender.cpp +++ b/tests/src/RaZ/Script/LuaRender.cpp @@ -3,7 +3,7 @@ #include "RaZ/Render/Renderer.hpp" #include "RaZ/Script/LuaWrapper.hpp" -TEST_CASE("LuaRender Camera") { +TEST_CASE("LuaRender Camera", "[script][lua][render]") { CHECK(Raz::LuaWrapper::execute(R"( local camera = Camera.new() camera = Camera.new(1, 1) @@ -37,7 +37,7 @@ TEST_CASE("LuaRender Camera") { )")); } -TEST_CASE("LuaRender Cubemap") { +TEST_CASE("LuaRender Cubemap", "[script][lua][render]") { CHECK(Raz::LuaWrapper::execute(R"( local cubemap = Cubemap.new() cubemap = Cubemap.new(Image.new(1, 1, ImageColorspace.GRAY), Image.new(1, 1, ImageColorspace.GRAY_ALPHA), @@ -57,7 +57,7 @@ TEST_CASE("LuaRender Cubemap") { )")); } -TEST_CASE("LuaRender Framebuffer") { +TEST_CASE("LuaRender Framebuffer", "[script][lua][render]") { CHECK(Raz::LuaWrapper::execute(R"( local framebuffer = Framebuffer.new() @@ -82,7 +82,7 @@ TEST_CASE("LuaRender Framebuffer") { )")); } -TEST_CASE("LuaRender GraphicObjects") { +TEST_CASE("LuaRender GraphicObjects", "[script][lua][render]") { CHECK(Raz::LuaWrapper::execute(R"( local indexBuffer = IndexBuffer.new() assert(indexBuffer:getIndex() ~= 0) @@ -104,7 +104,7 @@ TEST_CASE("LuaRender GraphicObjects") { )")); } -TEST_CASE("LuaRender Light") { +TEST_CASE("LuaRender Light", "[script][lua][render]") { CHECK(Raz::LuaWrapper::execute(R"( local light = Light.new(LightType.POINT, 1) light = Light.new(LightType.POINT, 1, ColorPreset.White) @@ -126,7 +126,7 @@ TEST_CASE("LuaRender Light") { )")); } -TEST_CASE("LuaRender Material") { +TEST_CASE("LuaRender Material", "[script][lua][render]") { CHECK(Raz::LuaWrapper::execute(R"( local material = Material.new() material = Material.new(MaterialType.BLINN_PHONG) @@ -138,7 +138,7 @@ TEST_CASE("LuaRender Material") { )")); } -TEST_CASE("LuaRender MeshRenderer") { +TEST_CASE("LuaRender MeshRenderer", "[script][lua][render]") { CHECK(Raz::LuaWrapper::execute(R"( local meshRenderer = MeshRenderer.new() meshRenderer = MeshRenderer.new(Mesh.new()) @@ -167,7 +167,7 @@ TEST_CASE("LuaRender MeshRenderer") { } #if !defined(RAZ_NO_OVERLAY) -TEST_CASE("LuaRender Overlay") { +TEST_CASE("LuaRender Overlay", "[script][lua][render]") { CHECK(Raz::LuaWrapper::execute(R"( local overlay = Overlay.new() overlay:addWindow("Test") @@ -365,7 +365,7 @@ TEST_CASE("LuaRender Overlay") { } #endif -TEST_CASE("LuaRender RenderGraph") { +TEST_CASE("LuaRender RenderGraph", "[script][lua][render]") { CHECK(Raz::LuaWrapper::execute(R"( local renderGraph = RenderGraph.new() @@ -392,7 +392,7 @@ TEST_CASE("LuaRender RenderGraph") { )")); } -TEST_CASE("LuaRender RenderPass") { +TEST_CASE("LuaRender RenderPass", "[script][lua][render]") { CHECK(Raz::LuaWrapper::execute(R"( local renderPass = RenderPass.new() local renderPass2 = RenderPass.new() @@ -445,7 +445,7 @@ TEST_CASE("LuaRender RenderPass") { #endif } -TEST_CASE("LuaRender RenderProcess") { +TEST_CASE("LuaRender RenderProcess", "[script][lua][render]") { CHECK(Raz::LuaWrapper::execute(R"( local renderGraph = RenderGraph.new() local renderPass = RenderPass.new() @@ -573,7 +573,7 @@ TEST_CASE("LuaRender RenderProcess") { )")); } -TEST_CASE("LuaRender RenderSystem") { +TEST_CASE("LuaRender RenderSystem", "[script][lua][render]") { CHECK(Raz::LuaWrapper::execute(R"( local renderSystem = RenderSystem.new() renderSystem = RenderSystem.new(1, 1) @@ -616,7 +616,7 @@ TEST_CASE("LuaRender RenderSystem") { #endif } -TEST_CASE("LuaRender Shader") { +TEST_CASE("LuaRender Shader", "[script][lua][render]") { if (Raz::Renderer::checkVersion(4, 3) || Raz::Renderer::isExtensionSupported("GL_ARB_compute_shader")) { CHECK(Raz::LuaWrapper::execute(R"( local computeShader = ComputeShader.new() @@ -706,7 +706,7 @@ TEST_CASE("LuaRender Shader") { )")); } -TEST_CASE("LuaRender ShaderProgram") { +TEST_CASE("LuaRender ShaderProgram", "[script][lua][render]") { #if !defined(USE_WEBGL) if (Raz::Renderer::checkVersion(4, 3) || Raz::Renderer::isExtensionSupported("GL_ARB_compute_shader")) { CHECK(Raz::LuaWrapper::execute(R"( @@ -898,7 +898,7 @@ TEST_CASE("LuaRender ShaderProgram") { #endif } -TEST_CASE("LuaRender SubmeshRenderer") { +TEST_CASE("LuaRender SubmeshRenderer", "[script][lua][render]") { CHECK(Raz::LuaWrapper::execute(R"( local submeshRenderer = SubmeshRenderer.new() submeshRenderer = SubmeshRenderer.new(Submesh.new()) @@ -915,7 +915,7 @@ TEST_CASE("LuaRender SubmeshRenderer") { )")); } -TEST_CASE("LuaRender Texture") { +TEST_CASE("LuaRender Texture", "[script][lua][render]") { #if !defined(USE_OPENGL_ES) CHECK(Raz::LuaWrapper::execute(R"( local tex1D = Texture1D.new(TextureColorspace.INVALID) @@ -1028,7 +1028,7 @@ TEST_CASE("LuaRender Texture") { )")); } -TEST_CASE("LuaRender UniformBuffer") { +TEST_CASE("LuaRender UniformBuffer", "[script][lua][render]") { CHECK(Raz::LuaWrapper::execute(R"( local uniformBuffer = UniformBuffer.new(1) uniformBuffer = UniformBuffer.new(1, UniformBufferUsage.DYNAMIC) @@ -1052,7 +1052,7 @@ TEST_CASE("LuaRender UniformBuffer") { )")); } -TEST_CASE("LuaRender Window") { +TEST_CASE("LuaRender Window", "[script][lua][render]") { CHECK(Raz::LuaWrapper::execute(R"( local renderSystem = RenderSystem.new() -- A RenderSystem is needed to use a Window diff --git a/tests/src/RaZ/Script/LuaScript.cpp b/tests/src/RaZ/Script/LuaScript.cpp index 3271d70c..ef26c42f 100644 --- a/tests/src/RaZ/Script/LuaScript.cpp +++ b/tests/src/RaZ/Script/LuaScript.cpp @@ -3,13 +3,13 @@ #include "RaZ/Application.hpp" #include "RaZ/Script/LuaScript.hpp" -TEST_CASE("LuaScript validity") { - CHECK_THROWS(Raz::LuaScript({})); // Empty script +TEST_CASE("LuaScript validity", "[script][lua]") { + CHECK_THROWS(Raz::LuaScript("")); // Empty script CHECK_THROWS(Raz::LuaScript("local a = 3")); // No update() function CHECK_NOTHROW(Raz::LuaScript("function update () end")); } -TEST_CASE("LuaScript code") { +TEST_CASE("LuaScript code", "[script][lua]") { Raz::LuaScript script(R"( tests_script_var = 0 function tests_script_func () end @@ -28,7 +28,7 @@ TEST_CASE("LuaScript code") { CHECK(script.getEnvironment().exists("update")); } -TEST_CASE("LuaScript register") { +TEST_CASE("LuaScript register", "[script][lua]") { Raz::LuaScript script("function update () return entity1 == entity2 end"); const Raz::Entity entity(0); @@ -49,7 +49,7 @@ TEST_CASE("LuaScript register") { CHECK_FALSE(script.getEnvironment().exists("entity2")); } -TEST_CASE("LuaScript execution") { +TEST_CASE("LuaScript execution", "[script][lua]") { Raz::LuaScript script("function update() end"); CHECK(script.update({})); // update() does not return anything, which is the same as returning true diff --git a/tests/src/RaZ/Script/LuaUtils.cpp b/tests/src/RaZ/Script/LuaUtils.cpp index 35151cb7..baabe3ad 100644 --- a/tests/src/RaZ/Script/LuaUtils.cpp +++ b/tests/src/RaZ/Script/LuaUtils.cpp @@ -2,7 +2,7 @@ #include "RaZ/Script/LuaWrapper.hpp" -TEST_CASE("LuaUtils FilePath") { +TEST_CASE("LuaUtils FilePath", "[script][lua][utils]") { CHECK(Raz::LuaWrapper::execute(R"( local pathStr = "../test/file.txt" @@ -28,7 +28,7 @@ TEST_CASE("LuaUtils FilePath") { )")); } -TEST_CASE("LuaUtils FileUtils") { +TEST_CASE("LuaUtils FileUtils", "[script][lua][utils]") { CHECK(Raz::LuaWrapper::execute(R"( assert(FileUtils.isReadable(FilePath.new(RAZ_TESTS_ROOT .. "assets/misc/ͳεs†_fílè_测试.τxt"))) assert(FileUtils.readFileToArray(FilePath.new(RAZ_TESTS_ROOT .. "assets/misc/ͳεs†_fílè_测试.τxt")):size() == 22) @@ -36,7 +36,7 @@ TEST_CASE("LuaUtils FileUtils") { )")); } -TEST_CASE("LuaUtils Logger") { +TEST_CASE("LuaUtils Logger", "[script][lua][utils]") { CHECK(Raz::LuaWrapper::execute(R"( Logger.setLoggingLevel(LoggingLevel.ERROR) Logger.setLoggingLevel(LoggingLevel.WARNING) @@ -55,7 +55,7 @@ TEST_CASE("LuaUtils Logger") { )")); } -TEST_CASE("LuaUtils Ray") { +TEST_CASE("LuaUtils Ray", "[script][lua][utils]") { CHECK(Raz::LuaWrapper::execute(R"( local rayHit = RayHit.new() @@ -92,7 +92,7 @@ TEST_CASE("LuaUtils Ray") { )")); } -TEST_CASE("LuaUtils Shape") { +TEST_CASE("LuaUtils Shape", "[script][lua][utils]") { CHECK(Raz::LuaWrapper::execute(R"( local aabb = AABB.new(Vec3f.new(-1), Vec3f.new(1)) assert(aabb:getMinPosition() == Vec3f.new(-1)) @@ -169,7 +169,7 @@ TEST_CASE("LuaUtils Shape") { )")); } -TEST_CASE("LuaUtils StrUtils") { +TEST_CASE("LuaUtils StrUtils", "[script][lua][utils]") { CHECK(Raz::LuaWrapper::execute(R"( assert(StrUtils.startsWith("test", "te")) assert(StrUtils.endsWith("test", "st")) diff --git a/tests/src/RaZ/Script/LuaWrapper.cpp b/tests/src/RaZ/Script/LuaWrapper.cpp index 376909f5..7f0f23b8 100644 --- a/tests/src/RaZ/Script/LuaWrapper.cpp +++ b/tests/src/RaZ/Script/LuaWrapper.cpp @@ -2,7 +2,7 @@ #include "RaZ/Script/LuaWrapper.hpp" -TEST_CASE("LuaWrapper code execution") { +TEST_CASE("LuaWrapper code execution", "[script][lua]") { CHECK_FALSE(Raz::LuaWrapper::execute("")); CHECK_FALSE(Raz::LuaWrapper::execute("this code is invalid")); CHECK(Raz::LuaWrapper::execute(R"( @@ -12,7 +12,7 @@ TEST_CASE("LuaWrapper code execution") { )")); } -TEST_CASE("LuaWrapper file execution") { +TEST_CASE("LuaWrapper file execution", "[script][lua]") { CHECK_FALSE(Raz::LuaWrapper::executeFromFile("")); CHECK_FALSE(Raz::LuaWrapper::executeFromFile(RAZ_TESTS_ROOT "assets/scripts/invalid.lua")); CHECK(Raz::LuaWrapper::executeFromFile(RAZ_TESTS_ROOT "assets/scripts/basic.lua")); diff --git a/tests/src/RaZ/Script/ScriptSystem.cpp b/tests/src/RaZ/Script/ScriptSystem.cpp index 17f2d446..9bdbc9de 100644 --- a/tests/src/RaZ/Script/ScriptSystem.cpp +++ b/tests/src/RaZ/Script/ScriptSystem.cpp @@ -6,7 +6,7 @@ #include "RaZ/Script/LuaScript.hpp" #include "RaZ/Script/ScriptSystem.hpp" -TEST_CASE("ScriptSystem accepted components") { +TEST_CASE("ScriptSystem accepted components", "[script][lua]") { Raz::World world; auto& scriptSystem = world.addSystem(); @@ -18,7 +18,7 @@ TEST_CASE("ScriptSystem accepted components") { CHECK(scriptSystem.containsEntity(luaScript)); } -TEST_CASE("ScriptSystem registration") { +TEST_CASE("ScriptSystem registration", "[script][lua]") { Raz::World world; world.addSystem(); @@ -42,7 +42,7 @@ TEST_CASE("ScriptSystem registration") { CHECK(luaScript.update({})); } -TEST_CASE("ScriptSystem setup") { +TEST_CASE("ScriptSystem setup", "[script][lua]") { Raz::World world; world.addSystem(); @@ -65,7 +65,7 @@ TEST_CASE("ScriptSystem setup") { CHECK(entityTrans.getPosition() == Raz::Vec3f(2.f)); // Updating the world again does not execute the setup } -TEST_CASE("ScriptSystem update") { +TEST_CASE("ScriptSystem update", "[script][lua]") { Raz::World world; world.addSystem(); diff --git a/tests/src/RaZ/System.cpp b/tests/src/RaZ/System.cpp index 36392f17..cc2cf7fe 100644 --- a/tests/src/RaZ/System.cpp +++ b/tests/src/RaZ/System.cpp @@ -15,7 +15,7 @@ class TestSystem : public Raz::System { bool update(const Raz::FrameTimeInfo&) override { return true; } }; -TEST_CASE("System basic") { +TEST_CASE("System basic", "[core]") { TestSystem testSystem {}; Raz::EntityPtr mesh = Raz::Entity::create(0); diff --git a/tests/src/RaZ/Utils/EnumUtils.cpp b/tests/src/RaZ/Utils/EnumUtils.cpp index d62990a6..8f32901a 100644 --- a/tests/src/RaZ/Utils/EnumUtils.cpp +++ b/tests/src/RaZ/Utils/EnumUtils.cpp @@ -12,7 +12,7 @@ enum class EnumTest : unsigned int { MAKE_ENUM_FLAG(EnumTest) -TEST_CASE("EnumUtils make enum flag") { +TEST_CASE("EnumUtils make enum flag", "[utils]") { constexpr EnumTest zero = EnumTest::ONE & EnumTest::TWO; constexpr EnumTest three = EnumTest::ONE | EnumTest::TWO; constexpr EnumTest one = three & EnumTest::ONE; diff --git a/tests/src/RaZ/Utils/FilePath.cpp b/tests/src/RaZ/Utils/FilePath.cpp index 4aebae62..348ae334 100644 --- a/tests/src/RaZ/Utils/FilePath.cpp +++ b/tests/src/RaZ/Utils/FilePath.cpp @@ -11,7 +11,7 @@ const Raz::FilePath filePath(RAZ_TESTS_ROOT "assets/misc/" + fileName); } // namespace -TEST_CASE("FilePath constructors") { +TEST_CASE("FilePath constructors", "[utils]") { const Raz::FilePath pathChar("spêçïàl/fílè/paτh"); const Raz::FilePath pathString(std::string("spêçïàl/fílè/paτh")); const Raz::FilePath pathStringView(std::string_view("spêçïàl/fílè/paτh")); @@ -20,7 +20,7 @@ TEST_CASE("FilePath constructors") { CHECK(pathString == pathStringView); } -TEST_CASE("FilePath open special chars") { +TEST_CASE("FilePath open special chars", "[utils]") { std::ifstream file(filePath.getPathStr()); REQUIRE(file.is_open()); @@ -32,7 +32,7 @@ TEST_CASE("FilePath open special chars") { CHECK(fileContent == "НΣļlõ ωθяŁĐ!"); } -TEST_CASE("FilePath save special chars") { +TEST_CASE("FilePath save special chars", "[utils]") { const Raz::FilePath path(fileName); { @@ -50,7 +50,7 @@ TEST_CASE("FilePath save special chars") { CHECK(fileContent == "НΣļlõ ωθяŁĐ!"); } -TEST_CASE("FilePath concatenation") { +TEST_CASE("FilePath concatenation", "[utils]") { const Raz::FilePath testPath = "tèstPâth"; // operator+(char) @@ -120,7 +120,7 @@ TEST_CASE("FilePath concatenation") { } } -TEST_CASE("FilePath utilities") { +TEST_CASE("FilePath utilities", "[utils]") { CHECK(filePath.recoverPathToFile() == (RAZ_TESTS_ROOT "assets/misc/")); CHECK(filePath.recoverFileName(/* true */) == "ͳεs†_fílè_测试.τxt"); CHECK(filePath.recoverFileName(false) == "ͳεs†_fílè_测试"); @@ -157,7 +157,7 @@ TEST_CASE("FilePath utilities") { CHECK(Raz::FilePath::recoverExtension(mixedSeparatorsTestPath) == "êxt"); } -TEST_CASE("FilePath printing") { +TEST_CASE("FilePath printing", "[utils]") { const Raz::FilePath testPath = "tèstPâth"; // operator<<(std::ostream) diff --git a/tests/src/RaZ/Utils/FileUtils.cpp b/tests/src/RaZ/Utils/FileUtils.cpp index a5df8f84..c5430f4e 100644 --- a/tests/src/RaZ/Utils/FileUtils.cpp +++ b/tests/src/RaZ/Utils/FileUtils.cpp @@ -12,13 +12,13 @@ const Raz::FilePath asciiFilePath(RAZ_TESTS_ROOT "assets/misc/Test_file.txt"); } // namespace -TEST_CASE("FileUtils is readable") { +TEST_CASE("FileUtils is readable", "[utils]") { CHECK(Raz::FileUtils::isReadable(encodedFilePath)); CHECK(Raz::FileUtils::isReadable(asciiFilePath)); CHECK_FALSE(Raz::FileUtils::isReadable("this_file_does_not_exist.txt")); } -TEST_CASE("FileUtils read file to array") { +TEST_CASE("FileUtils read file to array", "[utils]") { { const std::vector fileContent = Raz::FileUtils::readFileToArray(encodedFilePath); CHECK(fileContent.size() == 22); @@ -37,7 +37,7 @@ TEST_CASE("FileUtils read file to array") { } } -TEST_CASE("FileUtils read file to string") { +TEST_CASE("FileUtils read file to string", "[utils]") { { const std::string fileContent = Raz::FileUtils::readFileToString(encodedFilePath); CHECK(fileContent.size() == 22); // This doesn't represent the actual character count due to the encoding diff --git a/tests/src/RaZ/Utils/FloatUtils.cpp b/tests/src/RaZ/Utils/FloatUtils.cpp index 11ca902b..6d95ee42 100644 --- a/tests/src/RaZ/Utils/FloatUtils.cpp +++ b/tests/src/RaZ/Utils/FloatUtils.cpp @@ -2,7 +2,7 @@ #include "RaZ/Utils/FloatUtils.hpp" -TEST_CASE("Near-equality absolute") { +TEST_CASE("Near-equality absolute", "[utils]") { constexpr float floatEpsilon = std::numeric_limits::epsilon(); constexpr double doubleEpsilon = std::numeric_limits::epsilon(); constexpr long double longDoubleEpsilon = std::numeric_limits::epsilon(); diff --git a/tests/src/RaZ/Utils/Logger.cpp b/tests/src/RaZ/Utils/Logger.cpp index 1cb7daa4..b3a53237 100644 --- a/tests/src/RaZ/Utils/Logger.cpp +++ b/tests/src/RaZ/Utils/Logger.cpp @@ -2,7 +2,7 @@ #include "RaZ/Utils/Logger.hpp" -TEST_CASE("Logger custom function") { +TEST_CASE("Logger custom function", "[utils]") { Raz::Logger::setLoggingLevel(Raz::LoggingLevel::ALL); std::string str; @@ -56,7 +56,7 @@ TEST_CASE("Logger custom function") { Raz::Logger::setLoggingLevel(Raz::LoggingLevel::NONE); } -TEST_CASE("Logger levels") { +TEST_CASE("Logger levels", "[utils]") { std::string str; Raz::Logger::setLoggingFunction([&str] (Raz::LoggingLevel, const std::string&) { str = 'a'; }); diff --git a/tests/src/RaZ/Utils/Plugin.cpp b/tests/src/RaZ/Utils/Plugin.cpp index 4213241a..c0d66d86 100644 --- a/tests/src/RaZ/Utils/Plugin.cpp +++ b/tests/src/RaZ/Utils/Plugin.cpp @@ -3,7 +3,7 @@ #include "RaZ/Utils/FilePath.hpp" #include "RaZ/Utils/Plugin.hpp" -TEST_CASE("Plugin load") { +TEST_CASE("Plugin load", "[utils]") { #if defined(RAZ_PLATFORM_WINDOWS) Raz::Plugin plugin(RAZ_TESTS_ROOT "assets/misc/PlûgïnTést.dll"); #else diff --git a/tests/src/RaZ/Utils/Ray.cpp b/tests/src/RaZ/Utils/Ray.cpp index bcb7af09..a8522322 100644 --- a/tests/src/RaZ/Utils/Ray.cpp +++ b/tests/src/RaZ/Utils/Ray.cpp @@ -20,7 +20,7 @@ constexpr Raz::Ray ray3(Raz::Vec3f(1.f, 1.f, 0.f), Raz::Vec3f(-0.707106769f, -0. } // namespace -TEST_CASE("Ray-point intersection") { +TEST_CASE("Ray-point intersection", "[utils]") { Raz::RayHit hit; CHECK(ray1.intersects(ray1.getOrigin(), &hit)); @@ -73,7 +73,7 @@ TEST_CASE("Ray-point intersection") { CHECK_FALSE(ray3.intersects(topRightPoint)); } -TEST_CASE("Ray-plane intersection") { +TEST_CASE("Ray-plane intersection", "[utils]") { // Plane 1 | Plane 2 | Plane 3 | Plane 4 // | | | // \ normal | \ | / | @@ -107,7 +107,7 @@ TEST_CASE("Ray-plane intersection") { CHECK(ray3.intersects(plane4)); } -TEST_CASE("Ray-sphere intersection") { +TEST_CASE("Ray-sphere intersection", "[utils]") { // See: https://www.geogebra.org/m/sn7ajcj2 const Raz::Sphere sphere1(Raz::Vec3f(0.f), 1.f); @@ -155,7 +155,7 @@ TEST_CASE("Ray-sphere intersection") { CHECK_THAT(hit.distance, IsNearlyEqualTo(14.5563498f)); } -TEST_CASE("Ray-triangle intersection") { +TEST_CASE("Ray-triangle intersection", "[utils]") { // See: https://www.geogebra.org/m/e8uqvjwh // These triangles are defined so that: @@ -206,7 +206,7 @@ TEST_CASE("Ray-triangle intersection") { CHECK_THAT(hit.distance, IsNearlyEqualTo(3.5355341f)); } -TEST_CASE("Ray-AABB intersection") { +TEST_CASE("Ray-AABB intersection", "[utils]") { // _______________________ // /| /| // / | / | / 1 -> [ 0.5; 0.5; 0.5 ] @@ -266,9 +266,9 @@ TEST_CASE("Ray-AABB intersection") { CHECK_THAT(hit.distance, IsNearlyEqualTo(9.8994951f)); // TODO: - // A check must be made with a ray's origin lying precisely on a slab - // When this happens, with a naive implementation, only NaNs are returned; however, this ray must be considered intersecting the box properly - // See: https://tavianator.com/fast-branchless-raybounding-box-intersections-part-2-nans/ + // A check must be made with a ray's origin lying precisely on a slab + // When this happens, with a naive implementation, only NaNs are returned; however, this ray must be considered intersecting the box properly + // See: https://tavianator.com/fast-branchless-raybounding-box-intersections-part-2-nans/ //const Raz::Ray slabRay(Raz::Vec3f(-0.5f, -0.5f, 0.f), Raz::Axis::Y); //CHECK(slabRay.intersects(aabb1, &hit)); @@ -277,7 +277,7 @@ TEST_CASE("Ray-AABB intersection") { //CHECK(hit.distance == 0.f); } -TEST_CASE("Point projection") { +TEST_CASE("Point projection", "[utils]") { const Raz::Vec3f topPoint(0.f, 2.f, 0.f); const Raz::Vec3f topRightPoint(2.f, 2.f, 0.f); diff --git a/tests/src/RaZ/Utils/Shape.cpp b/tests/src/RaZ/Utils/Shape.cpp index 34c7d952..98dc00a7 100644 --- a/tests/src/RaZ/Utils/Shape.cpp +++ b/tests/src/RaZ/Utils/Shape.cpp @@ -80,7 +80,7 @@ const Raz::AABB aabb3(Raz::Vec3f(-10.f, -10.f, -5.f), Raz::Vec3f(-6.f, -5.f, 5.f } // namespace -TEST_CASE("Line basic") { +TEST_CASE("Line basic", "[utils]") { // See: https://www.geogebra.org/m/fbq8scce CHECK(line1.computeCentroid() == Raz::Vec3f(0.5f, 0.f, 0.f)); @@ -101,7 +101,7 @@ TEST_CASE("Line basic") { CHECK_THAT(line4.computeLength(), IsNearlyEqualTo(22.6274166f)); } -TEST_CASE("Line point containment") { +TEST_CASE("Line point containment", "[utils]") { CHECK(line1.contains(line1.getBeginPos())); CHECK(line1.contains(line1.getEndPos())); CHECK(line1.contains(line1.computeCentroid())); @@ -115,7 +115,7 @@ TEST_CASE("Line point containment") { CHECK(line4.contains(line4.computeCentroid())); } -TEST_CASE("Line-plane intersection") { +TEST_CASE("Line-plane intersection", "[utils]") { CHECK_FALSE(line1.intersects(plane1)); CHECK(line1.intersects(plane2)); CHECK_FALSE(line1.intersects(plane3)); @@ -141,7 +141,7 @@ TEST_CASE("Line-plane intersection") { CHECK(reverseTestLine.intersects(testPlane)); } -TEST_CASE("Line-AABB intersection") { +TEST_CASE("Line-AABB intersection", "[utils]") { // See: https://www.geogebra.org/m/fru9r3r6 CHECK(line1.intersects(aabb1)); @@ -161,7 +161,7 @@ TEST_CASE("Line-AABB intersection") { CHECK(line4.intersects(aabb3)); } -TEST_CASE("Line translation") { +TEST_CASE("Line translation", "[utils]") { Raz::Line line1Copy = line1; line1Copy.translate(Raz::Vec3f(1.f)); @@ -173,7 +173,7 @@ TEST_CASE("Line translation") { CHECK(line1Copy.getEndPos() == line1.getEndPos()); } -TEST_CASE("Line point projection") { +TEST_CASE("Line point projection", "[utils]") { CHECK(line1.computeProjection(line1.getBeginPos()) == line1.getBeginPos()); CHECK(line1.computeProjection(line1.getEndPos()) == line1.getEndPos()); const Raz::Vec3f centroid1 = line1.computeCentroid(); @@ -202,14 +202,14 @@ TEST_CASE("Line point projection") { CHECK(line4.computeProjection(furtherBegin) == Raz::Vec3f(-9.5f, -9.5f, 0.f)); } -TEST_CASE("Line bounding box") { +TEST_CASE("Line bounding box", "[utils]") { CHECK(line1.computeBoundingBox() == Raz::AABB(Raz::Vec3f(0.f), Raz::Vec3f(1.f, 0.f, 0.f))); CHECK(line2.computeBoundingBox() == Raz::AABB(Raz::Vec3f(0.f), Raz::Vec3f(0.f, 1.f, 0.f))); CHECK(line3.computeBoundingBox() == Raz::AABB(Raz::Vec3f(1.5f, 2.5f, 0.f), Raz::Vec3f(5.5f, 5.f, 0.f))); CHECK(line4.computeBoundingBox() == Raz::AABB(Raz::Vec3f(-10.f, -10.f, 0.f), Raz::Vec3f(6.f, 6.f, 0.f))); } -TEST_CASE("Line equality") { +TEST_CASE("Line equality", "[utils]") { CHECK(line1 == line1); CHECK(line2 == line2); @@ -221,7 +221,7 @@ TEST_CASE("Line equality") { CHECK(line1Copy == line1); } -TEST_CASE("Plane basic") { +TEST_CASE("Plane basic", "[utils]") { const Raz::Plane testPlane1(1.f, Raz::Axis::Y); CHECK(testPlane1.getDistance() == 1.f); @@ -239,7 +239,7 @@ TEST_CASE("Plane basic") { CHECK(testPlane2.getNormal() == testPlane3.getNormal()); } -TEST_CASE("Plane-plane intersection") { +TEST_CASE("Plane-plane intersection", "[utils]") { const Raz::Plane testPlane(2.f, -Raz::Axis::Y); CHECK_FALSE(plane1.intersects(testPlane)); @@ -256,7 +256,7 @@ TEST_CASE("Plane-plane intersection") { CHECK_FALSE(plane3.intersects(plane3)); } -TEST_CASE("Plane-sphere intersection") { +TEST_CASE("Plane-sphere intersection", "[utils]") { // See: https://www.geogebra.org/m/r3brvcsn CHECK(plane1.intersects(sphere1)); @@ -272,7 +272,7 @@ TEST_CASE("Plane-sphere intersection") { CHECK(plane3.intersects(sphere3)); } -TEST_CASE("Plane translation") { +TEST_CASE("Plane translation", "[utils]") { { Raz::Plane plane1Copy = plane1; @@ -310,7 +310,7 @@ TEST_CASE("Plane translation") { } } -TEST_CASE("Plane equality") { +TEST_CASE("Plane equality", "[utils]") { CHECK(plane1 == plane1); CHECK(plane2 == plane2); @@ -322,7 +322,7 @@ TEST_CASE("Plane equality") { CHECK(plane1Copy == plane1); } -TEST_CASE("Sphere point containment") { +TEST_CASE("Sphere point containment", "[utils]") { CHECK(sphere1.contains(sphere1.getCenter())); CHECK(sphere1.contains(Raz::Vec3f(0.f, 1.f, 0.f))); // Right on the sphere's border CHECK_FALSE(sphere1.contains(Raz::Vec3f(0.f, 1.f + std::numeric_limits::epsilon(), 0.f))); @@ -336,7 +336,7 @@ TEST_CASE("Sphere point containment") { CHECK_FALSE(sphere3.contains(Raz::Vec3f(sphere3.getCenter().x(), sphere3.getCenter().y(), sphere3.getRadius() + std::numeric_limits::epsilon()))); } -TEST_CASE("Sphere-sphere intersection") { +TEST_CASE("Sphere-sphere intersection", "[utils]") { // See: https://www.geogebra.org/m/tsfueyp5 const Raz::Sphere testSphere(Raz::Vec3f(0.f), 13.15f); // This sphere intersects all the test ones @@ -356,7 +356,7 @@ TEST_CASE("Sphere-sphere intersection") { CHECK(testSphere.intersects(sphere3)); } -TEST_CASE("Sphere translation") { +TEST_CASE("Sphere translation", "[utils]") { Raz::Sphere sphere1Copy = sphere1; sphere1Copy.translate(Raz::Vec3f(1.f)); @@ -368,13 +368,13 @@ TEST_CASE("Sphere translation") { CHECK(sphere1Copy.getRadius() == sphere1.getRadius()); } -TEST_CASE("Sphere bounding box") { +TEST_CASE("Sphere bounding box", "[utils]") { CHECK(sphere1.computeBoundingBox() == Raz::AABB(Raz::Vec3f(-1.f), Raz::Vec3f(1.f))); CHECK(sphere2.computeBoundingBox() == Raz::AABB(Raz::Vec3f(0.f, 5.f, -5.f), Raz::Vec3f(10.f, 15.f, 5.f))); CHECK(sphere3.computeBoundingBox() == Raz::AABB(Raz::Vec3f(-11.f, -11.f, -1.f), Raz::Vec3f(-9.f, -9.f, 1.f))); } -TEST_CASE("Sphere equality") { +TEST_CASE("Sphere equality", "[utils]") { CHECK(sphere1 == sphere1); CHECK(sphere2 == sphere2); @@ -386,7 +386,7 @@ TEST_CASE("Sphere equality") { CHECK(sphere1Copy == sphere1); } -TEST_CASE("Triangle basic") { +TEST_CASE("Triangle basic", "[utils]") { // See: https://www.geogebra.org/m/gszsn33d CHECK(triangle1.computeCentroid() == Raz::Vec3f(0.f, 0.5f, 0.f)); @@ -399,7 +399,7 @@ TEST_CASE("Triangle basic") { CHECK_THAT(triangle3.computeNormal(), IsNearlyEqualToVector(Raz::Vec3f(0.077791f, -0.93349177f, 0.35005942f))); } -TEST_CASE("Triangle translation") { +TEST_CASE("Triangle translation", "[utils]") { Raz::Triangle triangle1Copy = triangle1; triangle1Copy.translate(Raz::Vec3f(1.f)); @@ -413,13 +413,13 @@ TEST_CASE("Triangle translation") { CHECK(triangle1Copy.getThirdPos() == triangle1.getThirdPos()); } -TEST_CASE("Triangle bounding box") { +TEST_CASE("Triangle bounding box", "[utils]") { CHECK(triangle1.computeBoundingBox() == Raz::AABB(Raz::Vec3f(-3.f, 0.5f, -6.f), Raz::Vec3f(3.f, 0.5f, 3.f))); CHECK(triangle2.computeBoundingBox() == Raz::AABB(Raz::Vec3f(0.5f, -0.5f, -3.f), Raz::Vec3f(0.5f, 3.f, 3.f))); CHECK(triangle3.computeBoundingBox() == Raz::AABB(Raz::Vec3f(-1.5f, -1.75f, -1.f), Raz::Vec3f(0.f, -1.f, 1.f))); } -TEST_CASE("Triangle clockwiseness") { +TEST_CASE("Triangle clockwiseness", "[utils]") { CHECK(triangle1.isCounterClockwise(Raz::Axis::Y)); CHECK(triangle2.isCounterClockwise(Raz::Axis::X)); CHECK(triangle3.isCounterClockwise(-Raz::Axis::Y)); // Pointing roughly towards -Y @@ -438,7 +438,7 @@ TEST_CASE("Triangle clockwiseness") { CHECK(testTriangle2.isCounterClockwise(Raz::Axis::Z)); } -TEST_CASE("Triangle equality") { +TEST_CASE("Triangle equality", "[utils]") { CHECK(triangle1 == triangle1); CHECK(triangle2 == triangle2); @@ -450,7 +450,7 @@ TEST_CASE("Triangle equality") { CHECK(triangle1Copy == triangle1); } -TEST_CASE("AABB basic") { +TEST_CASE("AABB basic", "[utils]") { CHECK(aabb1.computeCentroid() == Raz::Vec3f(0.f)); CHECK(aabb2.computeCentroid() == Raz::Vec3f(3.5f, 4.f, 0.f)); CHECK(aabb3.computeCentroid() == Raz::Vec3f(-8.f, -7.5f, 0.f)); @@ -460,7 +460,7 @@ TEST_CASE("AABB basic") { CHECK(aabb3.computeHalfExtents() == Raz::Vec3f(2.f, 2.5f, 5.f)); } -TEST_CASE("AABB point containment") { +TEST_CASE("AABB point containment", "[utils]") { // See: https://www.geogebra.org/m/kwkkt9ry CHECK(aabb1.contains(aabb1.computeCentroid())); @@ -494,7 +494,7 @@ TEST_CASE("AABB point containment") { CHECK_FALSE(aabb3.contains(point5)); } -TEST_CASE("AABB-AABB intersection") { +TEST_CASE("AABB-AABB intersection", "[utils]") { CHECK(aabb1.intersects(aabb1)); // A box always intersects itself CHECK(aabb2.intersects(aabb2)); CHECK(aabb3.intersects(aabb3)); @@ -531,7 +531,7 @@ TEST_CASE("AABB-AABB intersection") { } } -TEST_CASE("AABB translation") { +TEST_CASE("AABB translation", "[utils]") { Raz::AABB aabb1Copy = aabb1; aabb1Copy.translate(Raz::Vec3f(1.f)); @@ -543,13 +543,13 @@ TEST_CASE("AABB translation") { CHECK(aabb1Copy.getMaxPosition() == aabb1.getMaxPosition()); } -TEST_CASE("AABB bounding box") { +TEST_CASE("AABB bounding box", "[utils]") { CHECK(aabb1.computeBoundingBox() == aabb1); CHECK(aabb2.computeBoundingBox() == aabb2); CHECK(aabb3.computeBoundingBox() == aabb3); } -TEST_CASE("AABB equality") { +TEST_CASE("AABB equality", "[utils]") { CHECK(aabb1 == aabb1); CHECK(aabb2 == aabb2); diff --git a/tests/src/RaZ/Utils/StrUtils.cpp b/tests/src/RaZ/Utils/StrUtils.cpp index 2b586272..5eb66db9 100644 --- a/tests/src/RaZ/Utils/StrUtils.cpp +++ b/tests/src/RaZ/Utils/StrUtils.cpp @@ -2,7 +2,7 @@ #include "RaZ/Utils/StrUtils.hpp" -TEST_CASE("String starts/ends with") { +TEST_CASE("String starts/ends with", "[utils]") { // Standard strings { const std::string str = "this is a test"; @@ -34,7 +34,7 @@ TEST_CASE("String starts/ends with") { } } -TEST_CASE("String case change") { +TEST_CASE("String case change", "[utils]") { // Standard strings { const std::string lowerSimpleStr = "this is a test"; @@ -82,7 +82,7 @@ TEST_CASE("String case change") { } } -TEST_CASE("String trimming") { +TEST_CASE("String trimming", "[utils]") { // Standard strings { const std::string baseStr = " ͳhîs ís ä †èsτ "; @@ -120,7 +120,7 @@ TEST_CASE("String trimming") { } } -TEST_CASE("String splitting") { +TEST_CASE("String splitting", "[utils]") { // Standard strings { const std::string baseStr = "ͳhîs'†èsτ (ís ä) gøθd/†èsτ / "; diff --git a/tests/src/RaZ/Utils/ThreadPool.cpp b/tests/src/RaZ/Utils/ThreadPool.cpp index 18de412c..c58fb39b 100644 --- a/tests/src/RaZ/Utils/ThreadPool.cpp +++ b/tests/src/RaZ/Utils/ThreadPool.cpp @@ -5,7 +5,7 @@ #ifdef RAZ_THREADS_AVAILABLE -TEST_CASE("ThreadPool basic") { +TEST_CASE("ThreadPool basic", "[utils]") { Raz::ThreadPool pool; std::atomic i = 0; diff --git a/tests/src/RaZ/Utils/Threading.cpp b/tests/src/RaZ/Utils/Threading.cpp index 118d1191..0522485f 100644 --- a/tests/src/RaZ/Utils/Threading.cpp +++ b/tests/src/RaZ/Utils/Threading.cpp @@ -37,7 +37,7 @@ void iteratorParallelIncrementation(std::vector& values) { } // namespace -TEST_CASE("Threading async basic") { +TEST_CASE("Threading async basic", "[utils]") { std::future res = Raz::Threading::launchAsync([] () noexcept { return 42; }); @@ -47,14 +47,14 @@ TEST_CASE("Threading async basic") { CHECK(res.get() == 42); } -TEST_CASE("Threading simple parallelization") { +TEST_CASE("Threading simple parallelization", "[utils]") { std::atomic i = 0; Raz::Threading::parallelize([&i] () noexcept { ++i; }, 10); CHECK(i == 10); } -TEST_CASE("Threading multi parallelization") { +TEST_CASE("Threading multi parallelization", "[utils]") { std::atomic i = 0; Raz::Threading::parallelize({ [&i] () noexcept { ++i; }, @@ -67,7 +67,7 @@ TEST_CASE("Threading multi parallelization") { CHECK(i == 5); } -TEST_CASE("Threading index parallelization - divisible size") { +TEST_CASE("Threading index parallelization - divisible size", "[utils]") { std::vector values(2048); // Choosing a size that can be easily divided fillRandom(values); @@ -78,7 +78,7 @@ TEST_CASE("Threading index parallelization - divisible size") { CHECK(sumBeforeIncrement + values.size() == sumAfterIncrement); } -TEST_CASE("Threading index parallelization - indivisible size") { +TEST_CASE("Threading index parallelization - indivisible size", "[utils]") { std::vector values(2083); // Choosing a prime number as size, so that it can't be divided fillRandom(values); @@ -89,7 +89,7 @@ TEST_CASE("Threading index parallelization - indivisible size") { CHECK(sumBeforeIncrement + values.size() == sumAfterIncrement); } -TEST_CASE("Threading iterator parallelization - divisible size") { +TEST_CASE("Threading iterator parallelization - divisible size", "[utils]") { std::vector values(2048); // Choosing a size that can be easily divided fillRandom(values); @@ -100,7 +100,7 @@ TEST_CASE("Threading iterator parallelization - divisible size") { CHECK(sumBeforeIncrement + values.size() == sumAfterIncrement); } -TEST_CASE("Threading iterator parallelization - indivisible size") { +TEST_CASE("Threading iterator parallelization - indivisible size", "[utils]") { std::vector values(2083); // Choosing a prime number as size, so that it can't be divided fillRandom(values); @@ -111,7 +111,7 @@ TEST_CASE("Threading iterator parallelization - indivisible size") { CHECK(sumBeforeIncrement + values.size() == sumAfterIncrement); } -TEST_CASE("Threading parallelization empty input") { +TEST_CASE("Threading parallelization empty input", "[utils]") { CHECK_NOTHROW(Raz::Threading::parallelize(std::initializer_list>())); CHECK_THROWS(Raz::Threading::parallelize(0, 0, [] (const Raz::Threading::IndexRange&) noexcept {})); diff --git a/tests/src/RaZ/Utils/TypeUtils.cpp b/tests/src/RaZ/Utils/TypeUtils.cpp index 591a0fad..e49b9d28 100644 --- a/tests/src/RaZ/Utils/TypeUtils.cpp +++ b/tests/src/RaZ/Utils/TypeUtils.cpp @@ -32,7 +32,7 @@ enum class EnumTest { AGAIN }; -TEST_CASE("TypeUtils type str") { +TEST_CASE("TypeUtils type str", "[utils]") { int testInt {}; const int& testIntRef = testInt; @@ -61,7 +61,7 @@ TEST_CASE("TypeUtils type str") { #endif } -TEST_CASE("TypeUtils enum str") { +TEST_CASE("TypeUtils enum str", "[utils]") { #if defined(RAZ_COMPILER_GCC) && __GNUC__ < 9 // Prior to version 9, GCC prints enum values as (Type)value CHECK_NOFAIL(Raz::TypeUtils::getEnumStr() == "(EnumTest)0"); @@ -76,7 +76,7 @@ TEST_CASE("TypeUtils enum str") { #if !defined(RAZ_COMPILER_MSVC) -TEST_CASE("TypeUtils has attribute") { +TEST_CASE("TypeUtils has attribute", "[utils]") { CHECK(Raz::TypeUtils::hasDefaultConstructor()); CHECK(Raz::TypeUtils::hasCopyConstructor()); CHECK_FALSE(Raz::TypeUtils::hasMoveConstructor()); // Deleted diff --git a/tests/src/RaZ/World.cpp b/tests/src/RaZ/World.cpp index 644d3f80..fe241e59 100644 --- a/tests/src/RaZ/World.cpp +++ b/tests/src/RaZ/World.cpp @@ -2,7 +2,7 @@ #include "RaZ/World.hpp" -TEST_CASE("World entities manipulation") { +TEST_CASE("World entities manipulation", "[core]") { Raz::World world(3); // The constructor argument simply reserves the size for entities @@ -40,7 +40,7 @@ TEST_CASE("World entities manipulation") { CHECK_THROWS(world.removeEntity(extEntity)); } -TEST_CASE("World get entities with components") { +TEST_CASE("World get entities with components", "[core]") { struct TestComp1 : public Raz::Component {}; struct TestComp2 : public Raz::Component {}; @@ -77,7 +77,7 @@ TEST_CASE("World get entities with components") { CHECK(world.recoverEntitiesWithComponents().front() == &entity1); // Still has the first component } -TEST_CASE("World refresh") { +TEST_CASE("World refresh", "[core]") { Raz::World world(3); Raz::Entity& entity0 = world.addEntity(true);