13
0

Add basic test for PluginManager and LADSPA plugins

This commit is contained in:
Paul Davis 2013-07-15 12:40:06 -04:00
parent 83e05ec0ec
commit 81dbc20bac
3 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,54 @@
#include <iostream>
#include "ardour/plugin_manager.h"
#include "ardour/ladspa_search_path.h"
#include "plugins_test.h"
#include "test_common.h"
CPPUNIT_TEST_SUITE_REGISTRATION (PluginsTest);
using namespace std;
using namespace ARDOUR;
using namespace PBD;
void
print_plugin_info (PluginInfoPtr pp)
{
cout << "LADSPA Plugin, name " << pp->name
<< ", category " << pp->category
<< ", creator " << pp->creator
<< ", path " << pp->path
<< ", n_inputs " << pp->n_inputs.n_audio ()
<< ", n_outputs " << pp->n_outputs.n_audio ()
<< endl;
}
void
PluginsTest::test ()
{
PluginManager& pm = PluginManager::instance ();
pm.refresh ();
SearchPath ladspa_paths(ladspa_search_path ());
cout << "Number of Ladspa paths found: " << ladspa_paths.size () << endl;
for (vector<std::string>::iterator i = ladspa_paths.begin (); i != ladspa_paths.end(); ++i)
{
cout << "LADSPA search path includes: " << *i << endl;
}
PluginInfoList& ladspa_list = pm.ladspa_plugin_info ();
cout << "Number of Ladspa plugins found: " << ladspa_list.size () << endl;
for (PluginInfoList::iterator i = ladspa_list.begin (); i != ladspa_list.end(); ++i)
{
print_plugin_info (*i);
}
}

View File

@ -0,0 +1,12 @@
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
class PluginsTest : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE (PluginsTest);
CPPUNIT_TEST (test);
CPPUNIT_TEST_SUITE_END ();
public:
void test ();
};

View File

@ -481,6 +481,7 @@ def build(bld):
create_ardour_test_program(bld, obj.includes, 'framepos_minus_beats', 'test_framepos_minus_beats', ['test/framepos_minus_beats_test.cc'])
create_ardour_test_program(bld, obj.includes, 'playlist_equivalent_regions', 'test_playlist_equivalent_regions', ['test/playlist_equivalent_regions_test.cc'])
create_ardour_test_program(bld, obj.includes, 'playlist_layering', 'test_playlist_layering', ['test/playlist_layering_test.cc'])
create_ardour_test_program(bld, obj.includes, 'plugins_test', 'test_plugins', ['test/plugins_test.cc'])
create_ardour_test_program(bld, obj.includes, 'region_naming', 'test_region_naming', ['test/region_naming_test.cc'])
create_ardour_test_program(bld, obj.includes, 'control_surface', 'test_control_surfaces', ['test/control_surfaces_test.cc'])
create_ardour_test_program(bld, obj.includes, 'mtdm_test', 'test_mtdm', ['test/mtdm_test.cc'])
@ -498,6 +499,7 @@ def build(bld):
test/framepos_minus_beats_test.cc
test/playlist_equivalent_regions_test.cc
test/playlist_layering_test.cc
test/plugins_test.cc
test/region_naming_test.cc
test/control_surfaces_test.cc
test/mtdm_test.cc