OLD | NEW |
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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 result.add_option("--no-network", "--nonetwork", | 118 result.add_option("--no-network", "--nonetwork", |
119 help="Don't distribute tests on the network", | 119 help="Don't distribute tests on the network", |
120 default=(utils.GuessOS() != "linux"), | 120 default=(utils.GuessOS() != "linux"), |
121 dest="no_network", action="store_true") | 121 dest="no_network", action="store_true") |
122 result.add_option("--no-presubmit", "--nopresubmit", | 122 result.add_option("--no-presubmit", "--nopresubmit", |
123 help='Skip presubmit checks', | 123 help='Skip presubmit checks', |
124 default=False, dest="no_presubmit", action="store_true") | 124 default=False, dest="no_presubmit", action="store_true") |
125 result.add_option("--no-stress", "--nostress", | 125 result.add_option("--no-stress", "--nostress", |
126 help="Don't run crankshaft --always-opt --stress-op test", | 126 help="Don't run crankshaft --always-opt --stress-op test", |
127 default=False, dest="no_stress", action="store_true") | 127 default=False, dest="no_stress", action="store_true") |
| 128 result.add_option("--no-variants", "--novariants", |
| 129 help="Don't run any testing variants", |
| 130 default=False, dest="no_variants", action="store_true") |
128 result.add_option("--outdir", help="Base directory with compile output", | 131 result.add_option("--outdir", help="Base directory with compile output", |
129 default="out") | 132 default="out") |
130 result.add_option("-p", "--progress", | 133 result.add_option("-p", "--progress", |
131 help=("The style of progress indicator" | 134 help=("The style of progress indicator" |
132 " (verbose, dots, color, mono)"), | 135 " (verbose, dots, color, mono)"), |
133 choices=progress.PROGRESS_INDICATORS.keys(), default="mono") | 136 choices=progress.PROGRESS_INDICATORS.keys(), default="mono") |
134 result.add_option("--report", help="Print a summary of the tests to be run", | 137 result.add_option("--report", help="Print a summary of the tests to be run", |
135 default=False, action="store_true") | 138 default=False, action="store_true") |
136 result.add_option("--shard-count", | 139 result.add_option("--shard-count", |
137 help="Split testsuites into this number of shards", | 140 help="Split testsuites into this number of shards", |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 options.no_presubmit = True | 193 options.no_presubmit = True |
191 options.no_network = True | 194 options.no_network = True |
192 if options.command_prefix: | 195 if options.command_prefix: |
193 print("Specifying --command-prefix disables network distribution, " | 196 print("Specifying --command-prefix disables network distribution, " |
194 "running tests locally.") | 197 "running tests locally.") |
195 options.no_network = True | 198 options.no_network = True |
196 options.command_prefix = shlex.split(options.command_prefix) | 199 options.command_prefix = shlex.split(options.command_prefix) |
197 options.extra_flags = shlex.split(options.extra_flags) | 200 options.extra_flags = shlex.split(options.extra_flags) |
198 if options.j == 0: | 201 if options.j == 0: |
199 options.j = multiprocessing.cpu_count() | 202 options.j = multiprocessing.cpu_count() |
| 203 |
| 204 def excl(*args): |
| 205 """Returns true if zero or one of multiple arguments are true.""" |
| 206 return reduce(lambda x, y: x + y, args) <= 1 |
| 207 |
| 208 if not excl(options.no_stress, options.stress_only, options.no_variants): |
| 209 print "Use only one of --no-stress, --stress-only or --no-variants." |
| 210 return False |
200 if options.no_stress: | 211 if options.no_stress: |
201 VARIANT_FLAGS = [[], ["--nocrankshaft"]] | 212 VARIANT_FLAGS = [[], ["--nocrankshaft"]] |
| 213 if options.no_variants: |
| 214 VARIANT_FLAGS = [[]] |
202 if not options.shell_dir: | 215 if not options.shell_dir: |
203 if options.shell: | 216 if options.shell: |
204 print "Warning: --shell is deprecated, use --shell-dir instead." | 217 print "Warning: --shell is deprecated, use --shell-dir instead." |
205 options.shell_dir = os.path.dirname(options.shell) | 218 options.shell_dir = os.path.dirname(options.shell) |
206 if options.stress_only: | 219 if options.stress_only: |
207 VARIANT_FLAGS = [["--stress-opt", "--always-opt"]] | 220 VARIANT_FLAGS = [["--stress-opt", "--always-opt"]] |
208 if options.valgrind: | 221 if options.valgrind: |
209 run_valgrind = os.path.join("tools", "run-valgrind.py") | 222 run_valgrind = os.path.join("tools", "run-valgrind.py") |
210 # This is OK for distributed running, so we don't need to set no_network. | 223 # This is OK for distributed running, so we don't need to set no_network. |
211 options.command_prefix = (["python", "-u", run_valgrind] + | 224 options.command_prefix = (["python", "-u", run_valgrind] + |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 except KeyboardInterrupt: | 404 except KeyboardInterrupt: |
392 return 1 | 405 return 1 |
393 | 406 |
394 if options.time: | 407 if options.time: |
395 verbose.PrintTestDurations(suites, overall_duration) | 408 verbose.PrintTestDurations(suites, overall_duration) |
396 return exit_code | 409 return exit_code |
397 | 410 |
398 | 411 |
399 if __name__ == "__main__": | 412 if __name__ == "__main__": |
400 sys.exit(Main()) | 413 sys.exit(Main()) |
OLD | NEW |