##// END OF EJS Templates
run-tests: add --view switch to use external diff viewer
Matt Mackall -
r11040:8f951ed6 default
parent child Browse files
Show More
@@ -132,6 +132,8 b' def parseargs():'
132 " (implies --keep-tmpdir)")
132 " (implies --keep-tmpdir)")
133 parser.add_option("-v", "--verbose", action="store_true",
133 parser.add_option("-v", "--verbose", action="store_true",
134 help="output verbose messages")
134 help="output verbose messages")
135 parser.add_option("--view", type="string",
136 help="external diff viewer")
135 parser.add_option("--with-hg", type="string",
137 parser.add_option("--with-hg", type="string",
136 metavar="HG",
138 metavar="HG",
137 help="test using specified hg script rather than a "
139 help="test using specified hg script rather than a "
@@ -573,6 +575,7 b' def runone(options, test, skips, fails):'
573 mark = '.'
575 mark = '.'
574
576
575 skipped = (ret == SKIPPED_STATUS)
577 skipped = (ret == SKIPPED_STATUS)
578
576 # If we're not in --debug mode and reference output file exists,
579 # If we're not in --debug mode and reference output file exists,
577 # check test output against it.
580 # check test output against it.
578 if options.debug:
581 if options.debug:
@@ -584,6 +587,13 b' def runone(options, test, skips, fails):'
584 else:
587 else:
585 refout = []
588 refout = []
586
589
590 if (ret != 0 or out != refout) and not skipped and not options.debug:
591 # Save errors to a file for diagnosis
592 f = open(err, "wb")
593 for line in out:
594 f.write(line)
595 f.close()
596
587 if skipped:
597 if skipped:
588 mark = 's'
598 mark = 's'
589 if out is None: # debug mode: nothing to parse
599 if out is None: # debug mode: nothing to parse
@@ -605,7 +615,10 b' def runone(options, test, skips, fails):'
605 else:
615 else:
606 fail("output changed")
616 fail("output changed")
607 if not options.nodiff:
617 if not options.nodiff:
608 showdiff(refout, out, ref, err)
618 if options.view:
619 os.system("%s %s %s" % (options.view, ref, err))
620 else:
621 showdiff(refout, out, ref, err)
609 ret = 1
622 ret = 1
610 elif ret:
623 elif ret:
611 mark = '!'
624 mark = '!'
@@ -615,13 +628,6 b' def runone(options, test, skips, fails):'
615 sys.stdout.write(mark)
628 sys.stdout.write(mark)
616 sys.stdout.flush()
629 sys.stdout.flush()
617
630
618 if ret != 0 and not skipped and not options.debug:
619 # Save errors to a file for diagnosis
620 f = open(err, "wb")
621 for line in out:
622 f.write(line)
623 f.close()
624
625 killdaemons()
631 killdaemons()
626
632
627 os.chdir(TESTDIR)
633 os.chdir(TESTDIR)
General Comments 0
You need to be logged in to leave comments. Login now