2
0
mirror of https://github.com/boostorg/process.git synced 2026-01-21 05:02:16 +00:00

Compare commits

..

1 Commits

Author SHA1 Message Date
Klemens Morgenstern
e6ad7035e9 fixes the exit-code error on osx builds. 2024-11-08 21:14:57 +08:00
2 changed files with 9 additions and 4 deletions

View File

@@ -308,7 +308,7 @@ struct basic_process_handle_win
public:
template<BOOST_PROCESS_V2_COMPLETION_TOKEN_FOR(void(error_code, native_exit_code_type))
WaitHandler = net::default_completion_token_t<executor_type>>
auto async_wait(WaitHandler &&handler = net::default_completion_token_t<executor_type>())
auto async_wait(WaitHandler &&handler = default_completion_token_t<executor_type>())
-> decltype(net::async_compose<WaitHandler, void(error_code, native_exit_code_type)>(
async_wait_op_{handle_}, handler, handle_))
{

View File

@@ -148,12 +148,17 @@ BOOST_AUTO_TEST_CASE(async_nowait, *boost::unit_test::timeout(10))
boost::asio::io_context io_context;
bp::child c(
master_test_suite().argv[1],
"test", "--exit-code", "221",
"test", "--exit-code", "121",
ec,
bp::on_exit=[](int exit_code, std::error_code) mutable {},
io_context
);
BOOST_REQUIRE(!ec);
io_context.run_for(std::chrono::milliseconds(100));
BOOST_CHECK_EQUAL(221, c.exit_code());
while (c.running())
{
io_context.run_for(std::chrono::milliseconds(10));
io_context.restart();
}
BOOST_CHECK_EQUAL(121, c.exit_code());
}