mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
New unit_test framework:
* Header-only! * No external dependencies or other beast modules * Compilation options allow for: - Stand-alone application to run a single test suite - Stand-alone application to run a set of test suites - Global suite of tests inline with the host application - Disable test suite generation completely * Existing tests reworked to use the new classes
This commit is contained in:
@@ -17,6 +17,9 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include "../Debug.h"
|
||||
#include "../../unit_test/suite.h"
|
||||
|
||||
namespace beast {
|
||||
|
||||
namespace Debug {
|
||||
@@ -299,7 +302,7 @@ String commandLineToString (const String& commandLine)
|
||||
|
||||
// A simple unit test to determine the diagnostic settings in a build.
|
||||
//
|
||||
class DebugTests : public UnitTest
|
||||
class Debug_test : public unit_test::suite
|
||||
{
|
||||
public:
|
||||
static int envDebug ()
|
||||
@@ -329,25 +332,34 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
void runTest ()
|
||||
void run ()
|
||||
{
|
||||
beginTestCase ("diagnostics");
|
||||
log <<
|
||||
"operatingSystemName = '" <<
|
||||
SystemStats::getOperatingSystemName () << "'";
|
||||
|
||||
log <<
|
||||
"_DEBUG = " <<
|
||||
String::fromNumber (envDebug ());
|
||||
|
||||
log <<
|
||||
"BEAST_DEBUG = " <<
|
||||
String::fromNumber (beastDebug ());
|
||||
|
||||
log <<
|
||||
"BEAST_FORCE_DEBUG = " <<
|
||||
String::fromNumber (beastForceDebug ());
|
||||
|
||||
log <<
|
||||
"sizeof(std::size_t) = " <<
|
||||
String::fromNumber (sizeof(std::size_t));
|
||||
|
||||
logMessage ("operatingSystemName = '" + SystemStats::getOperatingSystemName () + "'");
|
||||
logMessage ("_DEBUG = " + String::fromNumber (envDebug ()));
|
||||
logMessage ("BEAST_DEBUG = " + String::fromNumber (beastDebug ()));
|
||||
logMessage ("BEAST_FORCE_DEBUG = " + String::fromNumber (beastForceDebug ()));
|
||||
logMessage ("sizeof(std::size_t) = " + String::fromNumber (sizeof(std::size_t)));
|
||||
bassertfalse;
|
||||
|
||||
fail ();
|
||||
}
|
||||
|
||||
DebugTests () : UnitTest ("Debug", "beast", runManual)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
static DebugTests debugTests;
|
||||
BEAST_DEFINE_TESTSUITE_MANUAL(Debug,utility,beast);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user