Show More
@@ -406,6 +406,10 b' def getparser():' | |||
|
406 | 406 | metavar="known_good_rev", |
|
407 | 407 | help=("Automatically bisect any failures using this " |
|
408 | 408 | "revision as a known-good revision.")) |
|
409 | parser.add_option('--bisect-repo', type="string", | |
|
410 | metavar='bisect_repo', | |
|
411 | help=("Path of a repo to bisect. Use together with " | |
|
412 | "--known-good-rev")) | |
|
409 | 413 | |
|
410 | 414 | for option, (envvar, default) in defaults.items(): |
|
411 | 415 | defaults[option] = type(default)(os.environ.get(envvar, default)) |
@@ -458,6 +462,9 b' def parseargs(args, parser):' | |||
|
458 | 462 | sys.stderr.write('warning: --color=always ignored because ' |
|
459 | 463 | 'pygments is not installed\n') |
|
460 | 464 | |
|
465 | if options.bisect_repo and not options.known_good_rev: | |
|
466 | parser.error("--bisect-repo cannot be used without --known-good-rev") | |
|
467 | ||
|
461 | 468 | global useipv6 |
|
462 | 469 | if options.ipv6: |
|
463 | 470 | useipv6 = checksocketfamily('AF_INET6') |
@@ -2071,6 +2078,9 b' class TextTestRunner(unittest.TextTestRu' | |||
|
2071 | 2078 | |
|
2072 | 2079 | if failed and self._runner.options.known_good_rev: |
|
2073 | 2080 | bisectcmd = ['hg', 'bisect'] |
|
2081 | bisectrepo = self._runner.options.bisect_repo | |
|
2082 | if bisectrepo: | |
|
2083 | bisectcmd.extend(['-R', os.path.abspath(bisectrepo)]) | |
|
2074 | 2084 | def nooutput(args): |
|
2075 | 2085 | p = subprocess.Popen(args, stderr=subprocess.STDOUT, |
|
2076 | 2086 | stdout=subprocess.PIPE) |
@@ -1285,6 +1285,58 b' support for bisecting failed tests autom' | |||
|
1285 | 1285 | |
|
1286 | 1286 | $ cd .. |
|
1287 | 1287 | |
|
1288 | support bisecting a separate repo | |
|
1289 | ||
|
1290 | $ hg init bisect-dependent | |
|
1291 | $ cd bisect-dependent | |
|
1292 | $ cat > test-bisect-dependent.t <<EOF | |
|
1293 | > $ tail -1 \$TESTDIR/../bisect/test-bisect.t | |
|
1294 | > pass | |
|
1295 | > EOF | |
|
1296 | $ hg commit -Am dependent test-bisect-dependent.t | |
|
1297 | ||
|
1298 | $ rt --known-good-rev=0 test-bisect-dependent.t | |
|
1299 | ||
|
1300 | --- $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t | |
|
1301 | +++ $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t.err | |
|
1302 | @@ -1,2 +1,2 @@ | |
|
1303 | $ tail -1 $TESTDIR/../bisect/test-bisect.t | |
|
1304 | - pass | |
|
1305 | + fail | |
|
1306 | ||
|
1307 | ERROR: test-bisect-dependent.t output changed | |
|
1308 | ! | |
|
1309 | Failed test-bisect-dependent.t: output changed | |
|
1310 | Failed to identify failure point for test-bisect-dependent.t | |
|
1311 | # Ran 1 tests, 0 skipped, 1 failed. | |
|
1312 | python hash seed: * (glob) | |
|
1313 | [1] | |
|
1314 | ||
|
1315 | $ rt --bisect-repo=../test-bisect test-bisect-dependent.t | |
|
1316 | Usage: run-tests.py [options] [tests] | |
|
1317 | ||
|
1318 | run-tests.py: error: --bisect-repo cannot be used without --known-good-rev | |
|
1319 | [2] | |
|
1320 | ||
|
1321 | $ rt --known-good-rev=0 --bisect-repo=../bisect test-bisect-dependent.t | |
|
1322 | ||
|
1323 | --- $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t | |
|
1324 | +++ $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t.err | |
|
1325 | @@ -1,2 +1,2 @@ | |
|
1326 | $ tail -1 $TESTDIR/../bisect/test-bisect.t | |
|
1327 | - pass | |
|
1328 | + fail | |
|
1329 | ||
|
1330 | ERROR: test-bisect-dependent.t output changed | |
|
1331 | ! | |
|
1332 | Failed test-bisect-dependent.t: output changed | |
|
1333 | test-bisect-dependent.t broken by 72cbf122d116 (bad) | |
|
1334 | # Ran 1 tests, 0 skipped, 1 failed. | |
|
1335 | python hash seed: * (glob) | |
|
1336 | [1] | |
|
1337 | ||
|
1338 | $ cd .. | |
|
1339 | ||
|
1288 | 1340 | Test a broken #if statement doesn't break run-tests threading. |
|
1289 | 1341 | ============================================================== |
|
1290 | 1342 | $ mkdir broken |
General Comments 0
You need to be logged in to leave comments.
Login now