Call PBD::init and PBD::cleanup in pbd test executable
[ardour.git] / libs / pbd / test / testrunner.cc
1 #include <cppunit/CompilerOutputter.h>
2 #include <cppunit/extensions/TestFactoryRegistry.h>
3 #include <cppunit/TestResult.h>
4 #include <cppunit/TestResultCollector.h>
5 #include <cppunit/TestRunner.h>
6 #include <cppunit/BriefTestProgressListener.h>
7 #include <glibmm/thread.h>
8 #include "scalar_properties.h"
9
10 #include "pbd/pbd.h"
11
12
13 int
14 main ()
15 {
16         if (!PBD::init ()) return 1;
17
18         ScalarPropertiesTest::make_property_quarks ();
19         
20         CppUnit::TestResult testresult;
21
22         CppUnit::TestResultCollector collectedresults;
23         testresult.addListener (&collectedresults);
24         
25         CppUnit::BriefTestProgressListener progress;
26         testresult.addListener (&progress);
27         
28         CppUnit::TestRunner testrunner;
29         testrunner.addTest (CppUnit::TestFactoryRegistry::getRegistry ().makeTest ());
30         testrunner.run (testresult);
31         
32         CppUnit::CompilerOutputter compileroutputter (&collectedresults, std::cerr);
33         compileroutputter.write ();
34
35         PBD::cleanup ();
36
37         return collectedresults.wasSuccessful () ? 0 : 1;
38
39 }