1 // Copyright (c) 2006, 2007 Julio M. Merino Vidal
\r
2 // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling
\r
3 // Copyright (c) 2009 Boris Schaeling
\r
4 // Copyright (c) 2010 Felipe Tanus, Boris Schaeling
\r
5 // Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling
\r
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
\r
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
\r
10 #define BOOST_TEST_MAIN
\r
11 #define BOOST_TEST_IGNORE_SIGCHLD
\r
12 #include <boost/test/included/unit_test.hpp>
\r
14 #include <boost/system/error_code.hpp>
\r
18 #include <boost/asio.hpp>
\r
19 #include <boost/chrono.hpp>
\r
20 #include <boost/algorithm/string/predicate.hpp>
\r
21 #include <boost/asio/steady_timer.hpp>
\r
22 #include <boost/asio/deadline_timer.hpp>
\r
24 #include <boost/process/error.hpp>
\r
25 #include <boost/process/io.hpp>
\r
26 #include <boost/process/args.hpp>
\r
27 #include <boost/process/system.hpp>
\r
28 #include <boost/process/async_pipe.hpp>
\r
29 #include <boost/process/async.hpp>
\r
30 #include <system_error>
\r
32 #include <boost/filesystem.hpp>
\r
40 namespace fs = boost::filesystem;
\r
41 namespace bp = boost::process;
\r
43 BOOST_AUTO_TEST_CASE(explicit_async_io, *boost::unit_test::timeout(2))
\r
45 using boost::unit_test::framework::master_test_suite;
\r
47 boost::asio::io_service ios;
\r
49 std::future<std::string> fut;
\r
53 master_test_suite().argv[1],
\r
54 "test", "--echo-stdout", "abc",
\r
61 BOOST_REQUIRE(fut.valid());
\r
62 BOOST_REQUIRE(boost::starts_with(fut.get(), "abc"));
\r
65 BOOST_AUTO_TEST_CASE(explicit_async_io_running, *boost::unit_test::timeout(10))
\r
67 using boost::unit_test::framework::master_test_suite;
\r
69 boost::asio::io_service ios;
\r
70 std::future<std::string> fut;
\r
76 master_test_suite().argv[1],
\r
77 "test", "--echo-stdout", "abc",
\r
88 BOOST_REQUIRE(fut.valid());
\r
89 BOOST_REQUIRE(boost::starts_with(
\r