From 32d292158ffd2dfabd6dc6d92d52d70a5f8351a1 Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 26 Mar 2018 14:33:28 +1100 Subject: 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. --- test/unit/UnitTester.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'test/unit/UnitTester.cxx') 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 #include #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; } -- cgit v1.2.3