lightweight_test_report.hpp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // boost/detail/lightweight_test_reporter.hpp ----------------------------------------//
  2. // Copyright Beman Dawes 2014
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // See http://www.boost.org/LICENSE_1_0.txt
  5. //--------------------------------------------------------------------------------------//
  6. // //
  7. // Configuration reporting cpp_main() //
  8. // //
  9. // Displays configuration information, then returns test_main(argc, argv), which //
  10. // must be supplied by the user. //
  11. // //
  12. // Note: cpp_main(argc, argv) is called from a try block in main(), which is //
  13. // supplied by <boost/detail/lightweight_main.hpp> as is a catch block that reports //
  14. // std::exception what(). //
  15. // //
  16. //--------------------------------------------------------------------------------------//
  17. #include <boost/config.hpp>
  18. #include <boost/version.hpp>
  19. #include <boost/detail/lightweight_test.hpp>
  20. #include <boost/detail/lightweight_main.hpp>
  21. #include <iostream>
  22. int test_main(int argc, char* argv[]);
  23. int cpp_main(int argc, char* argv[])
  24. {
  25. std::cout << BOOST_COMPILER
  26. #ifdef __GNUC__
  27. << ", __GXX_EXPERIMENTAL_CXX0X__ "
  28. # ifdef __GXX_EXPERIMENTAL_CXX0X__
  29. "defined"
  30. # else
  31. "not defined"
  32. # endif
  33. #endif
  34. << "\n"
  35. << BOOST_STDLIB << "\n"
  36. << BOOST_PLATFORM << "\n"
  37. << "Boost version " << BOOST_VERSION / 100000 << '.'
  38. << BOOST_VERSION / 100 % 1000 << '.' << BOOST_VERSION % 100 << "\n";
  39. std::cout << "Command line: ";
  40. for (int a = 0; a < argc; ++a)
  41. {
  42. std::cout << argv[a];
  43. if (a != argc - 1)
  44. std::cout << ' ';
  45. }
  46. std::cout << std::endl;
  47. return test_main(argc, argv);
  48. }