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 87 matching lines...) Loading... |
98 help="Regard tests marked as flaky (run|skip|dontcare)", | 98 help="Regard tests marked as flaky (run|skip|dontcare)", |
99 default="dontcare") | 99 default="dontcare") |
100 result.add_option("--command-prefix", | 100 result.add_option("--command-prefix", |
101 help="Prepended to each shell command used to run a test", | 101 help="Prepended to each shell command used to run a test", |
102 default="") | 102 default="") |
103 result.add_option("--download-data", help="Download missing test suite data", | 103 result.add_option("--download-data", help="Download missing test suite data", |
104 default=False, action="store_true") | 104 default=False, action="store_true") |
105 result.add_option("--extra-flags", | 105 result.add_option("--extra-flags", |
106 help="Additional flags to pass to each test command", | 106 help="Additional flags to pass to each test command", |
107 default="") | 107 default="") |
| 108 result.add_option("--i18n", help="Whether to test internationalization", |
| 109 default=False, action="store_true") |
108 result.add_option("--isolates", help="Whether to test isolates", | 110 result.add_option("--isolates", help="Whether to test isolates", |
109 default=False, action="store_true") | 111 default=False, action="store_true") |
110 result.add_option("-j", help="The number of parallel tasks to run", | 112 result.add_option("-j", help="The number of parallel tasks to run", |
111 default=0, type="int") | 113 default=0, type="int") |
112 result.add_option("-m", "--mode", | 114 result.add_option("-m", "--mode", |
113 help="The test modes in which to run (comma-separated)", | 115 help="The test modes in which to run (comma-separated)", |
114 default="release,debug") | 116 default="release,debug") |
115 result.add_option("--no-network", "--nonetwork", | 117 result.add_option("--no-network", "--nonetwork", |
116 help="Don't distribute tests on the network", | 118 help="Don't distribute tests on the network", |
117 default=(utils.GuessOS() != "linux"), | 119 default=(utils.GuessOS() != "linux"), |
(...skipping 85 matching lines...) Loading... |
203 if options.stress_only: | 205 if options.stress_only: |
204 VARIANT_FLAGS = [["--stress-opt", "--always-opt"]] | 206 VARIANT_FLAGS = [["--stress-opt", "--always-opt"]] |
205 if options.valgrind: | 207 if options.valgrind: |
206 run_valgrind = os.path.join("tools", "run-valgrind.py") | 208 run_valgrind = os.path.join("tools", "run-valgrind.py") |
207 # This is OK for distributed running, so we don't need to set no_network. | 209 # This is OK for distributed running, so we don't need to set no_network. |
208 options.command_prefix = (["python", "-u", run_valgrind] + | 210 options.command_prefix = (["python", "-u", run_valgrind] + |
209 options.command_prefix) | 211 options.command_prefix) |
210 if not options.flaky_tests in ["run", "skip", "dontcare"]: | 212 if not options.flaky_tests in ["run", "skip", "dontcare"]: |
211 print "Unknown flaky test mode %s" % options.flaky_tests | 213 print "Unknown flaky test mode %s" % options.flaky_tests |
212 return False | 214 return False |
| 215 if options.i18n: |
| 216 DEFAULT_TESTS.append("intl") |
213 return True | 217 return True |
214 | 218 |
215 | 219 |
216 def ShardTests(tests, shard_count, shard_run): | 220 def ShardTests(tests, shard_count, shard_run): |
217 if shard_count < 2: | 221 if shard_count < 2: |
218 return tests | 222 return tests |
219 if shard_run < 1 or shard_run > shard_count: | 223 if shard_run < 1 or shard_run > shard_count: |
220 print "shard-run not a valid number, should be in [1:shard-count]" | 224 print "shard-run not a valid number, should be in [1:shard-count]" |
221 print "defaulting back to running all tests" | 225 print "defaulting back to running all tests" |
222 return tests | 226 return tests |
(...skipping 160 matching lines...) Loading... |
383 except KeyboardInterrupt: | 387 except KeyboardInterrupt: |
384 return 1 | 388 return 1 |
385 | 389 |
386 if options.time: | 390 if options.time: |
387 verbose.PrintTestDurations(suites, overall_duration) | 391 verbose.PrintTestDurations(suites, overall_duration) |
388 return exit_code | 392 return exit_code |
389 | 393 |
390 | 394 |
391 if __name__ == "__main__": | 395 if __name__ == "__main__": |
392 sys.exit(Main()) | 396 sys.exit(Main()) |
OLD | NEW |