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

Unified Diff: tools/run-tests.py

Issue 2567603002: [test] Add mksnapshot stress test suite
Patch Set: [test] Add mksnapshot stress test suite Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mksnapshot/testcfg.py ('k') | tools/testrunner/local/testsuite.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/run-tests.py
diff --git a/tools/run-tests.py b/tools/run-tests.py
index c445a6359f7fab961cbd3bb20d777dc180ccc17e..4d42416e1fc1862781b8b7b8690d744ad2586ea0 100755
--- a/tools/run-tests.py
+++ b/tools/run-tests.py
@@ -36,7 +36,6 @@ import optparse
import os
from os.path import getmtime, isdir, join
import platform
-import random
import shlex
import subprocess
import sys
@@ -75,6 +74,7 @@ TEST_MAP = {
"preparser",
"intl",
"unittests",
+ "mksnapshot",
],
# This needs to stay in sync with test/default.isolate.
"default": [
@@ -87,6 +87,7 @@ TEST_MAP = {
"preparser",
"intl",
"unittests",
+ "mksnapshot",
],
# This needs to stay in sync with test/optimize_for_size.isolate.
"optimize_for_size": [
@@ -373,13 +374,6 @@ def BuildOptions():
return result
-def RandomSeed():
- seed = 0
- while not seed:
- seed = random.SystemRandom().randint(-2147483648, 2147483647)
- return seed
-
-
def BuildbotToV8Mode(config):
"""Convert buildbot build configs to configs understood by the v8 runner.
@@ -554,7 +548,7 @@ def ProcessOptions(options):
options.j = multiprocessing.cpu_count()
if options.random_seed_stress_count <= 1 and options.random_seed == 0:
- options.random_seed = RandomSeed()
+ options.random_seed = utils.RandomSeed()
def excl(*args):
"""Returns true if zero or one of multiple arguments are true."""
@@ -619,6 +613,9 @@ def ProcessOptions(options):
TEST_MAP["default"].remove("debugger")
TEST_MAP["bot_default"].remove("debugger")
TEST_MAP["optimize_for_size"].remove("debugger")
+ if options.no_snap:
+ TEST_MAP["bot_default"].remove("mksnapshot")
+ TEST_MAP["default"].remove("mksnapshot")
return True
@@ -807,6 +804,7 @@ def Execute(arch, mode, args, options, suites):
all_tests = []
num_tests = 0
for s in suites:
+ s.Setup()
s.ReadStatusFile(variables)
s.ReadTestCases(ctx)
if len(args) > 0:
@@ -836,7 +834,7 @@ def Execute(arch, mode, args, options, suites):
if options.random_seed:
yield []
else:
- yield ["--random-seed=%d" % RandomSeed()]
+ yield ["--random-seed=%d" % utils.RandomSeed()]
s.tests = [
t.CopyAddingFlags(t.variant, flags)
for t in variant_tests
@@ -896,7 +894,12 @@ def Execute(arch, mode, args, options, suites):
else:
runner = execution.Runner(suites, progress_indicator, ctx)
- exit_code = runner.Run(options.j)
+ try:
+ exit_code = runner.Run(options.j)
+ finally:
+ for s in suites:
+ s.TearDown()
+
overall_duration = time.time() - start_time
if options.time:
« no previous file with comments | « test/mksnapshot/testcfg.py ('k') | tools/testrunner/local/testsuite.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698