Run an individual unit test

This commit is contained in:
Vinnie Falco
2013-07-17 10:28:28 -07:00
parent 23e4bc4f9a
commit 312b7352b2
14 changed files with 9 additions and 31 deletions

View File

@@ -120,6 +120,4 @@
//#define BEAST_BIND_USES_TR1 1
//#define BEAST_BIND_USES_BOOST 1
#define BEAST_UNIT_TESTS 1
#endif

View File

@@ -224,6 +224,4 @@ public:
}
};
#if BEAST_UNIT_TESTS
static AbstractFifoTests abstractFifoTests;
#endif

View File

@@ -182,7 +182,7 @@ void UnitTests::beginNewTest (UnitTest* const test, const String& subCategory)
r->passes = 0;
r->failures = 0;
logMessage ("Test: " + r->unitTestName + "/" + subCategory + "...");
logMessage ("Test '" + r->unitTestName + "': " + subCategory);
resultsUpdated ();
}
@@ -241,8 +241,8 @@ void UnitTests::addFail (const String& failureMessage)
r->failures++;
String message ("!!! Test ");
message << (r->failures + r->passes) << " failed";
String message ("Failure, #");
message << (r->failures + r->passes);
if (failureMessage.isNotEmpty())
message << ": " << failureMessage;

View File

@@ -1106,7 +1106,5 @@ public:
}
};
#if BEAST_UNIT_TESTS
static FileTests fileTests;
#endif

View File

@@ -199,16 +199,18 @@ public:
HeapBlock <char> data;
};
void runTest ()
{
RandomAccessFile file;
beginTest ("open");
Result result = file.open (File::createTempFile ("tests"), RandomAccessFile::readWrite);
expect (result.wasOk (), "Should be ok");
}
private:
RandomAccessFile file;
};
static RandomAccessFileTests randomAccessFileTests;

View File

@@ -639,6 +639,4 @@ public:
}
};
#if BEAST_UNIT_TESTS
static JSONTests jsonTests;
#endif

View File

@@ -165,6 +165,4 @@ public:
}
};
#if BEAST_UNIT_TESTS
static RandomTests randomTests;
#endif

View File

@@ -148,6 +148,4 @@ public:
}
};
#if BEAST_UNIT_TESTS
static MemoryStreamTests memoryStreamTests;
#endif

View File

@@ -2402,6 +2402,4 @@ public:
}
};
#if BEAST_UNIT_TESTS
static StringTests stringTests;
#endif

View File

@@ -229,6 +229,4 @@ public:
}
};
#if BEAST_UNIT_TESTS
static DiffTests diffTests;
#endif

View File

@@ -82,6 +82,4 @@ public:
}
};
#if BEAST_UNIT_TESTS
static ChildProcessTests childProcessTests;
#endif

View File

@@ -350,6 +350,4 @@ public:
};
};
#if BEAST_UNIT_TESTS
static AtomicTests atomicTests;
#endif

View File

@@ -205,6 +205,4 @@ public:
}
};
#if BEAST_UNIT_TESTS
static GZIPTests gzipTests;
#endif

View File

@@ -29,7 +29,7 @@ public:
{
String s;
s << "UnsignedInteger <" << String(Bytes) << ">";
s << "Bytes=" << String(Bytes);
beginTest (s);
@@ -82,6 +82,4 @@ public:
private:
};
#if BEAST_UNIT_TESTS
static UnsignedIntegerTests unsignedIntegerTests;
#endif