diff options
author | David Robillard <d@drobilla.net> | 2010-01-07 21:27:39 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-01-07 21:27:39 +0000 |
commit | 936348fd730f2d3ebc5376b555f0cfc1e633c019 (patch) | |
tree | 007c54a11246877df07e00f11559380282826ccf /wscript | |
parent | 5e4654826a1b726a8b2fc88520975311a2553d71 (diff) | |
download | lilv-936348fd730f2d3ebc5376b555f0cfc1e633c019.tar.gz lilv-936348fd730f2d3ebc5376b555f0cfc1e633c019.tar.bz2 lilv-936348fd730f2d3ebc5376b555f0cfc1e633c019.zip |
Move unit testing and coverage framework into autowaf.
Make raul tests return 0 on success, 1 on failure.
Test coverage for Raul.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@2368 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'wscript')
-rw-r--r-- | wscript | 25 |
1 files changed, 20 insertions, 5 deletions
@@ -72,6 +72,10 @@ def configure(conf): autowaf.display_msg(conf, "Dynamic Manifest Support", str(conf.env['SLV2_DYN_MANIFEST'] == 1)) print +tests = ''' + test/slv2_test +''' + def build(bld): # C Headers bld.install_files('${INCLUDEDIR}/slv2', 'slv2/*.h') @@ -107,8 +111,8 @@ def build(bld): obj.ccflags = [ '-ldl' ] autowaf.use_lib(bld, obj, 'REDLAND LV2CORE') - # Static library (for unit test code coverage) if bld.env['BUILD_TESTS']: + # Static library (for unit test code coverage) obj = bld.new_task_gen('cc', 'staticlib') obj.source = lib_source obj.includes = ['.', './src'] @@ -117,6 +121,18 @@ def build(bld): obj.install_path = '' obj.ccflags = [ '-fprofile-arcs', '-ftest-coverage' ] + # Unit tests + for i in tests.split(): + obj = bld.new_task_gen('cc', 'program') + obj.source = i + '.c' + obj.includes = '..' + obj.uselib_local = 'libslv2_static' + obj.uselib = 'REDLAND LV2CORE' + obj.libs = 'gcov' + obj.target = i + obj.install_path = '' + obj.ccflags = [ '-fprofile-arcs', '-ftest-coverage' ] + # Utilities utils = ''' utils/lv2_inspect @@ -144,9 +160,6 @@ def build(bld): obj.target = i obj.install_path = '${BINDIR}' - # Unit tests - bld.add_subdirs('test') - # Documentation autowaf.build_dox(bld, 'SLV2', SLV2_VERSION, srcdir, blddir) bld.install_files('${HTMLDIR}', blddir + '/default/doc/html/*') @@ -158,6 +171,8 @@ def build(bld): bld.install_as( '/etc/bash_completion.d/slv2', 'utils/slv2.bash_completion') +def test(ctx): + autowaf.run_tests(APPNAME, tests.split()) + def shutdown(): autowaf.shutdown() - |