##// END OF EJS Templates
run-tests: drop options.child and users
Matt Mackall -
r19279:3868c9ab default
parent child Browse files
Show More
@@ -137,8 +137,6 b' def parseargs():'
137 help="always run tests listed in the specified whitelist file")
137 help="always run tests listed in the specified whitelist file")
138 parser.add_option("-C", "--annotate", action="store_true",
138 parser.add_option("-C", "--annotate", action="store_true",
139 help="output files annotated with coverage")
139 help="output files annotated with coverage")
140 parser.add_option("--child", type="int",
141 help="run as child process, summary to given fd")
142 parser.add_option("-c", "--cover", action="store_true",
140 parser.add_option("-c", "--cover", action="store_true",
143 help="print a test coverage report")
141 help="print a test coverage report")
144 parser.add_option("-d", "--debug", action="store_true",
142 parser.add_option("-d", "--debug", action="store_true",
@@ -242,9 +240,6 b' def parseargs():'
242
240
243 global verbose
241 global verbose
244 if options.verbose:
242 if options.verbose:
245 if options.jobs > 1 or options.child is not None:
246 verbose = "[%d]" % os.getpid()
247 else:
248 verbose = ''
243 verbose = ''
249
244
250 if options.tmpdir:
245 if options.tmpdir:
@@ -272,8 +267,7 b' def parseargs():'
272 if options.blacklist:
267 if options.blacklist:
273 options.blacklist = parselistfiles(options.blacklist, 'blacklist')
268 options.blacklist = parselistfiles(options.blacklist, 'blacklist')
274 if options.whitelist:
269 if options.whitelist:
275 options.whitelisted = parselistfiles(options.whitelist, 'whitelist',
270 options.whitelisted = parselistfiles(options.whitelist, 'whitelist')
276 warn=options.child is None)
277 else:
271 else:
278 options.whitelisted = {}
272 options.whitelisted = {}
279
273
@@ -568,9 +562,6 b' def outputcoverage(options):'
568 vlog('# Running: %s' % cmd)
562 vlog('# Running: %s' % cmd)
569 os.system(cmd)
563 os.system(cmd)
570
564
571 if options.child:
572 return
573
574 covrun('-c')
565 covrun('-c')
575 omit = ','.join(os.path.join(x, '*') for x in [BINDIR, TESTDIR])
566 omit = ','.join(os.path.join(x, '*') for x in [BINDIR, TESTDIR])
576 covrun('-i', '-r', '"--omit=%s"' % omit) # report
567 covrun('-i', '-r', '"--omit=%s"' % omit) # report
@@ -1133,13 +1124,6 b' def runtests(options, tests):'
1133 skipped = len(results['s'])
1124 skipped = len(results['s'])
1134 ignored = len(results['i'])
1125 ignored = len(results['i'])
1135
1126
1136 if options.child:
1137 fp = os.fdopen(options.child, 'wb')
1138 pickle.dump(results, fp, pickle.HIGHEST_PROTOCOL)
1139 if options.time:
1140 pickle.dump(times, fp, pickle.HIGHEST_PROTOCOL)
1141 fp.close()
1142 else:
1143 print
1127 print
1144 for s in results['s']:
1128 for s in results['s']:
1145 print "Skipped %s: %s" % s
1129 print "Skipped %s: %s" % s
@@ -1155,7 +1139,6 b' def runtests(options, tests):'
1155 outputcoverage(options)
1139 outputcoverage(options)
1156 except KeyboardInterrupt:
1140 except KeyboardInterrupt:
1157 failed = True
1141 failed = True
1158 if not options.child:
1159 print "\ninterrupted!"
1142 print "\ninterrupted!"
1160
1143
1161 if failed:
1144 if failed:
@@ -1166,7 +1149,6 b" testtypes = [('.py', pytest, '.out'),"
1166
1149
1167 def main():
1150 def main():
1168 (options, args) = parseargs()
1151 (options, args) = parseargs()
1169 if not options.child:
1170 os.umask(022)
1152 os.umask(022)
1171
1153
1172 checktools()
1154 checktools()
@@ -1193,7 +1175,6 b' def main():'
1193 global TESTDIR, HGTMP, INST, BINDIR, PYTHONDIR, COVERAGE_FILE
1175 global TESTDIR, HGTMP, INST, BINDIR, PYTHONDIR, COVERAGE_FILE
1194 TESTDIR = os.environ["TESTDIR"] = os.getcwd()
1176 TESTDIR = os.environ["TESTDIR"] = os.getcwd()
1195 if options.tmpdir:
1177 if options.tmpdir:
1196 if not options.child:
1197 options.keep_tmpdir = True
1178 options.keep_tmpdir = True
1198 tmpdir = options.tmpdir
1179 tmpdir = options.tmpdir
1199 if os.path.exists(tmpdir):
1180 if os.path.exists(tmpdir):
@@ -1235,7 +1216,6 b' def main():'
1235 os.environ["BINDIR"] = BINDIR
1216 os.environ["BINDIR"] = BINDIR
1236 os.environ["PYTHON"] = PYTHON
1217 os.environ["PYTHON"] = PYTHON
1237
1218
1238 if not options.child:
1239 path = [BINDIR] + os.environ["PATH"].split(os.pathsep)
1219 path = [BINDIR] + os.environ["PATH"].split(os.pathsep)
1240 os.environ["PATH"] = os.pathsep.join(path)
1220 os.environ["PATH"] = os.pathsep.join(path)
1241
1221
General Comments 0
You need to be logged in to leave comments. Login now