2 #include <glibmm/thread.h>
4 #include <cppunit/CompilerOutputter.h>
5 #include <cppunit/extensions/TestFactoryRegistry.h>
6 #include <cppunit/extensions/HelperMacros.h>
7 #include <cppunit/TestResult.h>
8 #include <cppunit/TestResultCollector.h>
9 #include <cppunit/TestRunner.h>
10 #include <cppunit/BriefTestProgressListener.h>
12 #include "pbd/debug.h"
13 #include "ardour/ardour.h"
14 #include "test_util.h"
16 static const char* localedir = LOCALEDIR;
19 main(int argc, char* argv[])
21 if (!Glib::thread_supported()) {
25 const struct option longopts[] = {
26 { "debug", 1, 0, 'D' },
29 const char *optstring = "D:";
34 c = getopt_long (argc, argv, optstring, longopts, &option_index);
45 if (PBD::parse_debug_options (optarg)) {
52 CPPUNIT_ASSERT (ARDOUR::init (false, true, localedir));
54 CPPUNIT_ASSERT (test_init ());
56 CppUnit::TestResult testresult;
58 CppUnit::TestResultCollector collectedresults;
59 testresult.addListener (&collectedresults);
61 CppUnit::BriefTestProgressListener progress;
62 testresult.addListener (&progress);
64 CppUnit::TestRunner testrunner;
65 testrunner.addTest (CppUnit::TestFactoryRegistry::getRegistry ().makeTest ());
66 testrunner.run (testresult);
68 CppUnit::CompilerOutputter compileroutputter (&collectedresults, std::cerr);
69 compileroutputter.write ();
73 return collectedresults.wasSuccessful () ? 0 : 1;