-
Notifications
You must be signed in to change notification settings - Fork 274
Expand file tree
/
Copy pathmain.cpp
More file actions
30 lines (24 loc) · 783 Bytes
/
main.cpp
File metadata and controls
30 lines (24 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <crtdbg.h>
#define CATCH_CONFIG_RUNNER
// Force reportFatal to be available on mingw-w64
#define CATCH_CONFIG_WINDOWS_SEH
#if defined(_MSC_VER)
#pragma warning(disable : 5311)
#endif
#include "catch.hpp"
#include "winrt/base.h"
using namespace winrt;
int main(int const argc, char** argv)
{
init_apartment();
std::set_terminate([] { reportFatal("Abnormal termination"); ExitProcess(1); });
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
(void)_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
(void)_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
return Catch::Session().run(argc, argv);
}
CATCH_TRANSLATE_EXCEPTION(hresult_error const& e)
{
return to_string(e.message());
}