[prev in list] [next in list] [prev in thread] [next in thread]
List: boost-testing
Subject: Re: [Boost-testing] Useless failures reports/broken testers
From: David Deakins <ddeakins () veeco ! com>
Date: 2009-01-08 5:51:22
Message-ID: gk448r$ojv$1 () ger ! gmane ! org
[Download RAW message or body]
David Deakins wrote:
> Gennadiy Rozental wrote:
>> David Deakins <ddeakins <at> veeco.com> writes:
>>
>>> Actually, just a little bit different. It is that Windows CE does
>>> not have any concept of environment variables that are accessible
>>> from an application.
>>>
>>
>> So, I can read, but I can't update? Or I can't do both. In later case
>> I would
>> simply disable whole environment subsystem.
>>
>
> No, you can't read or update. If there is a simple way to disable the
> environment-related classes when UNDER_CE is defined, that would
> probably be the most correct.
>
I attached a patch file that I think should resolve the Boost.Test
issues on WinCE related to environment variable support. As suggested,
it goes beyond the previous patch to disable inclusion of the
'runtime/env/' header files and use of env::get when UNDER_CE is
defined. Let me know if you see any problems with these patches.
Thanks,
-Dave
["boost.test.wince.patch" (text/x-patch)]
Index: boost/test/impl/unit_test_parameters.ipp
===================================================================
--- boost/test/impl/unit_test_parameters.ipp (revision 50508)
+++ boost/test/impl/unit_test_parameters.ipp (working copy)
@@ -30,12 +30,18 @@
// Boost.Runtime.Param
#include <boost/test/utils/runtime/cla/dual_name_parameter.hpp>
#include <boost/test/utils/runtime/cla/parser.hpp>
-#include <boost/test/utils/runtime/env/variable.hpp>
namespace rt = boost::runtime;
namespace cla = rt::cla;
+
+
+#ifndef UNDER_CE
+#include <boost/test/utils/runtime/env/variable.hpp>
+
namespace env = rt::env;
+#endif
+
// Boost
#include <boost/config.hpp>
#include <boost/test/detail/suppress_warnings.hpp>
@@ -214,7 +220,9 @@
boost::optional<T> v;
+ #ifndef UNDER_CE
env::get( parameter_2_env_var[parameter_name], v );
+ #endif
return v? *v : default_value;
}
Index: boost/test/utils/runtime/config.hpp
===================================================================
--- boost/test/utils/runtime/config.hpp (revision 50508)
+++ boost/test/utils/runtime/config.hpp (working copy)
@@ -63,6 +63,7 @@
typedef std::basic_ostream<char_type> out_stream;
#endif
+#ifndef UNDER_CE
#if defined(__COMO__)
inline void
putenv_impl( cstring name, cstring value )
@@ -85,6 +86,7 @@
putenv( const_cast<char*>( fs.str().c_str() ) );
}
#endif
+#endif
#define BOOST_RT_PARAM_LITERAL( l ) l
#define BOOST_RT_PARAM_CSTRING_LITERAL( l ) cstring( l, sizeof( l ) - 1 )
@@ -103,6 +105,7 @@
typedef wrap_wstringstream format_stream;
typedef std::wostream out_stream;
+#ifndef UNDER_CE
inline void
putenv_impl( cstring name, cstring value )
{
@@ -115,6 +118,7 @@
using namespace std;
wputenv( const_cast<wchar_t*>( fs.str().c_str() ) );
}
+#endif
#define BOOST_RT_PARAM_LITERAL( l ) L ## l
#define BOOST_RT_PARAM_CSTRING_LITERAL( l ) cstring( L ## l, sizeof( L ## l \
)/sizeof(wchar_t) - 1 )
Index: boost/test/utils/runtime/file/config_file_iterator.cpp
===================================================================
--- boost/test/utils/runtime/file/config_file_iterator.cpp (revision 50508)
+++ boost/test/utils/runtime/file/config_file_iterator.cpp (working copy)
@@ -18,8 +18,11 @@
#include <boost/test/utils/runtime/file/config_file_iterator.hpp>
#include <boost/test/utils/runtime/validation.hpp>
+#ifndef UNDER_CE
#include <boost/test/utils/runtime/env/environment.hpp>
+#endif
+
// Boost
#include <boost/utility.hpp>
#include <boost/scoped_array.hpp>
@@ -352,7 +355,9 @@
if( it == m_symbols_table.end() ) {
boost::optional<cstring> macro_value; // !! variable actually may have \
different type
+ #ifndef UNDER_CE
env::get( macro_name, macro_value );
+ #endif
BOOST_RT_PARAM_VALIDATE_LOGIC( macro_value || ignore_missing || \
!m_detect_missing_macro,
BOOST_RT_PARAM_LITERAL( "Unknown macro \"" ) << macro_name << \
BOOST_RT_PARAM_LITERAL( "\"" ) );
_______________________________________________
Boost-Testing mailing list
Boost-Testing@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-testing
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic