1 // Copyright (c) 2006, 2007 Julio M. Merino Vidal
2 // Copyright (c) 2008 Ilya Sokolov, Boris Schaeling
3 // Copyright (c) 2009 Boris Schaeling
4 // Copyright (c) 2010 Felipe Tanus, Boris Schaeling
5 // Copyright (c) 2011, 2012 Jeff Flinn, Boris Schaeling
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
10 #define BOOST_TEST_MAIN
11 #define BOOST_TEST_IGNORE_SIGCHLD
12 #include <boost/test/included/unit_test.hpp>
13 #include <boost/process.hpp>
14 #include <boost/process/windows.hpp>
15 #include <boost/process/extend.hpp>
16 #include <boost/system/error_code.hpp>
20 namespace bp
= boost::process
;
22 BOOST_AUTO_TEST_CASE(show_window
)
24 using boost::unit_test::framework::master_test_suite
;
30 master_test_suite().argv
[1],
31 "test", "--windows-print-showwindow",
32 bp::windows::show_normal
,
40 BOOST_CHECK_EQUAL(i
, SW_SHOWNORMAL
);
44 #if ( BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6 )
46 struct set_startup_info
50 void operator()(T
&e
) const
53 BOOST_CHECK_EQUAL(e
.startup_info
.cb
, sizeof(::boost::winapi::STARTUPINFOA_
));
54 e
.set_startup_info_ex();
59 struct check_startup_info
63 void operator()(T
&e
) const
66 BOOST_CHECK(e
.creation_flags
& ::boost::winapi::EXTENDED_STARTUPINFO_PRESENT_
);
67 BOOST_CHECK_EQUAL(e
.startup_info
.cb
, sizeof(::boost::winapi::STARTUPINFOEXA_
));
72 BOOST_AUTO_TEST_CASE(startup_info_ex
)
74 using boost::unit_test::framework::master_test_suite
;
82 master_test_suite().argv
[1],
83 bp::extend::on_setup(set_startup_info
{cnt
}),
84 bp::extend::on_success(check_startup_info
{cnt
}),
89 BOOST_CHECK_EQUAL(cnt
, 2);