Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: tools/testrunner/local/execution.py

Issue 1156663009: [test] Fix assert for predictable mode in test runner. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2012 the V8 project authors. All rights reserved. 1 # Copyright 2012 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 self._VerbosePrint("Closing database connection.") 248 self._VerbosePrint("Closing database connection.")
249 self._RunPerfSafe(lambda: self.perf_data_manager.close()) 249 self._RunPerfSafe(lambda: self.perf_data_manager.close())
250 if self.perf_failures: 250 if self.perf_failures:
251 # Nuke perf data in case of failures. This might not work on windows as 251 # Nuke perf data in case of failures. This might not work on windows as
252 # some files might still be open. 252 # some files might still be open.
253 print "Deleting perf test data due to db corruption." 253 print "Deleting perf test data due to db corruption."
254 shutil.rmtree(self.datapath) 254 shutil.rmtree(self.datapath)
255 if queued_exception: 255 if queued_exception:
256 raise queued_exception 256 raise queued_exception
257 257
258 # Make sure that any allocations were printed in predictable mode. 258 # Make sure that any allocations were printed in predictable mode (if we
259 assert not self.context.predictable or self.printed_allocations 259 # ran any tests).
260 assert (
261 not self.total or
262 not self.context.predictable or
263 self.printed_allocations
264 )
260 265
261 def _VerbosePrint(self, text): 266 def _VerbosePrint(self, text):
262 if self.context.verbose: 267 if self.context.verbose:
263 print text 268 print text
264 sys.stdout.flush() 269 sys.stdout.flush()
265 270
266 def GetCommand(self, test): 271 def GetCommand(self, test):
267 d8testflag = [] 272 d8testflag = []
268 shell = test.suite.shell() 273 shell = test.suite.shell()
269 if shell == "d8": 274 if shell == "d8":
270 d8testflag = ["--test"] 275 d8testflag = ["--test"]
271 if utils.IsWindows(): 276 if utils.IsWindows():
272 shell += ".exe" 277 shell += ".exe"
273 cmd = (self.context.command_prefix + 278 cmd = (self.context.command_prefix +
274 [os.path.abspath(os.path.join(self.context.shell_dir, shell))] + 279 [os.path.abspath(os.path.join(self.context.shell_dir, shell))] +
275 d8testflag + 280 d8testflag +
276 ["--random-seed=%s" % self.context.random_seed] + 281 ["--random-seed=%s" % self.context.random_seed] +
277 test.suite.GetFlagsForTestCase(test, self.context) + 282 test.suite.GetFlagsForTestCase(test, self.context) +
278 self.context.extra_flags) 283 self.context.extra_flags)
279 return cmd 284 return cmd
280 285
281 286
282 class BreakNowException(Exception): 287 class BreakNowException(Exception):
283 def __init__(self, value): 288 def __init__(self, value):
284 self.value = value 289 self.value = value
285 def __str__(self): 290 def __str__(self):
286 return repr(self.value) 291 return repr(self.value)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698