AllTest.cc 719 B

1234567891011121314151617181920212223242526
  1. #include "Platform.h"
  2. #include <iostream>
  3. #include <cppunit/CompilerOutputter.h>
  4. #include <cppunit/extensions/TestFactoryRegistry.h>
  5. #include <cppunit/ui/text/TestRunner.h>
  6. int main(int argc, char* argv[]) {
  7. aria2::Platform platform;
  8. #ifdef ENABLE_NLS
  9. // Set locale to C to prevent the messages to be localized.
  10. setlocale (LC_CTYPE, "C");
  11. setlocale (LC_MESSAGES, "C");
  12. #endif // ENABLE_NLS
  13. CppUnit::Test* suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
  14. CppUnit::TextUi::TestRunner runner;
  15. runner.addTest(suite);
  16. runner.setOutputter(new CppUnit::CompilerOutputter(&runner.result(), std::cerr));
  17. // Run the tests.
  18. bool successfull = runner.run();
  19. return successfull ? 0 : 1;
  20. }