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,8 +17,9 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
namespace beast
|
||||
{
|
||||
#include "../../../beast/unit_test/suite.h"
|
||||
|
||||
namespace beast {
|
||||
|
||||
SemanticVersion::SemanticVersion ()
|
||||
: majorVersion (0)
|
||||
@@ -288,13 +289,9 @@ bool SemanticVersion::chopIdentifiers (StringArray* value, bool allowLeadingZero
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class SemanticVersionTests : public UnitTest
|
||||
class SemanticVersion_test: public unit_test::suite
|
||||
{
|
||||
public:
|
||||
SemanticVersionTests () : UnitTest ("SemanticVersion", "beast")
|
||||
{
|
||||
}
|
||||
|
||||
void checkPass (String const& input, bool shouldPass = true)
|
||||
{
|
||||
SemanticVersion v;
|
||||
@@ -377,7 +374,7 @@ public:
|
||||
|
||||
void testParse ()
|
||||
{
|
||||
beginTestCase ("parse");
|
||||
testcase ("parse");
|
||||
|
||||
check ("0.0.0");
|
||||
check ("1.2.3");
|
||||
@@ -511,7 +508,7 @@ public:
|
||||
checkLess ("0.9.9", "1.0.0");
|
||||
}
|
||||
|
||||
void runTest ()
|
||||
void run ()
|
||||
{
|
||||
testParse ();
|
||||
testValues ();
|
||||
@@ -519,6 +516,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
static SemanticVersionTests semanticVersionTests;
|
||||
BEAST_DEFINE_TESTSUITE(SemanticVersion,beast_core,beast);
|
||||
|
||||
} // namespace beast
|
||||
} // beast
|
||||
|
||||
Reference in New Issue
Block a user