Files
Xenia-Canary/src/xenia/cpu/test/xe-cpu-hir-test.cc
2015-03-24 08:25:58 -07:00

47 lines
1.4 KiB
C++

/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2014 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#define CATCH_CONFIG_RUNNER
#include "third_party/catch/single_include/catch.hpp"
#include "xenia/cpu/test/util.h"
namespace xe {
namespace cpu {
namespace test {
using xe::cpu::frontend::ppc::PPCContext;
using xe::cpu::Runtime;
int main(std::vector<std::wstring>& args) {
std::vector<std::string> narrow_args;
auto narrow_argv = new char* [args.size()];
for (size_t i = 0; i < args.size(); ++i) {
auto narrow_arg = poly::to_string(args[i]);
narrow_argv[i] = const_cast<char*>(narrow_arg.data());
narrow_args.push_back(std::move(narrow_arg));
}
int ret = Catch::Session().run(int(args.size()), narrow_argv);
if (ret) {
#if XE_LIKE_WIN32
// Visual Studio kills the console on shutdown, so prevent that.
if (poly::debugging::IsDebuggerAttached()) {
poly::debugging::Break();
}
#endif // XE_LIKE_WIN32
}
return ret;
}
} // namespace test
} // namespace cpu
} // namespace xe
DEFINE_ENTRY_POINT(L"xe-cpu-hir-test", L"?", xe::cpu::test::main);