summaryrefslogtreecommitdiff
path: root/test/option
diff options
context:
space:
mode:
authorEdmund Yan <edmundhyan@gmail.com>2012-09-18 09:50:35 -0700
committerEdmund Yan <edmundhyan@gmail.com>2012-09-18 09:50:35 -0700
commit8573d574bc90a9683dbd872fb6856672d8d80517 (patch)
treece0fef08aa87cc6e16c388b66b8e48d6cec89248 /test/option
parentbfca4fd4b80657cc63149d9648f7309a84b4d07f (diff)
downloadscons-8573d574bc90a9683dbd872fb6856672d8d80517.tar.gz
Adding target name to output of --debug=time. Fix for Issue 2873
Diffstat (limited to 'test/option')
-rw-r--r--test/option/debug-time.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/test/option/debug-time.py b/test/option/debug-time.py
index 324dc284..e5e289b9 100644
--- a/test/option/debug-time.py
+++ b/test/option/debug-time.py
@@ -60,7 +60,7 @@ test.write('f2.in', "f2.in\n")
test.write('f3.in', "f3.in\n")
test.write('f4.in', "f4.in\n")
-
+expected_targets = ['f1.out', 'f2.out', 'f3.out', 'f4.out', 'output', '.']
# Before anything else, make sure we get valid --debug=time results
# when just running the help option.
@@ -108,8 +108,12 @@ complete_time = time.time() - start_time
expected_total_time = complete_time - overhead
-pattern = r'Command execution time: (\d+\.\d+) seconds'
-times = list(map(float, re.findall(pattern, test.stdout())))
+pattern = r'Command execution time:(.*):(\d+\.\d+) seconds'
+targets = []
+times = []
+for target,time in re.findall(pattern, test.stdout()):
+ targets.append(target)
+ times.append(float(time))
expected_command_time = 0.0
for t in times:
expected_command_time += t
@@ -125,6 +129,12 @@ command_time = get_command_time(stdout)
failures = []
warnings = []
+if targets != expected_targets:
+ failures.append("""\
+Scons reported the targets of timing information as %(targets)s,
+but the actual targets should have been %(expected_targets)s.
+""" %locals())
+
if not within_tolerance(expected_command_time, command_time, 0.01):
failures.append("""\
SCons -j1 reported a total command execution time of %(command_time)s,