Flush 'Build for ...' messages before each build
authorTrevor Bramwell <tbramwell@linuxfoundation.org>
Thu, 15 Sep 2016 19:55:59 +0000 (12:55 -0700)
committerDave Thaler <dthaler@microsoft.com>
Fri, 16 Sep 2016 01:02:54 +0000 (01:02 +0000)
During a run of 'auto_build.py', stdout buffering get taken over by the
subprocess module, causing print statements in 'auto_build.py' to not
output until the very end of a build. Calling 'sys.stdout.flush()'
causes stdout to be output before the next call to 'subprocess'.

Change-Id: Ibb193b5d30458a3d9be20d418ee22cac302ee819
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11823
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
auto_build.py

index 49056c2..7ef2c28 100644 (file)
@@ -36,6 +36,7 @@ def call_scons(build_options, extra_option_str):
     cmd_line += " " + str(extra_option_str)
 
     print ("Running : " + cmd_line)
+    sys.stdout.flush()
     exit_code = subprocess.Popen([cmd_line], shell=True).wait()
     if exit_code != 0:
         exit(exit_code)