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

Side by Side Diff: tools/test.py

Issue 346004: Add snapshot option to test runner (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 1 month 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 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 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 result.add_option("--build-only", help="Only build requirements, don't run the tests", 1087 result.add_option("--build-only", help="Only build requirements, don't run the tests",
1088 default=False, action="store_true") 1088 default=False, action="store_true")
1089 result.add_option("--report", help="Print a summary of the tests to be run", 1089 result.add_option("--report", help="Print a summary of the tests to be run",
1090 default=False, action="store_true") 1090 default=False, action="store_true")
1091 result.add_option("-s", "--suite", help="A test suite", 1091 result.add_option("-s", "--suite", help="A test suite",
1092 default=[], action="append") 1092 default=[], action="append")
1093 result.add_option("-t", "--timeout", help="Timeout in seconds", 1093 result.add_option("-t", "--timeout", help="Timeout in seconds",
1094 default=60, type="int") 1094 default=60, type="int")
1095 result.add_option("--arch", help='The architecture to run tests for', 1095 result.add_option("--arch", help='The architecture to run tests for',
1096 default='none') 1096 default='none')
1097 result.add_option("--snapshot", help="Run the tests with snapshot turned on",
1098 default=False, action="store_true")
1097 result.add_option("--simulator", help="Run tests with architecture simulator", 1099 result.add_option("--simulator", help="Run tests with architecture simulator",
1098 default='none') 1100 default='none')
1099 result.add_option("--special-command", default=None) 1101 result.add_option("--special-command", default=None)
1100 result.add_option("--valgrind", help="Run tests through valgrind", 1102 result.add_option("--valgrind", help="Run tests through valgrind",
1101 default=False, action="store_true") 1103 default=False, action="store_true")
1102 result.add_option("--cat", help="Print the source of the tests", 1104 result.add_option("--cat", help="Print the source of the tests",
1103 default=False, action="store_true") 1105 default=False, action="store_true")
1104 result.add_option("--warn-unused", help="Report unused rules", 1106 result.add_option("--warn-unused", help="Report unused rules",
1105 default=False, action="store_true") 1107 default=False, action="store_true")
1106 result.add_option("-j", help="The number of parallel tasks to run", 1108 result.add_option("-j", help="The number of parallel tasks to run",
(...skipping 25 matching lines...) Expand all
1132 print "Architecture %s does not match sim %s" %(options.arch, options.si mulator) 1134 print "Architecture %s does not match sim %s" %(options.arch, options.si mulator)
1133 return False 1135 return False
1134 # Ensure that the simulator argument is handed down to scons. 1136 # Ensure that the simulator argument is handed down to scons.
1135 options.scons_flags.append("simulator=" + options.simulator) 1137 options.scons_flags.append("simulator=" + options.simulator)
1136 else: 1138 else:
1137 # If options.arch is not set by the command line and no simulator setting 1139 # If options.arch is not set by the command line and no simulator setting
1138 # was found, set the arch to the guess. 1140 # was found, set the arch to the guess.
1139 if options.arch == 'none': 1141 if options.arch == 'none':
1140 options.arch = ARCH_GUESS 1142 options.arch = ARCH_GUESS
1141 options.scons_flags.append("arch=" + options.arch) 1143 options.scons_flags.append("arch=" + options.arch)
1144 if options.snapshot:
1145 options.scons_flags.append("snapshot=on")
1142 return True 1146 return True
1143 1147
1144 1148
1145 REPORT_TEMPLATE = """\ 1149 REPORT_TEMPLATE = """\
1146 Total: %(total)i tests 1150 Total: %(total)i tests
1147 * %(skipped)4d tests will be skipped 1151 * %(skipped)4d tests will be skipped
1148 * %(nocrash)4d tests are expected to be flaky but not crash 1152 * %(nocrash)4d tests are expected to be flaky but not crash
1149 * %(pass)4d tests are expected to pass 1153 * %(pass)4d tests are expected to pass
1150 * %(fail_ok)4d tests are expected to fail that we won't fix 1154 * %(fail_ok)4d tests are expected to fail that we won't fix
1151 * %(fail)4d tests are expected to fail that we should fix\ 1155 * %(fail)4d tests are expected to fail that we should fix\
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 for entry in timed_tests[:20]: 1350 for entry in timed_tests[:20]:
1347 t = FormatTime(entry.duration) 1351 t = FormatTime(entry.duration)
1348 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) 1352 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel()))
1349 index += 1 1353 index += 1
1350 1354
1351 return result 1355 return result
1352 1356
1353 1357
1354 if __name__ == '__main__': 1358 if __name__ == '__main__':
1355 sys.exit(Main()) 1359 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