summaryrefslogtreecommitdiff
path: root/test/AllTest.cc
blob: 9fb27e0d26f0beee1952bdae846d58293e54e524 (plain)
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
#include "Platform.h"
#include <iostream>
#include <cppunit/CompilerOutputter.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/ui/text/TestRunner.h>

int main(int argc, char* argv[]) {
  aria2::Platform platform;

#ifdef ENABLE_NLS
  // Set locale to C to prevent the messages to be localized.
  setlocale (LC_CTYPE, "C");
  setlocale (LC_MESSAGES, "C");
#endif // ENABLE_NLS

  CppUnit::Test* suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
  CppUnit::TextUi::TestRunner runner;
  runner.addTest(suite);

  runner.setOutputter(new CppUnit::CompilerOutputter(&runner.result(), std::cerr));

  // Run the tests.
  bool successfull = runner.run();

  return successfull ? 0 : 1;
}