test-runner.cpp
Go to the documentation of this file.
1 // Copyright (C) 2007 Klaas Gadeyne <first dot last at gmail dot com>
2 //
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 2 of the License, or
6 // (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16 //
17 
18 /* Modified from orocos cppunit test code, also published under GPLV2
19  begin : Mon January 10 2005
20  copyright : (C) 2005 Peter Soetens
21  email : peter.soetens@mech.kuleuven.ac.be
22 */
23 
24 #include <cppunit/CompilerOutputter.h>
25 #include <cppunit/extensions/TestFactoryRegistry.h>
26 #include <cppunit/ui/text/TestRunner.h>
27 
28 
29 int main(int argc, char** argv)
30 {
31  // Get the top level suite from the registry
32  CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
33 
34  // Adds the test to the list of test to run
35  CppUnit::TextUi::TestRunner runner;
36  runner.addTest( suite );
37 
38  // Change the default outputter to a compiler error format outputter
39  runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
40  std::cerr ) );
41 
42  // Run the tests.
43  bool wasSucessful = runner.run();
44 
45  // Return error code 1 if the one of test failed.
46  return wasSucessful ? 0 : 1;
47 }
48 
int main(int argc, char **argv)
Definition: test-runner.cpp:29


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 28 2022 21:56:33