srcdir = '.'
blddir = 'build'
-import UnitTest
-
def init(opt):
pass
help='compile without C99 complex')
opt.add_option('--disable-jack', action='store_true', default=False,
help='compile without jack support')
- opt.add_option('--disable-alsa', action='store_true', default=False,
- help='compile without alsa support')
opt.add_option('--disable-lash', action='store_true', default=False,
help='compile without lash support')
opt.add_option('--enable-java', action='store_true', default=False,
opt.tool_options('compiler_cc')
opt.tool_options('compiler_cxx')
opt.tool_options('gnu_dirs')
- #opt.tool_options('UnitTest')
+ opt.tool_options('UnitTest')
def configure(conf):
import Options
conf.check(header_name='stdio.h')
conf.check(header_name='math.h')
conf.check(header_name='string.h')
+ conf.check(header_name='limits.h')
# optionally use complex.h
if (Options.options.disable_complex == False):
if (Options.options.disable_jack == False):
conf.check_cfg(package = 'jack', atleast_version = '0.15.0',
args = '--cflags --libs')
- if (Options.options.disable_alsa == False):
- conf.check_cfg(package = 'alsa', atleast_version = '0.0.9',
- args = '--cflags --libs')
if (Options.options.disable_lash == False):
conf.check_cfg(package = 'lash-1.0', atleast_version = '0.5.0',
args = '--cflags --libs', uselib_store = 'LASH')
bld.env['LIB_VERSION'] = LIB_VERSION
# add sub directories
- bld.add_subdirs('src ext examples cpp tests/src')
+ bld.add_subdirs('src examples interfaces/cpp')
if bld.env['SWIG']:
if bld.env['PYTHON']:
bld.add_subdirs('python/aubio python')
bld.install_files('${PREFIX}/share/sounds/aubio/',
'sounds/woodblock.aiff')
+ # build and run the unit tests
+ build_tests(bld)
+ import UnitTest
+ bld.add_post_fun(UnitTest.summary)
+
def shutdown(bld):
pass
-def check(bld):
- ut = UnitTest.unit_test()
- ut.change_to_testfile_dir = True
- ut.run()
- ut.print_results()
+# loop over all *.c filenames in tests/src to build them all
+# target name is filename.c without the .c
+def build_tests(bld):
+ for target_name in bld.path.ant_glob('tests/src/**/*.c').split():
+ this_target = bld.new_task_gen(
+ features = 'cc cprogram test',
+ source = target_name,
+ target = target_name.split('.')[0],
+ includes = 'src',
+ defines = 'AUBIO_UNSTABLE_API=1',
+ uselib_local = 'aubio')
+ # phasevoc-jack also needs jack
+ if target_name.endswith('test-phasevoc-jack.c'):
+ this_target.includes = ['src', 'examples']
+ this_target.uselib_local = ['aubio']
+ this_target.uselib = ['JACK']
+ this_target.source += ' examples/jackio.c'