Blame view

morfeusz/test_runner.cpp 1019 Bytes
Michał Lenart authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
 * File:   test_results_iterator.cpp
 * Author: lennyn
 *
 * Created on Jun 27, 2014, 11:44:49 AM
 */

#include <cppunit/BriefTestProgressListener.h>
#include <cppunit/CompilerOutputter.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/TestRunner.h>

#include "tests/TestCAPI.hpp"
#include "tests/TestMorfeusz.hpp"
Michał Lenart authored
17
#include "morfeusz2.h"
Michał Lenart authored
18
19

int main() {
Michał Lenart authored
20
21
22
23

    morfeusz::Morfeusz::dictionarySearchPaths.push_front(".");
    morfeusz::Morfeusz::dictionarySearchPaths.push_front("morfeusz");
Michał Lenart authored
24
25
26
27
28
29
30
31
32
33
34
35
36
37
    CPPUNIT_NS::TestRunner runner;
    CPPUNIT_NS::TestResult controller;
    CPPUNIT_NS::TestResultCollector result;
    controller.addListener(&result);

    runner.addTest(TestCAPI::suite());
    runner.addTest(TestMorfeusz::suite());

    runner.run(controller);

    CPPUNIT_NS::CompilerOutputter outputter(&result, CPPUNIT_NS::stdCOut());
    outputter.write();
    return result.wasSuccessful() ? 0 : 1;
}