13
0

Simple arrangement to run basic load tests on a corpus

of sessions.


git-svn-id: svn://localhost/ardour2/branches/3.0@12760 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2012-06-18 18:28:40 +00:00
parent c502f0981f
commit 9d74f6ece9
4 changed files with 132 additions and 0 deletions

View File

@ -0,0 +1,48 @@
#!/bin/bash
#
# Run simple session load tester over a corpus of sessions.
#
if [ ! -f './tempo.cc' ]; then
echo "This script must be run from within the libs/ardour directory";
exit 1;
fi
cd ../..
top=`pwd`
cd build
libs='libs'
export LD_LIBRARY_PATH=$libs/audiographer:$libs/vamp-sdk:$libs/surfaces:$libs/surfaces/control_protocol:$libs/ardour:$libs/midi++2:$libs/pbd:$libs/rubberband:$libs/soundtouch:$libs/gtkmm2ext:$libs/appleutility:$libs/taglib:$libs/evoral:$libs/evoral/src/libsmf:$libs/timecode:/usr/local/lib:/usr/local/lib64:$LD_LIBRARY_PATH
export ARDOUR_CONFIG_PATH=$top:$top/gtk2_ardour:$libs/..:$libs/../gtk2_ardour
export ARDOUR_PANNER_PATH=$libs/panners/2in2out:$libs/panners/1in2out:$libs/panners/vbap
export ARDOUR_SURFACES_PATH=$libs/surfaces/osc:$libs/surfaces/generic_midi:$libs/surfaces/tranzport:$libs/surfaces/powermate:$libs/surfaces/mackie
export ARDOUR_MCP_PATH="../mcp"
export ARDOUR_DLL_PATH=$libs
export ARDOUR_DATA_PATH=$top/gtk2_ardour:$top/build/gtk2_ardour:.
f=""
if [ "$1" == "--debug" -o "$1" == "--valgrind" ]; then
f=$1
shift 1
fi
d=$1
if [ "$d" == "" ]; then
echo "Syntax: run-session-tests.sh <corpus>"
exit 1
fi
for s in `find $d -mindepth 1 -maxdepth 1 -type d`; do
n=`basename $s`
if [ "$f" == "--debug" ]; then
gdb --args ./libs/ardour/load-session $s $n
elif [ "$f" == "--valgrind" ]; then
valgrind ./libs/ardour/load-session $s $n
else
./libs/ardour/load-session $s $n
fi
done

View File

@ -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 <iostream>
#include <cstdlib>
using namespace std;
using namespace ARDOUR;
int main (int argc, char* argv[])
{
if (argc != 3) {
cerr << "Syntax: " << argv[0] << " <dir> <snapshot-name>\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;
}

View File

@ -106,6 +106,9 @@ protected:
TestReceiver test_receiver;
/** @param dir Session directory.
* @param state Session state file, without .ardour suffix.
*/
Session *
load_session (string dir, string state)
{

View File

@ -475,6 +475,39 @@ def build(bld):
elif bld.env['build_target'] == 'x86_64':
testobj.source += [ 'sse_functions_64bit.s' ]
# Tester to just load a session
session_load_tester = bld(features = 'cxx cxxprogram')
session_load_tester.source = '''
test/test_util.cc
test/load_session.cc
test/dummy_lxvst.cc
'''.split()
session_load_tester.includes = obj.includes
session_load_tester.includes.append ('test')
session_load_tester.uselib = ['CPPUNIT','SIGCPP','JACK','GLIBMM','GTHREAD',
'SAMPLERATE','XML','LRDF','COREAUDIO']
session_load_tester.use = ['libpbd','libmidipp','libardour']
session_load_tester.name = 'libardour-session-load-tester'
session_load_tester.target = 'load-session'
session_load_tester.install_path = ''
session_load_tester.defines = [
'PACKAGE="libardour3profile"',
'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
'LOCALEDIR="' + os.path.join(
os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
'VAMP_DIR="' + os.path.join(
os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"'
]
if bld.env['FPU_OPTIMIZATION']:
session_load_tester.source += [ 'sse_functions_xmm.cc' ]
if (bld.env['build_target'] == 'i386'
or bld.env['build_target'] == 'i686'):
session_load_tester.source += [ 'sse_functions.s' ]
elif bld.env['build_target'] == 'x86_64':
session_load_tester.source += [ 'sse_functions_64bit.s' ]
# Profiling
for p in ['runpc', 'lots_of_regions']:
profilingobj = bld(features = 'cxx cxxprogram')