]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/process/test/args_handling.cpp
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
6 // Copyright (c) 2018 Oxford Nanopore Technologies
8 // Distributed under the Boost Software License, Version 1.0. (See accompanying
9 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11 #define BOOST_TEST_MAIN
12 #define BOOST_TEST_IGNORE_SIGCHLD
13 #include <boost/test/included/unit_test.hpp>
15 #include <system_error>
16 #include <boost/filesystem.hpp>
18 #include <boost/process/cmd.hpp>
19 #include <boost/process/error.hpp>
20 #include <boost/process/child.hpp>
22 namespace bp
= boost::process
;
25 BOOST_AUTO_TEST_CASE(implicit_args_fs_path
)
27 using boost::unit_test::framework::master_test_suite
;
29 boost::filesystem::path exe
= master_test_suite().argv
[1];
41 BOOST_CHECK(c
.exit_code() == 1); // should pass at least exe!
44 BOOST_AUTO_TEST_CASE(implicit_args_cmd
)
46 using boost::unit_test::framework::master_test_suite
;
50 master_test_suite().argv
[1],
58 BOOST_CHECK(c
.exit_code() == 1); // should pass at least exe!
61 BOOST_AUTO_TEST_CASE(explicit_args_fs_path
)
63 using boost::unit_test::framework::master_test_suite
;
65 boost::filesystem::path exe
= master_test_suite().argv
[1];
78 BOOST_CHECK(c
.exit_code() == 2); // exe + "hello"