From db0ac63215dbd749f6cf4f70ec08bda233aeaf29 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 20 Feb 2014 12:41:43 -0700 Subject: [PATCH] Playing around with Igloo unit testing. --- tests/main.cpp | 10 +++++----- tests/premake4.lua | 2 +- tests/tests/TestsVector3.h | 22 ++++++++++++++++++++++ 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/tests/main.cpp b/tests/main.cpp index a35b022..99d4181 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -1,13 +1,13 @@ -#include "math/Vector3.h" - -// Testing Headers #include +using namespace igloo; + +// Testing headers: #include "tests/TestsVector3.h" -int main() +int main( int argc, const char* argv[ ] ) { - return 0; + return TestRunner::RunAllTests( argc, const_cast< char** >( argv ) ); } \ No newline at end of file diff --git a/tests/premake4.lua b/tests/premake4.lua index 8b58ccb..91f0365 100644 --- a/tests/premake4.lua +++ b/tests/premake4.lua @@ -29,7 +29,7 @@ solution "tests" kind "ConsoleApp" language "C++" targetdir "bin" - files { "../src/**.cpp", "main.cpp" } + files { "../src/**.cpp", "main.cpp", "tests/*.h" } includedirs { "../include", diff --git a/tests/tests/TestsVector3.h b/tests/tests/TestsVector3.h index e69de29..858ab88 100644 --- a/tests/tests/TestsVector3.h +++ b/tests/tests/TestsVector3.h @@ -0,0 +1,22 @@ +#ifndef __TESTSVECTOR3_H__ +#define __TESTSVECTOR3_H__ + +# include "math/Vector3.h" + + When( vector3_scalar_multiplied ) + { + Then( it_should_multiply ) + { + value1.X = 1.f; + value1.Y = 1.f; + value1.Z = 1.f; + + value1 *= 2.f; + + Assert::That( value1, Equals( Vec3f( 2.f, 2.f, 2.f ) ) ); + } + + Vec3f value1; + }; + +#endif //__TESTSVECTOR3_H__