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

Side by Side Diff: tools/run-tests.py

Issue 524373002: Add mapping of test groups to test driver. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review Created 6 years, 3 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 | Annotate | Revision Log
« 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2012 the V8 project authors. All rights reserved. 3 # Copyright 2012 the V8 project authors. All rights reserved.
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 10 matching lines...) Expand all
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 29
30 30
31 from collections import OrderedDict
31 import itertools 32 import itertools
32 import multiprocessing 33 import multiprocessing
33 import optparse 34 import optparse
34 import os 35 import os
35 from os.path import join 36 from os.path import join
36 import platform 37 import platform
37 import random 38 import random
38 import shlex 39 import shlex
39 import subprocess 40 import subprocess
40 import sys 41 import sys
41 import time 42 import time
42 43
43 from testrunner.local import execution 44 from testrunner.local import execution
44 from testrunner.local import progress 45 from testrunner.local import progress
45 from testrunner.local import testsuite 46 from testrunner.local import testsuite
46 from testrunner.local import utils 47 from testrunner.local import utils
47 from testrunner.local import verbose 48 from testrunner.local import verbose
48 from testrunner.network import network_execution 49 from testrunner.network import network_execution
49 from testrunner.objects import context 50 from testrunner.objects import context
50 51
51 52
52 ARCH_GUESS = utils.DefaultArch() 53 ARCH_GUESS = utils.DefaultArch()
53 DEFAULT_TESTS = ["mjsunit", "fuzz-natives", "base-unittests", 54 DEFAULT_TESTS = ["mjsunit", "fuzz-natives", "base-unittests",
54 "cctest", "compiler-unittests", "heap-unittests", 55 "cctest", "compiler-unittests", "heap-unittests",
55 "libplatform-unittests", "runtime-unittests", 56 "libplatform-unittests", "runtime-unittests",
56 "message", "preparser"] 57 "message", "preparser"]
58
59 # Map of test name synonyms to lists of test suites. Should be ordered by
60 # expected runtimes (suites with slow test cases first). These groups are
61 # invoked in seperate steps on the bots.
62 TEST_MAP = {
63 "default": [
64 "mjsunit",
65 "fuzz-natives",
66 "cctest",
67 "message",
68 "preparser",
69 ],
70 "optimize_for_size": [
71 "mjsunit",
72 "cctest",
73 "webkit",
74 ],
75 "unittests": [
76 "compiler-unittests",
77 "heap-unittests",
78 "base-unittests",
79 "libplatform-unittests",
80 ],
81 }
82
57 TIMEOUT_DEFAULT = 60 83 TIMEOUT_DEFAULT = 60
58 TIMEOUT_SCALEFACTOR = {"debug" : 4, 84 TIMEOUT_SCALEFACTOR = {"debug" : 4,
59 "release" : 1 } 85 "release" : 1 }
60 86
61 # Use this to run several variants of the tests. 87 # Use this to run several variants of the tests.
62 VARIANT_FLAGS = { 88 VARIANT_FLAGS = {
63 "default": [], 89 "default": [],
64 "stress": ["--stress-opt", "--always-opt"], 90 "stress": ["--stress-opt", "--always-opt"],
65 "turbofan": ["--turbo-filter=*", "--always-opt"], 91 "turbofan": ["--turbo-filter=*", "--always-opt"],
66 "nocrankshaft": ["--nocrankshaft"]} 92 "nocrankshaft": ["--nocrankshaft"]}
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 398
373 exit_code = 0 399 exit_code = 0
374 workspace = os.path.abspath(join(os.path.dirname(sys.argv[0]), "..")) 400 workspace = os.path.abspath(join(os.path.dirname(sys.argv[0]), ".."))
375 if not options.no_presubmit: 401 if not options.no_presubmit:
376 print ">>> running presubmit tests" 402 print ">>> running presubmit tests"
377 exit_code = subprocess.call( 403 exit_code = subprocess.call(
378 [sys.executable, join(workspace, "tools", "presubmit.py")]) 404 [sys.executable, join(workspace, "tools", "presubmit.py")])
379 405
380 suite_paths = utils.GetSuitePaths(join(workspace, "test")) 406 suite_paths = utils.GetSuitePaths(join(workspace, "test"))
381 407
408 # Expand arguments with grouped tests. The args should reflect the list of
409 # suites as otherwise filters would break.
410 def ExpandTestGroups(name):
411 if name in TEST_MAP:
412 return [suite for suite in TEST_MAP[arg]]
413 else:
414 return [name]
415 args = reduce(lambda x, y: x + y,
416 [ExpandTestGroups(arg) for arg in args],
417 [])
418
382 if len(args) == 0: 419 if len(args) == 0:
383 suite_paths = [ s for s in DEFAULT_TESTS if s in suite_paths ] 420 suite_paths = [ s for s in DEFAULT_TESTS if s in suite_paths ]
384 else: 421 else:
385 args_suites = set() 422 args_suites = OrderedDict() # Used as set
386 for arg in args: 423 for arg in args:
387 suite = arg.split(os.path.sep)[0] 424 args_suites[arg.split(os.path.sep)[0]] = True
388 if not suite in args_suites:
389 args_suites.add(suite)
390 suite_paths = [ s for s in args_suites if s in suite_paths ] 425 suite_paths = [ s for s in args_suites if s in suite_paths ]
391 426
392 suites = [] 427 suites = []
393 for root in suite_paths: 428 for root in suite_paths:
394 suite = testsuite.TestSuite.LoadTestSuite( 429 suite = testsuite.TestSuite.LoadTestSuite(
395 os.path.join(workspace, "test", root)) 430 os.path.join(workspace, "test", root))
396 if suite: 431 if suite:
397 suites.append(suite) 432 suites.append(suite)
398 433
399 if options.download_data: 434 if options.download_data:
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 exit_code = runner.Run(options.j) 578 exit_code = runner.Run(options.j)
544 overall_duration = time.time() - start_time 579 overall_duration = time.time() - start_time
545 580
546 if options.time: 581 if options.time:
547 verbose.PrintTestDurations(suites, overall_duration) 582 verbose.PrintTestDurations(suites, overall_duration)
548 return exit_code 583 return exit_code
549 584
550 585
551 if __name__ == "__main__": 586 if __name__ == "__main__":
552 sys.exit(Main()) 587 sys.exit(Main())
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