test-runner.cpp
Go to the documentation of this file.
00001 // Copyright (C) 2007 Klaas Gadeyne <first dot last at gmail dot com>
00002 //
00003 // This program is free software; you can redistribute it and/or modify
00004 // it under the terms of the GNU General Public License as published by
00005 // the Free Software Foundation; either version 2 of the License, or
00006 // (at your option) any later version.
00007 //
00008 // This program is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 // GNU General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU General Public License
00014 // along with this program; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00016 //
00017 
00018 /* Modified from orocos cppunit test code, also published under GPLV2
00019     begin                : Mon January 10 2005
00020     copyright            : (C) 2005 Peter Soetens
00021     email                : peter.soetens@mech.kuleuven.ac.be
00022 */
00023 
00024 #include <cppunit/CompilerOutputter.h>
00025 #include <cppunit/extensions/TestFactoryRegistry.h>
00026 #include <cppunit/ui/text/TestRunner.h>
00027 
00028 
00029 int main(int argc, char** argv)
00030 {
00031     // Get the top level suite from the registry
00032     CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
00033 
00034     // Adds the test to the list of test to run
00035     CppUnit::TextUi::TestRunner runner;
00036     runner.addTest( suite );
00037 
00038     // Change the default outputter to a compiler error format outputter
00039     runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
00040                                                          std::cerr ) );
00041 
00042     // Run the tests.
00043     bool wasSucessful = runner.run();
00044 
00045     // Return error code 1 if the one of test failed.
00046     return wasSucessful ? 0 : 1;
00047 }
00048 


bfl
Author(s): Klaas Gadeyne, Wim Meeussen, Tinne Delaet and many others. See web page for a full contributor list. ROS package maintained by Wim Meeussen.
autogenerated on Mon Feb 11 2019 03:45:12