| 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ |
| 2 | /* librevenge |
| 3 | * Version: MPL 2.0 / LGPLv2.1+ |
| 4 | * |
| 5 | * This Source Code Form is subject to the terms of the Mozilla Public |
| 6 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 7 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 8 | * |
| 9 | * Major Contributor(s): |
| 10 | * Copyright (C) 2006 Andrew Ziem |
| 11 | * |
| 12 | * For minor contributions see the git repository. |
| 13 | * |
| 14 | * Alternatively, the contents of this file may be used under the terms |
| 15 | * of the GNU Lesser General Public License Version 2.1 or later |
| 16 | * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are |
| 17 | * applicable instead of those above. |
| 18 | */ |
| 19 | |
| 20 | #include <iostream> |
| 21 | |
| 22 | #include <cppunit/TestRunner.h> |
| 23 | #include <cppunit/TestResult.h> |
| 24 | #include <cppunit/TestResultCollector.h> |
| 25 | #include <cppunit/BriefTestProgressListener.h> |
| 26 | #include <cppunit/extensions/TestFactoryRegistry.h> |
| 27 | #include <cppunit/CompilerOutputter.h> |
| 28 | |
| 29 | int main() |
| 30 | { |
| 31 | // Create the event manager and test controller |
| 32 | CPPUNIT_NS::TestResult controller; |
| 33 | |
| 34 | // Add a listener that colllects test result |
| 35 | CPPUNIT_NS::TestResultCollector result; |
| 36 | controller.addListener(&result); |
| 37 | |
| 38 | // Add a listener that print dots as test run. |
| 39 | CPPUNIT_NS::BriefTestProgressListener progress; |
| 40 | controller.addListener(&progress); |
| 41 | |
| 42 | // Add the top suite to the test runner |
| 43 | CPPUNIT_NS::TestRunner runner; |
| 44 | runner.addTest(CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest()); |
| 45 | runner.run(controller); |
| 46 | |
| 47 | // output |
| 48 | CPPUNIT_NS::CompilerOutputter outputter(&result, std::cerr); |
| 49 | outputter.write(); |
| 50 | |
| 51 | // return status code |
| 52 | return result.wasSuccessful() ? 0 : 1; |
| 53 | } |
| 54 | /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */ |