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

Side by Side Diff: client/common_lib/utils.py

Issue 3116009: Update autotest tests to use make -j where possible. (Closed) Base URL: ssh://git@chromiumos-git/autotest.git
Patch Set: Convert last two tests to use utils.make(), saving another 20 seconds. Created 10 years, 4 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
« no previous file with comments | « client/bin/unit_test.py ('k') | client/deps/glbench/glbench.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 # 1 #
2 # Copyright 2008 Google Inc. Released under the GPL v2 2 # Copyright 2008 Google Inc. Released under the GPL v2
3 3
4 import os, pickle, random, re, resource, select, shutil, signal, StringIO 4 import os, pickle, random, re, resource, select, shutil, signal, StringIO
5 import socket, struct, subprocess, sys, time, textwrap, urlparse 5 import socket, struct, subprocess, sys, time, textwrap, urlparse
6 import warnings, smtplib, logging, urllib2 6 import warnings, smtplib, logging, urllib2
7 try: 7 try:
8 import hashlib 8 import hashlib
9 except ImportError: 9 except ImportError:
10 import md5, sha 10 import md5, sha
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 if 'CBUILD' in os.environ: 1158 if 'CBUILD' in os.environ:
1159 args.append('--build=' + os.environ['CBUILD']) 1159 args.append('--build=' + os.environ['CBUILD'])
1160 if 'CTARGET' in os.environ: 1160 if 'CTARGET' in os.environ:
1161 args.append('--target=' + os.environ['CTARGET']) 1161 args.append('--target=' + os.environ['CTARGET'])
1162 if extra: 1162 if extra:
1163 args.append(extra) 1163 args.append(extra)
1164 1164
1165 system('%s %s' % (configure, ' '.join(args))) 1165 system('%s %s' % (configure, ' '.join(args)))
1166 1166
1167 1167
1168 def make(extra='', make='make', timeout=None, ignore_status=False):
1169 """
1170 Run make, adding MAKEOPTS to the list of options.
1171
1172 @param extra: extra command line arguments to pass to make.
1173 """
1174 cmd = '%s %s %s' % (make, os.environ.get("MAKEOPTS", ""), extra)
1175 return system(cmd, timeout=timeout, ignore_status=ignore_status)
1176
1177
1168 def compare_versions(ver1, ver2): 1178 def compare_versions(ver1, ver2):
1169 """Version number comparison between ver1 and ver2 strings. 1179 """Version number comparison between ver1 and ver2 strings.
1170 1180
1171 >>> compare_tuple("1", "2") 1181 >>> compare_tuple("1", "2")
1172 -1 1182 -1
1173 >>> compare_tuple("foo-1.1", "foo-1.2") 1183 >>> compare_tuple("foo-1.1", "foo-1.2")
1174 -1 1184 -1
1175 >>> compare_tuple("1.2", "1.2a") 1185 >>> compare_tuple("1.2", "1.2a")
1176 -1 1186 -1
1177 >>> compare_tuple("1.2b", "1.2a") 1187 >>> compare_tuple("1.2b", "1.2a")
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 arg_re = re.compile(r'(\w+)[:=](.*)$') 1223 arg_re = re.compile(r'(\w+)[:=](.*)$')
1214 dict = {} 1224 dict = {}
1215 for arg in args: 1225 for arg in args:
1216 match = arg_re.match(arg) 1226 match = arg_re.match(arg)
1217 if match: 1227 if match:
1218 dict[match.group(1).lower()] = match.group(2) 1228 dict[match.group(1).lower()] = match.group(2)
1219 else: 1229 else:
1220 logging.warning("args_to_dict: argument '%s' doesn't match " 1230 logging.warning("args_to_dict: argument '%s' doesn't match "
1221 "'%s' pattern. Ignored." % (arg, arg_re.pattern)) 1231 "'%s' pattern. Ignored." % (arg, arg_re.pattern))
1222 return dict 1232 return dict
OLDNEW
« no previous file with comments | « client/bin/unit_test.py ('k') | client/deps/glbench/glbench.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698