diff options
| author | Stefan Boberg <[email protected]> | 2023-04-24 15:53:30 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2023-04-24 15:53:30 +0200 |
| commit | 9ee1a686c29b7ab18207c2963497337532f441cb (patch) | |
| tree | 17d2681767e92603b7199d88235a775e5ca354ab /zencore/testing.cpp | |
| parent | added changelog comment (diff) | |
| parent | fixed dashboard file serving bug (#255) (diff) | |
| download | zen-9ee1a686c29b7ab18207c2963497337532f441cb.tar.xz zen-9ee1a686c29b7ab18207c2963497337532f441cb.zip | |
Merge branch 'main' of https://github.com/EpicGames/zen
Diffstat (limited to 'zencore/testing.cpp')
| -rw-r--r-- | zencore/testing.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/zencore/testing.cpp b/zencore/testing.cpp new file mode 100644 index 000000000..15be4b716 --- /dev/null +++ b/zencore/testing.cpp @@ -0,0 +1,52 @@ +#include "zencore/testing.h" +#include "zencore/logging.h" + +#if ZEN_WITH_TESTS + +namespace zen::testing { + +using namespace std::literals; + +struct TestRunner::Impl +{ + doctest::Context Session; +}; + +TestRunner::TestRunner() +{ + m_Impl = std::make_unique<Impl>(); +} + +TestRunner::~TestRunner() +{ +} + +int +TestRunner::ApplyCommandLine(int argc, char const* const* argv) +{ + m_Impl->Session.applyCommandLine(argc, argv); + + for (int i = 1; i < argc; ++i) + { + if (argv[i] == "--debug"sv) + { + spdlog::set_level(spdlog::level::debug); + } + } + + return 0; +} + +int +TestRunner::Run() +{ + int Rv = 0; + + m_Impl->Session.run(); + + return Rv; +} + +} // namespace zen::testing + +#endif |