diff options
author | Sakari Bergen <sakari.bergen@beatwaves.net> | 2014-01-08 22:00:34 +0200 |
---|---|---|
committer | Sakari Bergen <sakari.bergen@beatwaves.net> | 2014-01-08 22:00:34 +0200 |
commit | f45ec9f87ba140560038fd36d31c1324e779548f (patch) | |
tree | 59417608fba6fe9987e671db73beaf397e0f7ab4 | |
parent | 3a5989919350844722129bf7fe664c8609c4c65a (diff) |
Add unit test runner (artest) and a config option to run tests after builds
-rwxr-xr-x | gtk2_ardour/artest | 25 | ||||
-rw-r--r-- | wscript | 11 |
2 files changed, 35 insertions, 1 deletions
diff --git a/gtk2_ardour/artest b/gtk2_ardour/artest new file mode 100755 index 0000000000..cd2a55cdd5 --- /dev/null +++ b/gtk2_ardour/artest @@ -0,0 +1,25 @@ +#!/bin/sh +. `dirname "$0"`/../build/gtk2_ardour/ardev_common_waf.sh + +LIBS_DIR=$TOP/build/libs + +run_tests () { + echo "" + echo "-------------------------------------------" + echo "Running tests for $1..." + echo "-------------------------------------------" + echo "" + $2 $LIBS_DIR/$1/run-tests + echo "" +} + +if [ $# -gt 0 ]; then + run_tests $1 $2 + exit +fi + +run_tests audiographer +run_tests midi++2 +run_tests evoral +run_tests pbd +run_tests ardour @@ -481,6 +481,8 @@ def options(opt): help='Raise a floating point exception if a denormal is detected') opt.add_option('--test', action='store_true', default=False, dest='build_tests', help="Build unit tests") + opt.add_option('--run-tests', action='store_true', default=False, dest='run_tests', + help="Run tests after build") opt.add_option('--single-tests', action='store_true', default=False, dest='single_tests', help="Build a single executable for each unit test") #opt.add_option('--tranzport', action='store_true', default=False, dest='tranzport', @@ -681,7 +683,8 @@ def configure(conf): conf.define('ENABLE_NLS', 1) conf.env['ENABLE_NLS'] = True if opts.build_tests: - conf.env['BUILD_TESTS'] = opts.build_tests + conf.env['BUILD_TESTS'] = True + conf.env['RUN_TESTS'] = opts.run_tests if opts.single_tests: conf.env['SINGLE_TESTS'] = opts.single_tests #if opts.tranzport: @@ -801,6 +804,9 @@ def build(bld): bld.install_files (os.path.join(bld.env['SYSCONFDIR'], 'ardour3', ), 'ardour_system.rc') + if bld.env['RUN_TESTS']: + bld.add_post_fun(test) + def i18n(bld): bld.recurse (i18n_children) @@ -815,3 +821,6 @@ def i18n_mo(bld): def tarball(bld): create_stored_revision() + +def test(bld): + subprocess.call("gtk2_ardour/artest") |