3 #include <cppunit/CompilerOutputter.h>
4 #include <cppunit/extensions/TestFactoryRegistry.h>
5 #include <cppunit/TestResult.h>
6 #include <cppunit/TestResultCollector.h>
7 #include <cppunit/TestRunner.h>
8 #include <cppunit/BriefTestProgressListener.h>
10 #include "pbd/debug.h"
11 #include "ardour/ardour.h"
14 main(int argc, char* argv[])
16 if (!Glib::thread_supported()) {
20 const struct option longopts[] = {
21 { "debug", 1, 0, 'D' },
24 const char *optstring = "D:";
29 c = getopt_long (argc, argv, optstring, longopts, &option_index);
40 if (PBD::parse_debug_options (optarg)) {
47 ARDOUR::init (false, false);
49 CppUnit::TestResult testresult;
51 CppUnit::TestResultCollector collectedresults;
52 testresult.addListener (&collectedresults);
54 CppUnit::BriefTestProgressListener progress;
55 testresult.addListener (&progress);
57 CppUnit::TestRunner testrunner;
58 testrunner.addTest (CppUnit::TestFactoryRegistry::getRegistry ().makeTest ());
59 testrunner.run (testresult);
61 CppUnit::CompilerOutputter compileroutputter (&collectedresults, std::cerr);
62 compileroutputter.write ();
64 return collectedresults.wasSuccessful () ? 0 : 1;