From 25ba5d089858217d688c726e67b82ef95a2df1dc Mon Sep 17 00:00:00 2001 From: Gary Oberbrunner Date: Sat, 22 Sep 2012 19:55:01 +0000 Subject: Merged pull request #38, from eyan: add target name to debug=time Fixes #2873. --- src/CHANGES.txt | 3 +++ src/engine/SCons/Script/Main.py | 2 +- test/option/debug-time.py | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 048068f..a96bc0d 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -6,6 +6,9 @@ RELEASE 2.X.X - + From eyan on Bitbucket: + - Print target name with command execution time with --debug=time + From Thomas Berg and Evgeny Podjachev: - Fix subprocess spawning on Windows. Work around a Windows bug that can crash python occasionally when using -jN. (#2449) diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py index 4607e1d..2524ab0 100644 --- a/src/engine/SCons/Script/Main.py +++ b/src/engine/SCons/Script/Main.py @@ -187,7 +187,7 @@ class BuildTask(SCons.Taskmaster.OutOfDateTask): finish_time = time.time() last_command_end = finish_time cumulative_command_time = cumulative_command_time+finish_time-start_time - sys.stdout.write("Command execution time:%s:%f seconds\n"%(str(self.node), finish_time-start_time)) + sys.stdout.write("Command execution time: %s: %f seconds\n"%(str(self.node), finish_time-start_time)) def do_failed(self, status=2): _BuildFailures.append(self.exception[1]) diff --git a/test/option/debug-time.py b/test/option/debug-time.py index e5e289b..198d71d 100644 --- a/test/option/debug-time.py +++ b/test/option/debug-time.py @@ -108,7 +108,7 @@ complete_time = time.time() - start_time expected_total_time = complete_time - overhead -pattern = r'Command execution time:(.*):(\d+\.\d+) seconds' +pattern = r'Command execution time: (.*): (\d+\.\d+) seconds' targets = [] times = [] for target,time in re.findall(pattern, test.stdout()): @@ -150,7 +150,7 @@ but the various execution times actually totalled %(added_times)s, outside of the 1%% tolerance. """ % locals()) -if not within_tolerance(total_time, expected_total_time, 0.15): +if not within_tolerance(total_time, expected_total_time, 0.20): # This tolerance check seems empirically to work fine if there's # a light load on the system, but on a heavily loaded system the # timings get screwy and it can fail frequently. Some obvious -- cgit v0.12