From cb1c7b66cb147b7154110a40880ff8811ef548c3 Mon Sep 17 00:00:00 2001 From: Gustavo Jose de Sousa Date: Thu, 28 Jul 2016 14:15:18 -0300 Subject: [PATCH] waf: add post build callbacks in separate function That makes it easier see what callbacks are or not being added and the order they are executed. While at it, don't add build summary callback when in a check command. --- wscript | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/wscript b/wscript index 0167c248bc..e8e45dd3a3 100644 --- a/wscript +++ b/wscript @@ -217,10 +217,9 @@ def _build_cmd_tweaks(bld): bld.cmd = 'check' if bld.cmd == 'check': - bld.options.clear_failed_tests = True if not bld.env.HAS_GTEST: bld.fatal('check: gtest library is required') - bld.add_post_fun(ardupilotwaf.test_summary) + bld.options.clear_failed_tests = True def _build_dynamic_sources(bld): bld( @@ -307,6 +306,14 @@ def _write_version_header(tsk): bld = tsk.generator.bld return bld.write_version_header(tsk.outputs[0].abspath()) +def _build_post_funs(bld): + if bld.cmd == 'check': + bld.add_post_fun(ardupilotwaf.test_summary) + else: + bld.build_summary_post_fun() + + if bld.env.SUBMODULE_UPDATE: + bld.git_submodule_post_fun() def build(bld): config_hash = Utils.h_file(bld.bldnode.make_node('ap_config.h').abspath()) @@ -341,9 +348,7 @@ def build(bld): group='dynamic_sources', ) - bld.load('build_summary') - if bld.env.SUBMODULE_UPDATE: - bld.git_submodule_post_fun() + _build_post_funs(bld) ardupilotwaf.build_command('check', program_group_list='all',