File: testrunner.cpp

package info (click to toggle)
subcommander 2.0.0~b5p1-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 14,880 kB
  • ctags: 9,003
  • sloc: cpp: 63,591; sh: 3,904; xml: 1,984; makefile: 1,166; ansic: 786; ruby: 251; lisp: 24
file content (95 lines) | stat: -rw-r--r-- 2,615 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/* ====================================================================
 * Copyright (c) 2003-2009  Martin Hauner
 *                          http://subcommander.tigris.org
 *
 * Subcommander is licensed as described in the file doc/COPYING, which
 * you should have received as part of this distribution.
 * ====================================================================
 */

#include "stdafx.h"

// cppunit
#include <cppunit/TextTestRunner.h>
#include <cppunit/TestResult.h>
#include <cppunit/CompilerOutputter.h>
#ifdef _WIN32
#include "debugstream.h"
#endif // _WIN32

// sc
#include "util/apr.h"

///////////////////////////////////////////////////////////////////////////////
// tests..

#include "merge/LineTokenizerTest.h"
#include "lib/TextModelTest.h"
#include "lib/TextModelTestRemove.h"
#include "lib/TabTest.h"
#include "lib/StringUtilTest.h"
#include "svn/DiffTest.h"
#include "svn/ClientStaticTest.h"
#include "util/FileTest.h"
#include "util/CommandArgsTest.h"
#include "util/UtfTest.h"
#include "util/CompareTest.h"

///////////////////////////////////////////////////////////////////////////////
// entry point

int main(int argc, char* argv[])
{
  apr::initialize( argc, argv );
  //apr_pool_t *pool = apr::createPool();

  CppUnit::TextTestRunner runner;
#ifdef _WIN32  
  dostream ostream;
  runner.setOutputter( new CppUnit::CompilerOutputter(&runner.result(),ostream) ); 
#endif // _WIN32


  // build test suite tree
  CppUnit::TestSuite *all = new CppUnit::TestSuite( "all" );
  {
    CppUnit::TestSuite *merge = new CppUnit::TestSuite( "merge" );
    all->addTest(merge);
    {
      merge->addTest( LineTokenizerTest::suite() );
    }

    CppUnit::TestSuite *lib = new CppUnit::TestSuite( "lib" );
    all->addTest(lib);
    {
      lib->addTest( TextModelTest::suite() );
      lib->addTest( TextModelTestRemove::suite() );
      lib->addTest( TabTest::suite() );
      lib->addTest( StringUtilTest::suite() );
    }

    CppUnit::TestSuite *svn = new CppUnit::TestSuite( "svn" );
    all->addTest(svn);
    {
      svn->addTest( DiffTest::suite() );
      svn->addTest( ClientStaticTest::suite() );
    }

    CppUnit::TestSuite *util = new CppUnit::TestSuite( "util" );
    all->addTest(util);
    {
      util->addTest( CompareTest::suite() );
      util->addTest( FileTest::suite() );
      util->addTest( CommandArgsTest::suite() );
      util->addTest( UtfTest::suite() );
    }
  }

  // all->findTest( "sc" )
  runner.addTest( all/*->findTest( "ProjectSorterTest" )*/ );

  // run test...
  bool success = runner.run();

  return success ? EXIT_SUCCESS :  EXIT_FAILURE;
}