mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-13 18:16:35 +01:00
add support for -D foobar when running tests
git-svn-id: svn://localhost/ardour2/branches/3.0@11142 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
431a30b3a9
commit
d6ff0e35d8
2 changed files with 55 additions and 20 deletions
|
|
@ -13,12 +13,12 @@ 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:$LD_LIBRARY_PATH
|
||||
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_PANNER_PATH=$libs/panners/2in2out:$libs/panners/1in2out:$libs/panners/vbap
|
||||
|
||||
if [ "$1" == "--debug" ]; then
|
||||
gdb ./libs/ardour/run-tests
|
||||
else
|
||||
./libs/ardour/run-tests
|
||||
./libs/ardour/run-tests $*
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -1,30 +1,65 @@
|
|||
#include <getopt.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>
|
||||
|
||||
#include "pbd/debug.h"
|
||||
#include "ardour/ardour.h"
|
||||
|
||||
int
|
||||
main()
|
||||
main(int argc, char* argv[])
|
||||
{
|
||||
if (!Glib::thread_supported()) {
|
||||
Glib::thread_init();
|
||||
}
|
||||
|
||||
const struct option longopts[] = {
|
||||
{ "debug", 1, 0, 'D' },
|
||||
{ 0, 0, 0, 0 }
|
||||
};
|
||||
const char *optstring = "D:";
|
||||
int option_index = 0;
|
||||
int c = 0;
|
||||
|
||||
while (1) {
|
||||
c = getopt_long (argc, argv, optstring, longopts, &option_index);
|
||||
|
||||
if (c == -1) {
|
||||
break;
|
||||
}
|
||||
|
||||
switch (c) {
|
||||
case 0:
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
if (PBD::parse_debug_options (optarg)) {
|
||||
exit (0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ARDOUR::init (false, false);
|
||||
|
||||
CppUnit::TestResult testresult;
|
||||
|
||||
CppUnit::TestResultCollector collectedresults;
|
||||
testresult.addListener (&collectedresults);
|
||||
|
||||
CppUnit::BriefTestProgressListener progress;
|
||||
testresult.addListener (&progress);
|
||||
|
||||
CppUnit::TestRunner testrunner;
|
||||
testrunner.addTest (CppUnit::TestFactoryRegistry::getRegistry ().makeTest ());
|
||||
testrunner.run (testresult);
|
||||
|
||||
CppUnit::CompilerOutputter compileroutputter (&collectedresults, std::cerr);
|
||||
compileroutputter.write ();
|
||||
|
||||
return collectedresults.wasSuccessful () ? 0 : 1;
|
||||
|
||||
CppUnit::TestResult testresult;
|
||||
|
||||
CppUnit::TestResultCollector collectedresults;
|
||||
testresult.addListener (&collectedresults);
|
||||
|
||||
CppUnit::BriefTestProgressListener progress;
|
||||
testresult.addListener (&progress);
|
||||
|
||||
CppUnit::TestRunner testrunner;
|
||||
testrunner.addTest (CppUnit::TestFactoryRegistry::getRegistry ().makeTest ());
|
||||
testrunner.run (testresult);
|
||||
|
||||
CppUnit::CompilerOutputter compileroutputter (&collectedresults, std::cerr);
|
||||
compileroutputter.write ();
|
||||
|
||||
return collectedresults.wasSuccessful () ? 0 : 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue