xenia-canary/tools/build/src/test_suite_main.cc

47 lines
1.3 KiB
C++
Raw Normal View History

/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2019 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
2016-01-01 20:46:26 +00:00
#include <cstdlib>
#include <cstring>
#include <locale>
#include <string>
#include <vector>
#include "xenia/base/cvar.h"
#include "xenia/base/main.h"
#define CATCH_CONFIG_RUNNER
#include "third_party/catch/include/catch.hpp"
namespace xe {
namespace test_suite {
int test_suite_main(const std::vector<std::string>& args) {
// Catch doesn't expose a way to pass a vector of strings, despite building a
// vector internally.
int argc = 0;
std::vector<const char*> argv;
for (const auto& arg : args) {
argv.push_back(arg.c_str());
argc++;
}
// Run Catch.
return Catch::Session().run(argc, argv.data());
}
} // namespace test_suite
} // namespace xe
#ifndef XE_TEST_SUITE_NAME
#error XE_TEST_SUITE_NAME is undefined!
#endif
DEFINE_ENTRY_POINT(XE_TEST_SUITE_NAME, xe::test_suite::test_suite_main, "");