|
Packit Service |
db749c |
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
Packit Service |
db749c |
/*
|
|
Packit Service |
db749c |
* This file is part of the libcdr project.
|
|
Packit Service |
db749c |
*
|
|
Packit Service |
db749c |
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
Packit Service |
db749c |
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
Packit Service |
db749c |
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
Packit Service |
db749c |
*/
|
|
Packit Service |
db749c |
|
|
Packit Service |
db749c |
#include <iostream>
|
|
Packit Service |
db749c |
|
|
Packit Service |
db749c |
#include <cppunit/BriefTestProgressListener.h>
|
|
Packit Service |
db749c |
#include <cppunit/CompilerOutputter.h>
|
|
Packit Service |
db749c |
#include <cppunit/TestResult.h>
|
|
Packit Service |
db749c |
#include <cppunit/TestResultCollector.h>
|
|
Packit Service |
db749c |
#include <cppunit/TestRunner.h>
|
|
Packit Service |
db749c |
|
|
Packit Service |
db749c |
#include <cppunit/extensions/TestFactoryRegistry.h>
|
|
Packit Service |
db749c |
|
|
Packit Service |
db749c |
int main()
|
|
Packit Service |
db749c |
{
|
|
Packit Service |
db749c |
// Create the event manager and test controller
|
|
Packit Service |
db749c |
CPPUNIT_NS::TestResult controller;
|
|
Packit Service |
db749c |
|
|
Packit Service |
db749c |
// Add a listener that colllects test result
|
|
Packit Service |
db749c |
CPPUNIT_NS::TestResultCollector result;
|
|
Packit Service |
db749c |
controller.addListener(&result);
|
|
Packit Service |
db749c |
|
|
Packit Service |
db749c |
// Add a listener that print dots as test run.
|
|
Packit Service |
db749c |
CPPUNIT_NS::BriefTestProgressListener progress;
|
|
Packit Service |
db749c |
controller.addListener(&progress);
|
|
Packit Service |
db749c |
|
|
Packit Service |
db749c |
// Add the top suite to the test runner
|
|
Packit Service |
db749c |
CPPUNIT_NS::TestRunner runner;
|
|
Packit Service |
db749c |
runner.addTest(CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest());
|
|
Packit Service |
db749c |
runner.run(controller);
|
|
Packit Service |
db749c |
|
|
Packit Service |
db749c |
// output
|
|
Packit Service |
db749c |
CPPUNIT_NS::CompilerOutputter outputter(&result, std::cerr);
|
|
Packit Service |
db749c |
outputter.write();
|
|
Packit Service |
db749c |
|
|
Packit Service |
db749c |
// return status code
|
|
Packit Service |
db749c |
return result.wasSuccessful() ? 0 : 1;
|
|
Packit Service |
db749c |
}
|
|
Packit Service |
db749c |
|
|
Packit Service |
db749c |
/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
|