Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preliminary support for the universal windows platform #89

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions include/boost/test/impl/cpp_main.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
// Boost
#include <boost/cstdlib.hpp> // for exit codes
#include <boost/config.hpp> // for workarounds
#include <boost/predef.h> // for BOOST_PLAT_ macros

// STL
#include <iostream>
Expand Down Expand Up @@ -69,7 +70,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";
Expand Down Expand Up @@ -102,7 +107,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;
}
Expand Down
5 changes: 4 additions & 1 deletion include/boost/test/impl/debug.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
#include <boost/test/debug.hpp>
#include <boost/test/debug_config.hpp>

// Boost
#include <boost/predef.h>

// 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

Expand Down
7 changes: 7 additions & 0 deletions include/boost/test/utils/runtime/env/fetch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@

#include <boost/test/detail/suppress_warnings.hpp>

// Boost
#include <boost/predef.h>

// C Runtime
#include <stdlib.h>

Expand All @@ -40,10 +43,14 @@ namespace env_detail {
inline std::pair<cstring,bool>
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
Expand Down