runtime-configuration_1.run-fail.cpp 802 B

1234567891011121314151617181920
  1. // Copyright (c) 2018 Raffi Enficiaud
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/test for the library home page.
  6. //[example_code
  7. #define BOOST_TEST_MODULE runtime_configuration1
  8. #include <boost/test/included/unit_test.hpp>
  9. using namespace boost::unit_test;
  10. BOOST_AUTO_TEST_CASE(test_accessing_command_line)
  11. {
  12. BOOST_TEST_REQUIRE( framework::master_test_suite().argc == 3 );
  13. BOOST_TEST( framework::master_test_suite().argv[1] == "--specific-param" );
  14. BOOST_TEST( framework::master_test_suite().argv[2] == "'additional value with quotes'" );
  15. BOOST_TEST_MESSAGE( "'argv[0]' contains " << framework::master_test_suite().argv[0] );
  16. }
  17. //]