Update trunk tests: add textureRenderStates.cpp to tests_vc8.proj and tests.cbp; fix reversed logic in irrCoreEqual.cpp (the test wasn't being run); re-base the trunk tests/main.cpp on 1.5 tests/main.cpp, with the addition of those tests only available on the trunk.

Tested on Windows with MSVC 2005 and Code::Blocks, with a local trunk re-application of the terrainSceneNode.cpp change in SVN 2039 (which will get merged down separately).  I'll re-test on Linux as soon as I've committed this.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2040 dfc29bdd-3216-0410-991c-e03cc46cb475
master
Rogerborg 2009-01-05 14:53:30 +00:00
parent 41b87c400b
commit 64f9c03528
5 changed files with 78 additions and 70 deletions

View File

@ -1,4 +1,4 @@
// Copyright (C) 2008 Colin MacDonald
// Copyright (C) 2008-2009 Colin MacDonald and Christian Stehno
// No rights reserved: this software is in the public domain.
#include "testUtils.h"
@ -115,7 +115,7 @@ bool irrCoreEquals(void)
return false;
}
if(!irr::core::iszero(-2.0, -2.0))
if(!irr::core::iszero(-2.0, 2.0))
{
logTestString("irr::core::iszero(f64, f64) failed.\n");
return false;

View File

@ -1,4 +1,8 @@
// Copyright (C) 2008-2009 Colin MacDonald and Christian Stehno
// No rights reserved: this software is in the public domain.
// This is the entry point for the Irrlicht test suite.
// This is an MSVC pragma to link against the Irrlicht library.
// Other builds must link against it in the project files.
#if defined(_MSC_VER)
@ -10,22 +14,19 @@
#include <stdio.h>
#include <time.h>
#include <assert.h>
#include <vector>
/* Each test must have the same signature. Test should (but are not
* required to) live in a .cpp file of the same name. There is no
* need to #include anything since the test entry points can be
* declared as extern before calling them.
*/
#define RUN_TEST(testEntryPoint)\
extern bool testEntryPoint(void);\
logTestString("\nStarting test '" #testEntryPoint "'\n");\
if(!testEntryPoint()) \
{\
(void)printf("\n\n\n******** Test failure ********\nTest '" #testEntryPoint "' failed\n"\
"******** Test failure ********\n\nPress return to continue\n");\
(void)getc(stdin);\
fails++;\
}
// This is an MSVC pragma to link against the Irrlicht library.
// Other builds must link against it in the project files.
#if defined(_MSC_VER)
#pragma comment(lib, "Irrlicht.lib")
#endif // _MSC_VER
typedef struct _STestDefinition
{
bool(*testSignature)(void);
const char * testName;
} STestDefinition;
//! This is the main entry point for the Irrlicht test suite.
/** \return The number of test that failed, i.e. 0 is success. */
@ -41,51 +42,48 @@ int main(int argumentCount, char * arguments[])
return 9999;
}
extern bool disambiguateTextures(void);
extern bool softwareDevice(void);
extern bool exports(void);
extern bool testVector3d(void);
extern bool testVector2d(void);
extern bool planeMatrix(void);
extern bool fast_atof(void);
extern bool line2dIntersectWith(void);
extern bool drawPixel(void);
extern bool md2Animation(void);
extern bool b3dAnimation(void);
extern bool guiDisabledMenu(void);
extern bool textureRenderStates(void);
extern bool burningsVideo(void);
extern bool makeColorKeyTexture(void);
extern bool matrixOps(void);
typedef struct _STest
{
bool(*testSignature)(void);
const char * testName;
} STest;
#define TEST(x)\
{\
extern bool x(void);\
STestDefinition newTest;\
newTest.testSignature = x;\
newTest.testName = #x;\
tests.push_back(newTest);\
}
#define TEST(x) { x, #x }
std::vector<STestDefinition> tests;
static const STest tests[] =
{
TEST(disambiguateTextures), // Run this first, since it validates the WD.
TEST(exports),
TEST(testVector3d),
TEST(testVector2d),
TEST(matrixOps),
TEST(planeMatrix),
TEST(fast_atof),
TEST(line2dIntersectWith),
TEST(drawPixel),
TEST(md2Animation),
TEST(guiDisabledMenu),
TEST(softwareDevice),
TEST(b3dAnimation),
TEST(textureRenderStates),
TEST(burningsVideo),
TEST(makeColorKeyTexture)
};
static const unsigned int numberOfTests = sizeof tests / sizeof tests[0];
// Note that to interactively debug a test, you will generally want to move it
// (temporarily) to the beginning of the list, since each test runs in its own
// process.
TEST(disambiguateTextures); // Normally you should run this first, since it validates the working directory.
TEST(exports);
TEST(sceneCollisionManager);
TEST(testVector3d);
TEST(testVector2d);
TEST(planeMatrix);
TEST(fast_atof);
TEST(line2dIntersectWith);
TEST(testDimension2d);
TEST(drawPixel);
TEST(md2Animation);
TEST(guiDisabledMenu);
TEST(softwareDevice);
TEST(b3dAnimation);
TEST(textureRenderStates);
TEST(terrainSceneNode);
TEST(burningsVideo);
// Tests available on 1.6+
TEST(collisionResponseAnimator);
TEST(irrCoreEquals);
TEST(makeColorKeyTexture);
TEST(matrixOps);
TEST(sceneNodeAnimator);
TEST(vectorPositionDimension2d);
const unsigned int numberOfTests = tests.size();
unsigned int testToRun = 0;
unsigned int fails = 0;
@ -119,10 +117,22 @@ int main(int argumentCount, char * arguments[])
}
testToRun++;
if(testToRun == numberOfTests)
if(testToRun < numberOfTests)
{
logTestString("\nTests finished. %d test%s failed.\n", fails, 1 == fails ? "" : "s");
closeTestLog();
char runNextTest[256];
(void)sprintf(runNextTest, "\"%s\" %d %d", arguments[0], testToRun, fails);
fails = system(runNextTest);
}
if(1 == testToRun)
{
(void)openTestLog(false);
const int passed = numberOfTests - fails;
logTestString("\nTests finished. %d test%s of %d passed.\n",
passed, 1 == passed ? "" : "s", numberOfTests);
if(0 == fails)
{
time_t rawtime;
@ -139,13 +149,6 @@ int main(int argumentCount, char * arguments[])
}
closeTestLog();
}
else
{
closeTestLog();
char runNextTest[256];
(void)sprintf(runNextTest, "\"%s\" %d %d", arguments[0], testToRun, fails);
fails = system(runNextTest);
}
return fails;
}

View File

@ -1,2 +1,2 @@
Test suite pass at GMT Mon Jan 05 00:23:20 2009
Test suite pass at GMT Mon Jan 05 14:45:04 2009

View File

@ -60,6 +60,7 @@
<Unit filename="testUtils.cpp" />
<Unit filename="testVector2d.cpp" />
<Unit filename="testVector3d.cpp" />
<Unit filename="textureRenderStates.cpp" />
<Unit filename="vectorPositionDimension2d.cpp" />
<Extensions>
<code_completion />

View File

@ -261,6 +261,10 @@
RelativePath=".\testVector3d.cpp"
>
</File>
<File
RelativePath=".\textureRenderStates.cpp"
>
</File>
<File
RelativePath=".\vectorPositionDimension2d.cpp"
>