From fcaf168000d698d67df4fff08b6911a83f494edf Mon Sep 17 00:00:00 2001 From: Beman Date: Sun, 28 Dec 2014 09:06:33 -0500 Subject: [PATCH] Initial commit if lightweight_test_report.hpp, aimed at making it easier for users to supply sample programs in bug reports. First use will be in filesystem. --- .../boost/detail/lightweight_test_report.hpp | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 include/boost/detail/lightweight_test_report.hpp diff --git a/include/boost/detail/lightweight_test_report.hpp b/include/boost/detail/lightweight_test_report.hpp new file mode 100644 index 0000000..1511ba9 --- /dev/null +++ b/include/boost/detail/lightweight_test_report.hpp @@ -0,0 +1,56 @@ +// boost/detail/lightweight_test_reporter.hpp ----------------------------------------// + +// Copyright Beman Dawes 2014 + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +//--------------------------------------------------------------------------------------// +// // +// Configuration reporting cpp_main() // +// // +// Displays configuration information, then returns test_main(argc, argv), which // +// must be supplied by the user. // +// // +// Note: cpp_main(argc, argv) is called from a try block in main(), which is // +// supplied by as is a catch block that reports // +// std::exception what(). // +// // +//--------------------------------------------------------------------------------------// + +#include +#include +#include +#include +#include + +int test_main(int argc, char* argv[]); + +int cpp_main(int argc, char* argv[]) +{ + std::cout << BOOST_COMPILER +#ifdef __GNUC__ + << ", __GXX_EXPERIMENTAL_CXX0X__ " +# ifdef __GXX_EXPERIMENTAL_CXX0X__ + "defined" +# else + "not defined" +# endif +#endif + << "\n" + << BOOST_STDLIB << "\n" + << BOOST_PLATFORM << "\n" + << "Boost version " << BOOST_VERSION / 100000 << '.' + << BOOST_VERSION / 100 % 1000 << '.' << BOOST_VERSION % 100 << "\n"; + + std::cout << "Command line: "; + for (int a = 0; a < argc; ++a) + { + std::cout << argv[a]; + if (a != argc - 1) + std::cout << ' '; + } + std::cout << std::endl; + + return test_main(argc, argv); +} \ No newline at end of file