OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2008 the V8 project authors. All rights reserved. | 3 # Copyright 2008 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 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1174 default=False, action="store_true") | 1174 default=False, action="store_true") |
1175 result.add_option("-S", dest="scons_flags", help="Flag to pass through to scon
s", | 1175 result.add_option("-S", dest="scons_flags", help="Flag to pass through to scon
s", |
1176 default=[], action="append") | 1176 default=[], action="append") |
1177 result.add_option("-p", "--progress", | 1177 result.add_option("-p", "--progress", |
1178 help="The style of progress indicator (verbose, dots, color, mono)", | 1178 help="The style of progress indicator (verbose, dots, color, mono)", |
1179 choices=PROGRESS_INDICATORS.keys(), default="mono") | 1179 choices=PROGRESS_INDICATORS.keys(), default="mono") |
1180 result.add_option("--no-build", help="Don't build requirements", | 1180 result.add_option("--no-build", help="Don't build requirements", |
1181 default=False, action="store_true") | 1181 default=False, action="store_true") |
1182 result.add_option("--build-only", help="Only build requirements, don't run the
tests", | 1182 result.add_option("--build-only", help="Only build requirements, don't run the
tests", |
1183 default=False, action="store_true") | 1183 default=False, action="store_true") |
| 1184 result.add_option("--build-system", help="Build system in use (scons or gyp)", |
| 1185 default='scons') |
1184 result.add_option("--report", help="Print a summary of the tests to be run", | 1186 result.add_option("--report", help="Print a summary of the tests to be run", |
1185 default=False, action="store_true") | 1187 default=False, action="store_true") |
1186 result.add_option("-s", "--suite", help="A test suite", | 1188 result.add_option("-s", "--suite", help="A test suite", |
1187 default=[], action="append") | 1189 default=[], action="append") |
1188 result.add_option("-t", "--timeout", help="Timeout in seconds", | 1190 result.add_option("-t", "--timeout", help="Timeout in seconds", |
1189 default=60, type="int") | 1191 default=60, type="int") |
1190 result.add_option("--arch", help='The architecture to run tests for', | 1192 result.add_option("--arch", help='The architecture to run tests for', |
1191 default='none') | 1193 default='none') |
1192 result.add_option("--snapshot", help="Run the tests with snapshot turned on", | 1194 result.add_option("--snapshot", help="Run the tests with snapshot turned on", |
1193 default=False, action="store_true") | 1195 default=False, action="store_true") |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1273 else: | 1275 else: |
1274 options.special_command = "@--crankshaft" | 1276 options.special_command = "@--crankshaft" |
1275 if options.shell == "d8": | 1277 if options.shell == "d8": |
1276 if options.special_command: | 1278 if options.special_command: |
1277 options.special_command += " --test" | 1279 options.special_command += " --test" |
1278 else: | 1280 else: |
1279 options.special_command = "@--test" | 1281 options.special_command = "@--test" |
1280 if options.noprof: | 1282 if options.noprof: |
1281 options.scons_flags.append("prof=off") | 1283 options.scons_flags.append("prof=off") |
1282 options.scons_flags.append("profilingsupport=off") | 1284 options.scons_flags.append("profilingsupport=off") |
| 1285 if options.build_system == 'gyp': |
| 1286 if options.build_only: |
| 1287 print "--build-only not supported for gyp, please build manually." |
| 1288 options.build_only = False |
1283 return True | 1289 return True |
1284 | 1290 |
1285 | 1291 |
1286 REPORT_TEMPLATE = """\ | 1292 REPORT_TEMPLATE = """\ |
1287 Total: %(total)i tests | 1293 Total: %(total)i tests |
1288 * %(skipped)4d tests will be skipped | 1294 * %(skipped)4d tests will be skipped |
1289 * %(nocrash)4d tests are expected to be flaky but not crash | 1295 * %(nocrash)4d tests are expected to be flaky but not crash |
1290 * %(pass)4d tests are expected to pass | 1296 * %(pass)4d tests are expected to pass |
1291 * %(fail_ok)4d tests are expected to fail that we won't fix | 1297 * %(fail_ok)4d tests are expected to fail that we won't fix |
1292 * %(fail)4d tests are expected to fail that we should fix\ | 1298 * %(fail)4d tests are expected to fail that we should fix\ |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1392 for arg in args: | 1398 for arg in args: |
1393 path = SplitPath(arg) | 1399 path = SplitPath(arg) |
1394 paths.append(path) | 1400 paths.append(path) |
1395 | 1401 |
1396 # Check for --valgrind option. If enabled, we overwrite the special | 1402 # Check for --valgrind option. If enabled, we overwrite the special |
1397 # command flag with a command that uses the run-valgrind.py script. | 1403 # command flag with a command that uses the run-valgrind.py script. |
1398 if options.valgrind: | 1404 if options.valgrind: |
1399 run_valgrind = join(workspace, "tools", "run-valgrind.py") | 1405 run_valgrind = join(workspace, "tools", "run-valgrind.py") |
1400 options.special_command = "python -u " + run_valgrind + " @" | 1406 options.special_command = "python -u " + run_valgrind + " @" |
1401 | 1407 |
| 1408 if options.build_system == 'gyp': |
| 1409 SUFFIX['debug'] = '' |
| 1410 |
1402 shell = abspath(options.shell) | 1411 shell = abspath(options.shell) |
1403 buildspace = dirname(shell) | 1412 buildspace = dirname(shell) |
1404 | 1413 |
1405 context = Context(workspace, buildspace, VERBOSE, | 1414 context = Context(workspace, buildspace, VERBOSE, |
1406 shell, | 1415 shell, |
1407 options.timeout, | 1416 options.timeout, |
1408 GetSpecialCommandProcessor(options.special_command), | 1417 GetSpecialCommandProcessor(options.special_command), |
1409 options.suppress_dialogs, | 1418 options.suppress_dialogs, |
1410 options.store_unexpected_output) | 1419 options.store_unexpected_output) |
1411 # First build the required targets | 1420 # First build the required targets |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1507 for entry in timed_tests[:20]: | 1516 for entry in timed_tests[:20]: |
1508 t = FormatTime(entry.duration) | 1517 t = FormatTime(entry.duration) |
1509 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) | 1518 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) |
1510 index += 1 | 1519 index += 1 |
1511 | 1520 |
1512 return result | 1521 return result |
1513 | 1522 |
1514 | 1523 |
1515 if __name__ == '__main__': | 1524 if __name__ == '__main__': |
1516 sys.exit(Main()) | 1525 sys.exit(Main()) |
OLD | NEW |