mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-21 02:15:07 -04:00
unit testing: catch -> doctest (faster compile, thread-safe)
This commit is contained in:
parent
fcc7ce49d9
commit
14ad2f0ba0
11 changed files with 6728 additions and 18098 deletions
|
@ -15,8 +15,8 @@
|
|||
*/
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
#define CATCH_CONFIG_RUNNER
|
||||
#include "util_catch.hpp"
|
||||
#define DOCTEST_CONFIG_IMPLEMENT
|
||||
#include "util_test_framework.hpp"
|
||||
|
||||
namespace ams {
|
||||
|
||||
|
@ -62,7 +62,13 @@ namespace ams {
|
|||
}
|
||||
|
||||
/* Run tests. */
|
||||
Catch::Session().run(os::GetHostArgc(), os::GetHostArgv());
|
||||
{
|
||||
doctest::Context ctx;
|
||||
|
||||
ctx.applyCommandLine(os::GetHostArgc(), os::GetHostArgv());
|
||||
|
||||
ctx.run();
|
||||
}
|
||||
|
||||
AMS_INFINITE_LOOP();
|
||||
|
||||
|
@ -72,7 +78,7 @@ namespace ams {
|
|||
|
||||
}
|
||||
|
||||
namespace Catch {
|
||||
namespace doctest {
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -89,14 +95,13 @@ namespace Catch {
|
|||
|
||||
}
|
||||
|
||||
std::ostream& cout() {
|
||||
std::ostream& get_cout() {
|
||||
static std::ostream ret(new OutputDebugStringStream);
|
||||
return ret;
|
||||
}
|
||||
std::ostream& clog() {
|
||||
return cout();
|
||||
}
|
||||
std::ostream& cerr() {
|
||||
return clog();
|
||||
|
||||
std::ostream& get_cerr() {
|
||||
return get_cout();
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue