From 0eab7358bce15c84b0010876ad3312da43aa0876 Mon Sep 17 00:00:00 2001 From: Mikael Olenfalk Date: Thu, 1 Oct 2015 16:31:55 +0200 Subject: [PATCH 1/3] universal-windows: Environment variables are not supported --- include/boost/test/impl/cpp_main.ipp | 8 ++++++++ include/boost/test/utils/runtime/env/fetch.hpp | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/include/boost/test/impl/cpp_main.ipp b/include/boost/test/impl/cpp_main.ipp index aaa5cabfc5..00a78066d9 100644 --- a/include/boost/test/impl/cpp_main.ipp +++ b/include/boost/test/impl/cpp_main.ipp @@ -69,7 +69,11 @@ prg_exec_monitor_main( int (*cpp_main)( int argc, char* argv[] ), int argc, char int result = 0; BOOST_TEST_I_TRY { +#if BOOST_PLAT_WINDOWS_RUNTIME + boost::unit_test::const_string p( "no" ); +#else boost::unit_test::const_string p( std::getenv( "BOOST_TEST_CATCH_SYSTEM_ERRORS" ) ); +#endif ::boost::execution_monitor ex_mon; ex_mon.p_catch_system_errors.value = p != "no"; @@ -102,7 +106,11 @@ prg_exec_monitor_main( int (*cpp_main)( int argc, char* argv[] ), int argc, char // like the clutter. Use an environment variable to avoid command // line argument modifications; for use in production programs // that's a no-no in some organizations. +#if !BOOST_PLAT_WINDOWS_RUNTIME ::boost::unit_test::const_string p( std::getenv( "BOOST_PRG_MON_CONFIRM" ) ); +#else + ::boost::unit_test::const_string p( "yes" ); +#endif if( p != "no" ) { std::cerr << std::flush << "no errors detected" << std::endl; } diff --git a/include/boost/test/utils/runtime/env/fetch.hpp b/include/boost/test/utils/runtime/env/fetch.hpp index 48702529b8..891a5835f1 100644 --- a/include/boost/test/utils/runtime/env/fetch.hpp +++ b/include/boost/test/utils/runtime/env/fetch.hpp @@ -40,10 +40,14 @@ namespace env_detail { inline std::pair sys_read_var( cstring var_name ) { +#if BOOST_PLAT_WINDOWS_RUNTIME + return std::make_pair( cstring(nullptr), false ); +#else using namespace std; char const* res = getenv( var_name.begin() ); return std::make_pair( cstring(res), res != NULL ); +#endif } #ifdef BOOST_MSVC From 0900dfb894a531479f531cdfe84dd5c2ee7582dd Mon Sep 17 00:00:00 2001 From: Mikael Olenfalk Date: Thu, 1 Oct 2015 16:32:25 +0200 Subject: [PATCH 2/3] universal-windows: DebugApi.h is not supported --- include/boost/test/impl/debug.ipp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/test/impl/debug.ipp b/include/boost/test/impl/debug.ipp index b59a011e5e..ef7e93b75c 100644 --- a/include/boost/test/impl/debug.ipp +++ b/include/boost/test/impl/debug.ipp @@ -24,7 +24,7 @@ #include // Implementation on Windows -#if defined(_WIN32) && !defined(UNDER_CE) && !defined(BOOST_DISABLE_WIN32) // ******* WIN32 +#if defined(_WIN32) && !defined(UNDER_CE) && !defined(BOOST_DISABLE_WIN32) && BOOST_PLAT_WINDOWS_DESKTOP // ******* WIN32 # define BOOST_WIN32_BASED_DEBUG From 062cfd9cd34418a17ae8bd6b9756ebcb092a868c Mon Sep 17 00:00:00 2001 From: Mikael Olenfalk Date: Mon, 5 Oct 2015 07:38:26 +0200 Subject: [PATCH 3/3] universal-windows: Add missing boost.predef includes --- include/boost/test/impl/cpp_main.ipp | 1 + include/boost/test/impl/debug.ipp | 3 +++ include/boost/test/utils/runtime/env/fetch.hpp | 3 +++ 3 files changed, 7 insertions(+) diff --git a/include/boost/test/impl/cpp_main.ipp b/include/boost/test/impl/cpp_main.ipp index 00a78066d9..39cccc3898 100644 --- a/include/boost/test/impl/cpp_main.ipp +++ b/include/boost/test/impl/cpp_main.ipp @@ -24,6 +24,7 @@ // Boost #include // for exit codes #include // for workarounds +#include // for BOOST_PLAT_ macros // STL #include diff --git a/include/boost/test/impl/debug.ipp b/include/boost/test/impl/debug.ipp index ef7e93b75c..42ffb17618 100644 --- a/include/boost/test/impl/debug.ipp +++ b/include/boost/test/impl/debug.ipp @@ -23,6 +23,9 @@ #include #include +// Boost +#include + // Implementation on Windows #if defined(_WIN32) && !defined(UNDER_CE) && !defined(BOOST_DISABLE_WIN32) && BOOST_PLAT_WINDOWS_DESKTOP // ******* WIN32 diff --git a/include/boost/test/utils/runtime/env/fetch.hpp b/include/boost/test/utils/runtime/env/fetch.hpp index 891a5835f1..f9363dc4ff 100644 --- a/include/boost/test/utils/runtime/env/fetch.hpp +++ b/include/boost/test/utils/runtime/env/fetch.hpp @@ -21,6 +21,9 @@ #include +// Boost +#include + // C Runtime #include