Refines the test so that it fails at link when using a wrong std::string,

since std::string appears in the ABI of Boost.PO.
This happens with GCC's parallel or debug mode.
(admittedly, a further refinement could be to have 2 test programs,
but it's probably an overkill).
This commit is contained in:
Sylvain Pion 2009-05-05 15:25:31 +00:00
parent a83bed9d19
commit 92f2d85b65
1 changed files with 14 additions and 11 deletions

View File

@ -1,8 +1,5 @@
// Copyright (c) 2006, 2007 Utrecht University (The Netherlands), // Copyright (c) 2006, 2007, 2009 Stanford University (USA),
// ETH Zurich (Switzerland), Freie Universitaet Berlin (Germany), // INRIA Sophia-Antipolis (France). All rights reserved.
// INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
// (Germany), Max-Planck-Institute Saarbruecken (Germany), RISC Linz (Austria),
// and Tel-Aviv University (Israel). All rights reserved.
// //
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or // This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as // modify it under the terms of the GNU Lesser General Public License as
@ -18,28 +15,34 @@
// $URL$ // $URL$
// $Id$ // $Id$
// //
// // Author(s) : Daniel Russel, Sylvain Pion
// Author(s) : Daniel Russel
// Tests if BOOST_PROGRAM_OPTIONS is available. // Tests if BOOST_PROGRAM_OPTIONS is available.
#include <iostream> #include <iostream>
#include <string>
#include <boost/program_options.hpp> #include <boost/program_options.hpp>
namespace po = boost::program_options;
int main(int ac, char *av[]) int main(int ac, char *av[])
{ {
std::cout << "version=" << BOOST_VERSION/100000 << "." std::cout << "version=" << BOOST_VERSION/100000 << "."
<< ((BOOST_VERSION / 100) % 100) << "." << ((BOOST_VERSION / 100) % 100) << "."
<< BOOST_VERSION % 100 << std::endl; << BOOST_VERSION % 100 << std::endl;
boost::program_options::options_description desc("Allowed options"); std::string str;
po::options_description desc("Allowed options");
desc.add_options() desc.add_options()
("help", "produce help message") ("help", "produce help message")
("input-file,f", po::value<std::string>(&str)->default_value("blabla.txt"),
"name of file")
; ;
boost::program_options::variables_map vm; po::variables_map vm;
boost::program_options::store(boost::program_options::parse_command_line(ac, av, desc), vm); po::store(po::parse_command_line(ac, av, desc), vm);
boost::program_options::notify(vm); po::notify(vm);
if (vm.count("help")) { if (vm.count("help")) {
std::cout << "Help" << "\n"; std::cout << "Help" << "\n";