|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r64346 - in sandbox/SOC/2010/process: boost/process libs/process/test libs/process/test/util
From: boris_at_[hidden]
Date: 2010-07-25 20:33:08
Author: bschaeling
Date: 2010-07-25 20:33:06 EDT (Sun, 25 Jul 2010)
New Revision: 64346
URL: http://svn.boost.org/trac/boost/changeset/64346
Log:
Patched library and test cases for Linux
Text files modified:
sandbox/SOC/2010/process/boost/process/operations.hpp | 6 ++++++
sandbox/SOC/2010/process/boost/process/stream_behavior.hpp | 16 +++++++++++-----
sandbox/SOC/2010/process/libs/process/test/Jamfile.jam | 17 +++++++----------
sandbox/SOC/2010/process/libs/process/test/child.cpp | 6 +++---
sandbox/SOC/2010/process/libs/process/test/util/boost.hpp | 6 ++++--
5 files changed, 31 insertions(+), 20 deletions(-)
Modified: sandbox/SOC/2010/process/boost/process/operations.hpp
==============================================================================
--- sandbox/SOC/2010/process/boost/process/operations.hpp (original)
+++ sandbox/SOC/2010/process/boost/process/operations.hpp 2010-07-25 20:33:06 EDT (Sun, 25 Jul 2010)
@@ -255,6 +255,12 @@
close(i);
}
+ if (chdir(ctx.work_dir.c_str()) == -1)
+ {
+ write(STDERR_FILENO, "chdir() failed\n", 15);
+ _exit(127);
+ }
+
ctx.setup();
execve(executable.c_str(), argv.second, envp.second);
Modified: sandbox/SOC/2010/process/boost/process/stream_behavior.hpp
==============================================================================
--- sandbox/SOC/2010/process/boost/process/stream_behavior.hpp (original)
+++ sandbox/SOC/2010/process/boost/process/stream_behavior.hpp 2010-07-25 20:33:06 EDT (Sun, 25 Jul 2010)
@@ -119,9 +119,13 @@
{
public:
inherit(stream_end_type child_end)
- : child_end_(child_end)
- {
-#if defined(BOOST_WINDOWS_API)
+ : child_end_(child_end)
+ {
+#if defined(BOOST_POSIX_API)
+ child_end_ = dup(child_end);
+ if (child_end_ == -1)
+ BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("dup(2) failed");
+#elif defined(BOOST_WINDOWS_API)
if (!DuplicateHandle(GetCurrentProcess(), child_end_,
GetCurrentProcess(), &child_end_, 0, TRUE, DUPLICATE_SAME_ACCESS))
BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("DuplicateHandle() failed");
@@ -170,8 +174,10 @@
child_end_ = ends[(stream == input_stream) ? 0 : 1];
parent_end_ = ends[(stream == input_stream) ? 1 : 0];
#if defined(BOOST_WINDOWS_API)
- if (!SetHandleInformation(child_end_, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT))
- BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("SetHandleInformation() failed");
+ if (!SetHandleInformation(child_end_, HANDLE_FLAG_INHERIT,
+ HANDLE_FLAG_INHERIT))
+ BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR(
+ "SetHandleInformation() failed");
#endif
}
Modified: sandbox/SOC/2010/process/libs/process/test/Jamfile.jam
==============================================================================
--- sandbox/SOC/2010/process/libs/process/test/Jamfile.jam (original)
+++ sandbox/SOC/2010/process/libs/process/test/Jamfile.jam 2010-07-25 20:33:06 EDT (Sun, 25 Jul 2010)
@@ -11,9 +11,6 @@
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
-alias butf : /boost//unit_test_framework ;
-explicit butf ;
-
alias bfs : /boost//filesystem : : : <link>shared:<source>/boost//system ;
explicit bfs ;
@@ -26,11 +23,11 @@
using testing ;
-run environment.cpp butf bfs ;
-run self.cpp butf bfs ;
+run environment.cpp bfs ;
+run self.cpp bfs ;
-run arguments.cpp butf bfs : : helpers : <dependency>helpers ;
-run child.cpp butf bfs : : helpers : <dependency>helpers ;
-run executable.cpp butf bfs : : helpers : <dependency>helpers ;
-run process.cpp butf bfs : : helpers : <dependency>helpers ;
-run status.cpp butf bfs : : helpers : <dependency>helpers ;
+run arguments.cpp bfs : : helpers : <dependency>helpers ;
+run child.cpp bfs : : helpers : <dependency>helpers ;
+run executable.cpp bfs : : helpers : <dependency>helpers ;
+run process.cpp bfs : : helpers : <dependency>helpers ;
+run status.cpp bfs : : helpers : <dependency>helpers ;
Modified: sandbox/SOC/2010/process/libs/process/test/child.cpp
==============================================================================
--- sandbox/SOC/2010/process/libs/process/test/child.cpp (original)
+++ sandbox/SOC/2010/process/libs/process/test/child.cpp 2010-07-25 20:33:06 EDT (Sun, 25 Jul 2010)
@@ -210,7 +210,7 @@
#if defined(BOOST_POSIX_API)
child_end_ = dup(stream_end);
if (child_end_ == -1)
- BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("dup() failed");
+ BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("dup(2) failed");
#elif defined(BOOST_WINDOWS_API)
if (!DuplicateHandle(GetCurrentProcess(), stream_end,
GetCurrentProcess(), &child_end_, 0, TRUE, DUPLICATE_SAME_ACCESS))
@@ -427,9 +427,9 @@
BOOST_CHECK_EQUAL(p.second, "'some-value'");
#if defined(BOOST_POSIX_API)
- context ctx2;
+ bp::context ctx2;
ctx2.environment.insert(bp::environment_t::value_type("TO_BE_SET", ""));
- std::pair<bool, std::string> p2 = get_var_value(ctx, "TO_BE_SET");
+ std::pair<bool, std::string> p2 = get_var_value(ctx2, "TO_BE_SET");
BOOST_CHECK(p2.first);
BOOST_CHECK_EQUAL(p2.second, "''");
#endif
Modified: sandbox/SOC/2010/process/libs/process/test/util/boost.hpp
==============================================================================
--- sandbox/SOC/2010/process/libs/process/test/util/boost.hpp (original)
+++ sandbox/SOC/2010/process/libs/process/test/util/boost.hpp 2010-07-25 20:33:06 EDT (Sun, 25 Jul 2010)
@@ -3,7 +3,8 @@
// ~~~~~~~~~~~~~
//
// Copyright (c) 2006, 2007 Julio M. Merino Vidal
-// Copyright (c) 2008, 2009 Boris Schaeling
+// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling
+// Copyright (c) 2009 Boris Schaeling
// Copyright (c) 2010 Felipe Tanus, Boris Schaeling
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -14,7 +15,8 @@
#define BOOST_PROCESS_TEST_UTIL_BOOST_HPP
#include <boost/process/all.hpp>
-#include <boost/test/unit_test.hpp>
+#define BOOST_TEST_IGNORE_SIGCHLD
+#include <boost/test/included/unit_test.hpp>
#include <boost/filesystem.hpp>
namespace bp = boost::process;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk