aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/unit/UnitTester.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-03-26 14:33:28 +1100
committerNeil <nyamatongwe@gmail.com>2018-03-26 14:33:28 +1100
commit32d292158ffd2dfabd6dc6d92d52d70a5f8351a1 (patch)
tree4690c7bfcc8d42c7f137c29b5f6d6d4b866d2459 /test/unit/UnitTester.cxx
parentad0ecc8a051be546866ee7c51868b6db5ff79982 (diff)
downloadscintilla-mirror-32d292158ffd2dfabd6dc6d92d52d70a5f8351a1.tar.gz
Backport: Update Catch from 1.0 build 47 to 2.0.1 and modify UnitTester.cpp to suit.
Use #define for Catch to report memory leaks after main as the previous call to _CrtDumpMemoryLeaks was too early and listed a static allocation as a leak. Backport of changeset 6653:0d68633e33ce.
Diffstat (limited to 'test/unit/UnitTester.cxx')
-rw-r--r--test/unit/UnitTester.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/unit/UnitTester.cxx b/test/unit/UnitTester.cxx
index 829a322fc..048abf24e 100644
--- a/test/unit/UnitTester.cxx
+++ b/test/unit/UnitTester.cxx
@@ -1,11 +1,16 @@
// UnitTester.cpp : Defines the entry point for the console application.
//
+// Catch uses std::uncaught_exception which is deprecated in C++17.
+// This define silences a warning from Visual C++.
+#define _SILENCE_CXX17_UNCAUGHT_EXCEPTION_DEPRECATION_WARNING
+
#include <cstdio>
#include <cstdarg>
#include "Platform.h"
+#define CATCH_CONFIG_WINDOWS_CRTDBG
#define CATCH_CONFIG_RUNNER
#include "catch.hpp"
@@ -29,10 +34,8 @@ void Platform::DebugPrintf(const char *format, ...) {
}
-int main(int argc, char* const argv[]) {
+int main(int argc, char* argv[]) {
const int result = Catch::Session().run(argc, argv);
- _CrtDumpMemoryLeaks();
-
return result;
}