From a4cc0df1fc41ef67a4097f03eccee88cb1e859af Mon Sep 17 00:00:00 2001 From: Mike Cowan Date: Wed, 31 Jul 2019 11:46:00 +0100 Subject: [PATCH 1/2] Add Android implementation of writeToDebugConsole that prints to Logcat --- include/internal/catch_debug_console.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/internal/catch_debug_console.cpp b/include/internal/catch_debug_console.cpp index 5d25f651c0..617fac61d1 100644 --- a/include/internal/catch_debug_console.cpp +++ b/include/internal/catch_debug_console.cpp @@ -11,7 +11,16 @@ #include "catch_platform.h" #include "catch_windows_h_proxy.h" -#ifdef CATCH_PLATFORM_WINDOWS +#if defined(__ANDROID__) +#include + + namespace Catch { + void writeToDebugConsole( std::string const& text ) { + __android_log_print( ANDROID_LOG_DEBUG, "Catch", text.c_str() ); + } + } + +#elif CATCH_PLATFORM_WINDOWS namespace Catch { void writeToDebugConsole( std::string const& text ) { From a000e8f3d2f905e9055c4b75c55f6aa6afd7d486 Mon Sep 17 00:00:00 2001 From: Mike Cowan Date: Wed, 31 Jul 2019 17:15:15 +0100 Subject: [PATCH 2/2] Add defined() to elif CATCH_PLATFORM_WINDOWS --- include/internal/catch_debug_console.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/internal/catch_debug_console.cpp b/include/internal/catch_debug_console.cpp index 617fac61d1..26751c7e9b 100644 --- a/include/internal/catch_debug_console.cpp +++ b/include/internal/catch_debug_console.cpp @@ -20,7 +20,7 @@ } } -#elif CATCH_PLATFORM_WINDOWS +#elif defined(CATCH_PLATFORM_WINDOWS) namespace Catch { void writeToDebugConsole( std::string const& text ) {