Apply patch from timbyr to fix building with --test.

git-svn-id: svn://localhost/ardour2/branches/3.0@10561 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2011-11-13 03:54:29 +00:00
parent 420780f5fc
commit bf8f0b2cb5
7 changed files with 23 additions and 14 deletions

View File

@ -267,6 +267,7 @@ def configure(conf):
autowaf.check_pkg(conf, 'libgnomecanvasmm-2.6',
uselib_store='GNOMECANVASMM', atleast_version='2.16')
autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.4', mandatory=False)
conf.write_config_header('gtk2ardour-config.h', remove=False)
@ -392,12 +393,12 @@ def build(bld):
if bld.is_defined('VST_SUPPORT'):
obj.source += [ 'vst_pluginui.cc' ]
obj.defines += [ 'VST_SUPPORT' ]
bld.env.append ('LINKFLAGS', '-lX11')
obj.uselib += ' X11 '
if bld.is_defined('LXVST_SUPPORT'):
obj.source += [ 'lxvst_pluginui.cc' ]
obj.defines += [ 'LXVST_SUPPORT' ]
obj.linkflags += [ '-lX11' ]
obj.uselib += ' X11 '
if bld.is_defined('PHONE_HOME'):
obj.defines += [ 'PHONE_HOME' ]

View File

@ -269,6 +269,8 @@ def configure(conf):
atleast_version='1.2.1')
autowaf.check_pkg(conf, 'libcurl', uselib_store='CURL',
atleast_version='7.0.0')
autowaf.check_pkg(conf, 'x11', uselib_store='X11',
atleast_version='1.4', mandatory=False)
# we don't try to detect this, since its part of our source tree
@ -389,7 +391,7 @@ def build(bld):
if bld.is_defined('LXVST_SUPPORT'):
obj.source += [ 'lxvst_plugin.cc', 'session_lxvst.cc', 'vstfx.cc', 'vstfxwin.cc', 'vstfxinfofile.cc' ]
obj.defines += [ 'LXVST_SUPPORT' ]
obj.uselib += ['X11']
if bld.is_defined('HAVE_COREAUDIO'):
obj.source += [ 'coreaudiosource.cc', 'caimportable.cc' ]
@ -412,7 +414,7 @@ def build(bld):
lang, 'LC_MESSAGES', 'libardour3.mo'),
mo)
if bld.is_defined('BUILD_TESTS') and bld.is_defined('HAVE_CPPUNIT'):
if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
# Unit tests
testobj = bld(features = 'cxx cxxprogram')
testobj.source = '''

View File

@ -78,7 +78,7 @@ def build(bld):
audiographer.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
if bld.is_defined('BUILD_TESTS') and bld.is_defined('HAVE_CPPUNIT'):
if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
# Unit tests
obj = bld(features = 'cxx cxxprogram')
obj.source = '''

View File

@ -40,7 +40,7 @@ SMFTest::takeFiveTest ()
if (ret > 0) { // didn't skip (meta) event
//cerr << "read smf event type " << hex << int(buf[0]) << endl;
// make ev.time absolute time in frames
ev.time() = time * frames_per_beat / (double)smf.ppqn();
ev.set_time(time * frames_per_beat / (double)smf.ppqn());
ev.set_event_type(type_map->midi_event_type(buf[0]));
seq->append(ev, next_event_id ());
}

View File

@ -26,6 +26,8 @@ def options(opt):
autowaf.set_options(opt)
opt.add_option('--test', action='store_true', default=False, dest='build_tests',
help="Build unit tests")
opt.add_option('--test-coverage', action='store_true', default=False, dest='test_coverage',
help="Use gcov to test for code coverage")
def configure(conf):
conf.load('compiler_cxx')
@ -42,6 +44,7 @@ def configure(conf):
autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
conf.env['BUILD_TESTS'] = Options.options.build_tests
conf.env['TEST_COVERAGE'] = Options.options.test_coverage
#autowaf.display_msg(conf, "Unit tests", str(conf.env['BUILD_TESTS']))
#print
@ -97,7 +100,7 @@ def build(bld):
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
obj.defines = ['PACKAGE="libevoral"' ]
if bld.is_defined('BUILD_TESTS') and bld.is_defined('HAVE_CPPUNIT'):
if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
# Static library (for unit test code coverage)
obj = bld(features = 'cxx cstlib')
obj.source = lib_source
@ -110,8 +113,10 @@ def build(bld):
obj.use = 'libsmf libpbd'
obj.vnum = EVORAL_LIB_VERSION
obj.install_path = ''
obj.cflags = [ '-fprofile-arcs', '-ftest-coverage' ]
obj.cxxflags = [ '-fprofile-arcs', '-ftest-coverage' ]
if bld.env['TEST_COVERAGE']:
obj.linkflags = '-lgcov'
obj.cflags = [ '-fprofile-arcs', '-ftest-coverage' ]
obj.cxxflags = [ '-fprofile-arcs', '-ftest-coverage' ]
obj.defines = ['PACKAGE="libevoral"' ]
# Unit tests
@ -124,12 +129,13 @@ def build(bld):
obj.includes = ['.', './src']
obj.use = 'libevoral_static'
obj.uselib = 'CPPUNIT SNDFILE'
obj.libs = 'gcov'
obj.target = 'run-tests'
obj.name = 'libevoral-tests'
obj.install_path = ''
obj.cflags = [ '-fprofile-arcs', '-ftest-coverage' ]
obj.cxxflags = [ '-fprofile-arcs', '-ftest-coverage' ]
if bld.env['TEST_COVERAGE']:
obj.linkflags = '-lgcov'
obj.cflags = [ '-fprofile-arcs', '-ftest-coverage' ]
obj.cxxflags = [ '-fprofile-arcs', '-ftest-coverage' ]
def shutdown():
autowaf.shutdown()

View File

@ -127,7 +127,7 @@ def build(bld):
if bld.env['build_target'] == 'x86_64':
obj.cxxflags += [ '-DUSE_X86_64_ASM' ]
if bld.is_defined ('BUILD_TESTS') and bld.is_defined('HAVE_CPPUNIT'):
if bld.env['BUILD_TESTS'] and bld.is_defined('HAVE_CPPUNIT'):
# Unit tests
testobj = bld(features = 'cxx cxxprogram')
testobj.source = '''

View File

@ -613,7 +613,7 @@ const char* const ardour_config_info = "\\n\\
# write_config_text('Soundtouch', conf.is_defined('HAVE_SOUNDTOUCH'))
write_config_text('Translation', opts.nls)
write_config_text('Tranzport', opts.tranzport)
write_config_text('Unit tests', conf.is_defined('BUILD_TESTS'))
write_config_text('Unit tests', conf.env['BUILD_TESTS'])
write_config_text('Universal binary', opts.universal)
write_config_text('VST support', opts.vst)
write_config_text('Wiimote support', opts.wiimote)