mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 11:46:25 +01:00
* introduced CppUnit into libs/Evoral
git-svn-id: svn://localhost/ardour2/branches/3.0@4494 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
cb745dbb9b
commit
43fdd21557
2 changed files with 50 additions and 4 deletions
|
|
@ -1,6 +1,16 @@
|
||||||
#include <evoral/Sequence.hpp>
|
#include <evoral/Sequence.hpp>
|
||||||
#include <evoral/TypeMap.hpp>
|
#include <evoral/TypeMap.hpp>
|
||||||
|
|
||||||
|
#include <cppunit/TestFixture.h>
|
||||||
|
#include <cppunit/extensions/HelperMacros.h>
|
||||||
|
|
||||||
|
#include <cppunit/CompilerOutputter.h>
|
||||||
|
#include <cppunit/extensions/TestFactoryRegistry.h>
|
||||||
|
#include <cppunit/TestResult.h>
|
||||||
|
#include <cppunit/TestResultCollector.h>
|
||||||
|
#include <cppunit/TestRunner.h>
|
||||||
|
#include <cppunit/BriefTestProgressListener.h>
|
||||||
|
|
||||||
using namespace Evoral;
|
using namespace Evoral;
|
||||||
|
|
||||||
class DummyTypeMap : public TypeMap {
|
class DummyTypeMap : public TypeMap {
|
||||||
|
|
@ -28,13 +38,47 @@ public:
|
||||||
boost::shared_ptr<Control> control_factory(const Parameter& param) {return boost::shared_ptr<Control>();}
|
boost::shared_ptr<Control> control_factory(const Parameter& param) {return boost::shared_ptr<Control>();}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class SequenceTest : public CPPUNIT_NS::TestFixture
|
||||||
|
{
|
||||||
|
CPPUNIT_TEST_SUITE (SequenceTest);
|
||||||
|
CPPUNIT_TEST (createTest);
|
||||||
|
CPPUNIT_TEST_SUITE_END ();
|
||||||
|
|
||||||
|
public:
|
||||||
|
void setUp (void) {
|
||||||
|
Glib::thread_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
void tearDown (void);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void createTest (void) {
|
||||||
|
DummyTypeMap type_map;
|
||||||
|
MySequence<double> s(type_map, 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
Glib::thread_init();
|
|
||||||
DummyTypeMap type_map;
|
|
||||||
|
|
||||||
MySequence<double> s(type_map, 100);
|
CPPUNIT_NS::TestResult testresult;
|
||||||
return 0;
|
|
||||||
|
CPPUNIT_NS::TestResultCollector collectedresults;
|
||||||
|
testresult.addListener (&collectedresults);
|
||||||
|
|
||||||
|
CPPUNIT_NS::BriefTestProgressListener progress;
|
||||||
|
testresult.addListener (&progress);
|
||||||
|
|
||||||
|
CPPUNIT_NS::TestRunner testrunner;
|
||||||
|
testrunner.addTest (CPPUNIT_NS::TestFactoryRegistry::getRegistry ().makeTest ());
|
||||||
|
testrunner.run (testresult);
|
||||||
|
|
||||||
|
CPPUNIT_NS::CompilerOutputter compileroutputter (&collectedresults, std::cerr);
|
||||||
|
compileroutputter.write ();
|
||||||
|
|
||||||
|
return collectedresults.wasSuccessful () ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ def configure(conf):
|
||||||
autowaf.check_tool(conf, 'compiler_cxx')
|
autowaf.check_tool(conf, 'compiler_cxx')
|
||||||
autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0', mandatory=True)
|
autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0', mandatory=True)
|
||||||
autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD', atleast_version='2.14.0', mandatory=True)
|
autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD', atleast_version='2.14.0', mandatory=True)
|
||||||
|
autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=True)
|
||||||
|
|
||||||
def build(bld):
|
def build(bld):
|
||||||
# Headers
|
# Headers
|
||||||
|
|
@ -64,6 +65,7 @@ def build(bld):
|
||||||
obj.source = 'test/sequence.cpp'
|
obj.source = 'test/sequence.cpp'
|
||||||
obj.includes = ['.', './src']
|
obj.includes = ['.', './src']
|
||||||
obj.uselib_local = 'libevoral'
|
obj.uselib_local = 'libevoral'
|
||||||
|
obj.uselib = 'CPPUNIT'
|
||||||
obj.target = 'sequence'
|
obj.target = 'sequence'
|
||||||
obj.install_path = ''
|
obj.install_path = ''
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue