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

Side by Side Diff: tools/testing/perf_testing/run_perf_tests.py

Issue 10115011: Get Dromaeo tests running on Windows. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 | tools/testing/run_selenium.py » ('j') | 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/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
4 # for details. All rights reserved. Use of this source code is governed by a 4 # for details. All rights reserved. Use of this source code is governed by a
5 # BSD-style license that can be found in the LICENSE file. 5 # BSD-style license that can be found in the LICENSE file.
6 6
7 import datetime 7 import datetime
8 import getpass 8 import getpass
9 import math 9 import math
10 try: 10 try:
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 if append: 60 if append:
61 mode = 'a' 61 mode = 'a'
62 out = open(outfile, mode) 62 out = open(outfile, mode)
63 if append: 63 if append:
64 # Annoying Windows "feature" -- append doesn't actually append unless 64 # Annoying Windows "feature" -- append doesn't actually append unless
65 # you explicitly go to the end of the file. 65 # you explicitly go to the end of the file.
66 # http://mail.python.org/pipermail/python-list/2009-October/1221859.html 66 # http://mail.python.org/pipermail/python-list/2009-October/1221859.html
67 out.seek(0, os.SEEK_END) 67 out.seek(0, os.SEEK_END)
68 p = subprocess.Popen(cmd_list, stdout = out, stderr=subprocess.PIPE, 68 p = subprocess.Popen(cmd_list, stdout = out, stderr=subprocess.PIPE,
69 stdin=subprocess.PIPE, shell=self.has_shell) 69 stdin=subprocess.PIPE, shell=self.has_shell)
70 output, _ = p.communicate(std_in); 70 output, stderr = p.communicate(std_in);
71 if output: 71 if output:
72 print output 72 print output
73 if stderr:
74 print stderr
73 return output 75 return output
74 76
75 def time_cmd(self, cmd): 77 def time_cmd(self, cmd):
76 """Determine the amount of (real) time it takes to execute a given 78 """Determine the amount of (real) time it takes to execute a given
77 command.""" 79 command."""
78 start = time.time() 80 start = time.time()
79 self.run_cmd(cmd) 81 self.run_cmd(cmd)
80 return time.time() - start 82 return time.time() - start
81 83
82 @staticmethod 84 @staticmethod
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 versions = DromaeoTester.get_dromaeo_versions() 860 versions = DromaeoTester.get_dromaeo_versions()
859 861
860 for browser in BrowserTester.get_browsers(): 862 for browser in BrowserTester.get_browsers():
861 for version_name in versions: 863 for version_name in versions:
862 version = DromaeoTest.DromaeoPerfTester.get_dromaeo_url_query( 864 version = DromaeoTest.DromaeoPerfTester.get_dromaeo_url_query(
863 version_name) 865 version_name)
864 self.test.trace_file = os.path.join( 866 self.test.trace_file = os.path.join(
865 'tools', 'testing', 'perf_testing', self.test.result_folder_name, 867 'tools', 'testing', 'perf_testing', self.test.result_folder_name,
866 'dromaeo-%s-%s-%s' % (self.test.cur_time, browser, version_name)) 868 'dromaeo-%s-%s-%s' % (self.test.cur_time, browser, version_name))
867 self.add_svn_revision_to_trace(self.test.trace_file) 869 self.add_svn_revision_to_trace(self.test.trace_file)
868 file_path = os.path.join(os.getcwd(), dromaeo_path, 870 file_path = '"%s"' % os.path.join(os.getcwd(), dromaeo_path,
869 'index-js.html?%s' % version) 871 'index-js.html?%s' % version)
870 self.test.test_runner.run_cmd( 872 self.test.test_runner.run_cmd(
871 ['python', os.path.join('tools', 'testing', 'run_selenium.py'), 873 ['python', os.path.join('tools', 'testing', 'run_selenium.py'),
872 '--out', file_path, '--browser', browser, 874 '--out', file_path, '--browser', browser,
873 '--timeout', '600', '--mode', 'dromaeo'], self.test.trace_file, 875 '--timeout', '600', '--mode', 'dromaeo'], self.test.trace_file,
874 append=True) 876 append=True)
875 877
876 @staticmethod 878 @staticmethod
877 def get_dromaeo_url_query(version): 879 def get_dromaeo_url_query(version):
878 version = version.replace('_','&') 880 version = version.replace('_','&')
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
1219 while True: 1221 while True:
1220 if runner.has_new_code(): 1222 if runner.has_new_code():
1221 runner.run_test_sequence() 1223 runner.run_test_sequence()
1222 else: 1224 else:
1223 time.sleep(200) 1225 time.sleep(200)
1224 else: 1226 else:
1225 runner.run_test_sequence() 1227 runner.run_test_sequence()
1226 1228
1227 if __name__ == '__main__': 1229 if __name__ == '__main__':
1228 main() 1230 main()
OLDNEW
« no previous file with comments | « no previous file | tools/testing/run_selenium.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698