| 1 | /*
 | 
|---|
| 2 |  *    vmg - a versatile multigrid solver
 | 
|---|
| 3 |  *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
 | 
|---|
| 4 |  *
 | 
|---|
| 5 |  *  vmg is free software: you can redistribute it and/or modify
 | 
|---|
| 6 |  *  it under the terms of the GNU General Public License as published by
 | 
|---|
| 7 |  *  the Free Software Foundation, either version 3 of the License, or
 | 
|---|
| 8 |  *  (at your option) any later version.
 | 
|---|
| 9 |  *
 | 
|---|
| 10 |  *  vmg is distributed in the hope that it will be useful,
 | 
|---|
| 11 |  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
|---|
| 12 |  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
|---|
| 13 |  *  GNU General Public License for more details.
 | 
|---|
| 14 |  *
 | 
|---|
| 15 |  *  You should have received a copy of the GNU General Public License
 | 
|---|
| 16 |  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
|---|
| 17 |  */
 | 
|---|
| 18 | 
 | 
|---|
| 19 | #ifdef HAVE_CONFIG_H
 | 
|---|
| 20 | #include <libvmg_config.h>
 | 
|---|
| 21 | #endif
 | 
|---|
| 22 | 
 | 
|---|
| 23 | #ifdef HAVE_MPI
 | 
|---|
| 24 | #include <mpi.h>
 | 
|---|
| 25 | #endif
 | 
|---|
| 26 | 
 | 
|---|
| 27 | #ifndef BOOST_TEST_NO_MAIN
 | 
|---|
| 28 | #define BOOST_TEST_NO_MAIN
 | 
|---|
| 29 | #endif
 | 
|---|
| 30 | 
 | 
|---|
| 31 | #ifdef HAVE_BOOST_TEST_UNIT_TEST_HPP
 | 
|---|
| 32 | #define BOOST_TEST_DYN_LINK
 | 
|---|
| 33 | #include <boost/test/unit_test.hpp>
 | 
|---|
| 34 | #else
 | 
|---|
| 35 | #include <boost/test/included/unit_test.hpp>
 | 
|---|
| 36 | #endif
 | 
|---|
| 37 | 
 | 
|---|
| 38 | #include <boost/test/framework.hpp>
 | 
|---|
| 39 | #include <boost/test/detail/unit_test_parameters.hpp>
 | 
|---|
| 40 | #include <boost/test/impl/unit_test_main.ipp>
 | 
|---|
| 41 | 
 | 
|---|
| 42 | #ifdef BOOST_TEST_ALTERNATIVE_INIT_API
 | 
|---|
| 43 | bool init_unit_test()
 | 
|---|
| 44 | #else
 | 
|---|
| 45 | ::boost::unit_test::test_suite* init_unit_test_suite(int argc, char* argv[])
 | 
|---|
| 46 | #endif
 | 
|---|
| 47 | {
 | 
|---|
| 48 |   boost::unit_test::framework::master_test_suite().p_name.value = "VMG Test Suite";
 | 
|---|
| 49 | #ifdef BOOST_TEST_ALTERNATIVE_INIT_API
 | 
|---|
| 50 |   return true;
 | 
|---|
| 51 | #else
 | 
|---|
| 52 |   return NULL;
 | 
|---|
| 53 | #endif
 | 
|---|
| 54 | }
 | 
|---|
| 55 | 
 | 
|---|
| 56 | int BOOST_TEST_CALL_DECL
 | 
|---|
| 57 | main(int argc, char* argv[])
 | 
|---|
| 58 | {
 | 
|---|
| 59 | #ifdef HAVE_MPI
 | 
|---|
| 60 |   MPI_Init(&argc, &argv);
 | 
|---|
| 61 | #endif
 | 
|---|
| 62 | 
 | 
|---|
| 63 |   // prototype for user's unit test init function
 | 
|---|
| 64 | #ifdef BOOST_TEST_ALTERNATIVE_INIT_API
 | 
|---|
| 65 |   boost::unit_test::init_unit_test_func init_func = &init_unit_test;
 | 
|---|
| 66 | #else
 | 
|---|
| 67 |   boost::unit_test::init_unit_test_func init_func = &init_unit_test_suite;
 | 
|---|
| 68 | #endif
 | 
|---|
| 69 | 
 | 
|---|
| 70 |   int rval = ::boost::unit_test::unit_test_main(init_func, argc, argv);
 | 
|---|
| 71 | 
 | 
|---|
| 72 | #ifdef HAVE_MPI
 | 
|---|
| 73 |   MPI_Finalize();
 | 
|---|
| 74 | #endif
 | 
|---|
| 75 | 
 | 
|---|
| 76 |   return rval;
 | 
|---|
| 77 | }
 | 
|---|