From f7e087ee8d840d0e2f20bf2c988edab8a4a36d6c Mon Sep 17 00:00:00 2001 From: Nigel Barink Date: Sat, 13 May 2023 20:13:25 +0200 Subject: [PATCH] remove yaml-cpp from root directory, Add tests project --- Tests/EngineTest.cpp | 33 +++++++++++++++++++++++++++++++++ Tests/premake5.lua | 32 ++++++++++++++++++++++++++++++++ YoggieEngine/premake5.lua | 4 ++-- libraries.lua | 4 +++- premake5.lua | 19 ++++++++----------- yaml-cpp/premake5.lua | 13 ------------- 6 files changed, 78 insertions(+), 27 deletions(-) create mode 100644 Tests/EngineTest.cpp create mode 100644 Tests/premake5.lua delete mode 100644 yaml-cpp/premake5.lua diff --git a/Tests/EngineTest.cpp b/Tests/EngineTest.cpp new file mode 100644 index 0000000..9347e20 --- /dev/null +++ b/Tests/EngineTest.cpp @@ -0,0 +1,33 @@ +#include +#include + + +TEST(HelloTDD, MyFirstTest) { + EXPECT_EQ(1, 1); +}; + +TEST(TRANSFORM_COMPONENT_TESTS , CAN_EXTRACT_TRANSLATION_FROM_TRANSFORM_MATRIX) { + + auto component = YoggieEngine::TransformComponent{}; + + component.Position = glm::vec3(1.0f, 2.0f, 3.0f); + auto transformationMatrix = component.GetTransform(); + + auto newComponent = YoggieEngine::TransformComponent{}; + + newComponent.Decompose(transformationMatrix); + + EXPECT_EQ(newComponent.Position.x, component.Position.x); + EXPECT_EQ(newComponent.Position.y, component.Position.y); + EXPECT_EQ(newComponent.Position.z, component.Position.z); + +} + + +int main(int argc, char** argv) { + + + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); + +} \ No newline at end of file diff --git a/Tests/premake5.lua b/Tests/premake5.lua new file mode 100644 index 0000000..7c44806 --- /dev/null +++ b/Tests/premake5.lua @@ -0,0 +1,32 @@ +project "EngineTests" + kind "ConsoleApp" + language "C++" + targetdir "bin/%{cfg.buildcfg}" + + files{"**.h", "**.cpp"} + + includedirs{ + "../YoggieEngine/src", + incfolder["lua"], + incfolder["spdlog"], + incfolder["glm"], + incfolder["glad"], + incfolder["glfw"], + incfolder["imgui"], + incfolder["imguizmo"], + incfolder["entt"], + "../libs/physx/physx/include", + "../libs/physx/pxshared/include", + incfolder["GoogleTest"] + + } + + libdirs { + staticlib["yoggie"], + staticlib["GoogleTest"] + } + + links{ + "YoggieEngine", + "gtest" + } \ No newline at end of file diff --git a/YoggieEngine/premake5.lua b/YoggieEngine/premake5.lua index 4dcf375..78b7dd3 100644 --- a/YoggieEngine/premake5.lua +++ b/YoggieEngine/premake5.lua @@ -38,6 +38,7 @@ project "YoggieEngine" "../libs/steam-audio/include", "../libs/ImGui", + } links { @@ -65,8 +66,7 @@ project "YoggieEngine" "../libs/spdlog/build/Release", "../libs/assimp/lib/Debug", "../libs/glfw/build/src/Debug", - "../libs/physx/physx/bin/win.x86_64.vc142.md/debug" - + "../libs/physx/physx/bin/win.x86_64.vc142.md/debug", } files { diff --git a/libraries.lua b/libraries.lua index 421039f..d11563c 100644 --- a/libraries.lua +++ b/libraries.lua @@ -7,6 +7,8 @@ incfolder["glm"] = "%{wks.location}/libs/glm" incfolder["entt"] = "%{wks.location}/libs/entt/src" incfolder["yamlcpp"] = "%{wks.location}/libs/yaml-cpp/include" incfolder["mINI"] = "%{wks.location}/libs/mINI/src" +incfolder["GoogleTest"] = "%{wks.location}/libs/googletest/googletest/include" + -- Graphics incfolder["glad"] = "%{wks.location}/libs/glad/include" incfolder["glfw"] = "%{wks.location}/libs/glfw/include" @@ -32,4 +34,4 @@ staticlib = {} staticlib["yoggie"] = "Yoggie/build/Debug" staticlib["nativefiledialog"]= "%{wks.location}/libs/nativefiledialog/build/lib/Release/x64" - +staticlib["GoogleTest"] = "%{wks.location}/libs/googletest/build/lib/Debug" diff --git a/premake5.lua b/premake5.lua index 3ba729a..371b592 100644 --- a/premake5.lua +++ b/premake5.lua @@ -2,14 +2,14 @@ include("libraries") print("Using Premake version ", _PREMAKE_VERSION) workspace "Yoggie GameEngine" - configurations { "Debug", "Test", "Release" } + configurations { "Debug", "Release" } language "C++" cppdialect "C++17" architecture "x86_64" - targetdir "./%{prj.name}/build/%{cfg.buildcfg}" - objdir "./%{prj.name}/build/%{cfg.buildcfg}/intermediates/" + targetdir "%{wks.location}/libs/%{prj.name}/build/%{cfg.buildcfg}" + objdir "%{wks.location}/libs/%{prj.name}/build/%{cfg.buildcfg}/intermediates/" startproject("Editor") @@ -31,17 +31,14 @@ workspace "Yoggie GameEngine" include("./YoggieEngine") include ("./Editor") - +include ("./Tests") group("Other") - includeexternal("./SandboxApp") - includeexternal("./Runtime") - - + include("./SandboxApp") group("Libraries") - include('ImGui') - include("ImGuizmo") - include("yaml-cpp") + include('libs/ImGui') + include("libs/guizmo") + include("libs/yaml-cpp") diff --git a/yaml-cpp/premake5.lua b/yaml-cpp/premake5.lua deleted file mode 100644 index 2ebccbd..0000000 --- a/yaml-cpp/premake5.lua +++ /dev/null @@ -1,13 +0,0 @@ -project "yaml-cpp" -kind "StaticLib" - -buildmessage "Building YAML parser ..." - -includedirs{ - "../libs/yaml-cpp/include" -} - -files{ - "../libs/yaml-cpp/src/*.h", - "../libs/yaml-cpp/src/*.cpp" -} \ No newline at end of file