forked from boostorg/beast
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:
1 parent
0bb6171a85
commit
f63cf33118
114 files changed
+3259
-4312
No files matched your search
@@ -17,54 +17,4 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#if BEAST_INCLUDE_BEASTCONFIG
|
||||
#include "../../BeastConfig.h"
|
||||
#endif
|
||||
|
||||
#include "../../modules/beast_core/beast_core.h"
|
||||
|
||||
#include "basic_abstract_ostream.h"
|
||||
|
||||
namespace beast {
|
||||
|
||||
class streams_Tests : public UnitTest
|
||||
{
|
||||
public:
|
||||
class test_stream : public basic_abstract_ostream <char>
|
||||
{
|
||||
public:
|
||||
explicit test_stream (UnitTest& test)
|
||||
: m_test (test)
|
||||
{
|
||||
}
|
||||
|
||||
void write (string_type const& s) override
|
||||
{
|
||||
m_test.logMessage (s);
|
||||
}
|
||||
|
||||
test_stream& operator= (test_stream const&) = delete;
|
||||
|
||||
private:
|
||||
UnitTest& m_test;
|
||||
};
|
||||
|
||||
void runTest()
|
||||
{
|
||||
beginTestCase ("stream");
|
||||
|
||||
test_stream ts (*this);
|
||||
|
||||
ts << "Hello";
|
||||
|
||||
pass();
|
||||
}
|
||||
|
||||
streams_Tests() : UnitTest ("streams", "beast")
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
static streams_Tests streams_tests;
|
||||
|
||||
}
|
||||
#include "tests/basic_abstract_ostream.test.cpp"
|
||||
Reference in new issue
Block a user