From f11d78d75e25f0dc4d70e437613062b597a127d5 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Tue, 29 Sep 2009 20:45:41 +0200 Subject: [PATCH] wscript: move test build rules from tests/src/wscript_build, use new unit test system --- tests/src/wscript_build | 14 -------------- wscript | 33 ++++++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 23 deletions(-) delete mode 100644 tests/src/wscript_build diff --git a/tests/src/wscript_build b/tests/src/wscript_build deleted file mode 100644 index 02f10894..00000000 --- a/tests/src/wscript_build +++ /dev/null @@ -1,14 +0,0 @@ -# loop over all *.c filenames in tests/src to build them all -# target name is filename.c without the .c -for target_name in bld.path.ant_glob('*.c').split(): - this_target = bld.new_task_gen( - features = 'cprogram cc', # test', - includes = '../../src', - uselib_local = 'aubio', - unit_test = 1, - source = target_name, - target = target_name.split('.')[0], - install_path = None) - if target_name == 'test-phasevoc-jack.c': - this_target.includes = '../../src ../../ext' - this_target.uselib_local = ['aubio', 'aubioext'] diff --git a/wscript b/wscript index 3e7daeaf..b3eea20a 100644 --- a/wscript +++ b/wscript @@ -12,8 +12,6 @@ LIB_VERSION = '2.1.1' srcdir = '.' blddir = 'build' -import UnitTest - def init(opt): pass @@ -35,7 +33,9 @@ def set_options(opt): opt.tool_options('compiler_cc') opt.tool_options('compiler_cxx') opt.tool_options('gnu_dirs') - #opt.tool_options('UnitTest') + # include locally patched version of UnitTest until upstream incorporates patch + # see http://code.google.com/p/waf/issues/detail?id=542 + opt.tool_options('UnitTest', tooldir='.') def configure(conf): import Options @@ -137,7 +137,7 @@ def build(bld): bld.env['LIB_VERSION'] = LIB_VERSION # add sub directories - bld.add_subdirs('src ext examples cpp tests/src') + bld.add_subdirs('src ext examples cpp') if bld.env['SWIG']: if bld.env['PYTHON']: bld.add_subdirs('python/aubio python') @@ -171,11 +171,26 @@ def build(bld): 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 = 'cprogram cc test', + source = target_name, + target = target_name.split('.')[0], + includes = 'src', + install_path = None, + uselib_local = 'aubio') + # phasevoc-jack also needs aubioext + if target_name.endswith('test-phasevoc-jack.c'): + this_target.includes = ['src', 'ext'] + this_target.uselib_local = ['aubio', 'aubioext'] -- 2.26.2