summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorEdmund Yan <edmundhyan@gmail.com>2012-09-18 16:50:35 (GMT)
committerEdmund Yan <edmundhyan@gmail.com>2012-09-18 16:50:35 (GMT)
commitc6191773561f41cb4ac4e6149aa84603c1185ff9 (patch)
treece0fef08aa87cc6e16c388b66b8e48d6cec89248 /test
parentedbb8113bf8737e7bc77a4f23d7fd41a44dca5a6 (diff)
downloadSCons-c6191773561f41cb4ac4e6149aa84603c1185ff9.zip
SCons-c6191773561f41cb4ac4e6149aa84603c1185ff9.tar.gz
SCons-c6191773561f41cb4ac4e6149aa84603c1185ff9.tar.bz2
Adding target name to output of --debug=time. Fix for Issue 2873
Diffstat (limited to 'test')
-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 324dc28..e5e289b 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,