diff --git a/libs/ardour/test/profiling/load_session.cc b/libs/ardour/test/profiling/load_session.cc new file mode 100644 index 0000000000..3c6bd9bb10 --- /dev/null +++ b/libs/ardour/test/profiling/load_session.cc @@ -0,0 +1,48 @@ +#include "test_util.h" +#include "pbd/failed_constructor.h" +#include "ardour/ardour.h" +#include "ardour/audioengine.h" +#include "ardour/session.h" +#include "midi++/manager.h" +#include +#include + +using namespace std; +using namespace ARDOUR; + +int main (int argc, char* argv[]) +{ + if (argc != 3) { + cerr << "Syntax: " << argv[0] << " \n"; + exit (EXIT_FAILURE); + } + + ARDOUR::init (false, true); + + Session* s = 0; + + try { + s = load_session (argv[1], argv[2]); + } catch (failed_constructor& e) { + cerr << "failed_constructor: " << e.what() << "\n"; + exit (EXIT_FAILURE); + } catch (AudioEngine::PortRegistrationFailure& e) { + cerr << "PortRegistrationFailure: " << e.what() << "\n"; + exit (EXIT_FAILURE); + } catch (exception& e) { + cerr << "exception: " << e.what() << "\n"; + exit (EXIT_FAILURE); + } catch (...) { + cerr << "unknown exception.\n"; + exit (EXIT_FAILURE); + } + + AudioEngine::instance()->remove_session (); + delete s; + AudioEngine::instance()->stop (true); + + MIDI::Manager::destroy (); + AudioEngine::destroy (); + + return 0; +} diff --git a/libs/ardour/wscript b/libs/ardour/wscript index f8cf9e7578..65466df09f 100644 --- a/libs/ardour/wscript +++ b/libs/ardour/wscript @@ -509,7 +509,7 @@ def build(bld): session_load_tester.source += [ 'sse_functions_64bit.s' ] # Profiling - for p in ['runpc', 'lots_of_regions']: + for p in ['runpc', 'lots_of_regions', 'load_session']: profilingobj = bld(features = 'cxx cxxprogram') profilingobj.source = ''' test/dummy_lxvst.cc