[zorg] r174533 - LitTestCommand: Include the verbose log start/stop markers in the extracted log.
Daniel Dunbar
daniel at zuster.org
Wed Feb 6 17:51:33 PST 2013
On Wed, Feb 6, 2013 at 1:24 PM, David Blaikie <dblaikie at gmail.com> wrote:
> On Wed, Feb 6, 2013 at 11:41 AM, Daniel Dunbar <daniel at zuster.org> wrote:
> > Author: ddunbar
> > Date: Wed Feb 6 13:41:05 2013
> > New Revision: 174533
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=174533&view=rev
> > Log:
> > LitTestCommand: Include the verbose log start/stop markers in the
> extracted log.
> >
> > - The start marker in particular is a nice header for the log, and
> clearly
> > calls out the test name. The stop marker is just nice to include for
> bracing
> > the text and matching up to the lit output.
>
> Would it make more/as much sense to just include the original log line
> ("FAIL: ...") & skip the start/stop markers? (that way you don't need
> such a special case for the context-less failure case: as soon as you
> see the failure code, log that & whatever context comes after it, if
> any)?
>
I thought about it, but it doesn't actually simplify the code because you
still have to track the distinction between having started seeing a log
versus seeing the next test with no log in between. Also I kind of like the
look of the start/stop markers better when reading the log.
- Daniel
>
> >
> > Modified:
> > zorg/trunk/zorg/buildbot/commands/LitTestCommand.py
> >
> > Modified: zorg/trunk/zorg/buildbot/commands/LitTestCommand.py
> > URL:
> http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/commands/LitTestCommand.py?rev=174533&r1=174532&r2=174533&view=diff
> >
> ==============================================================================
> > --- zorg/trunk/zorg/buildbot/commands/LitTestCommand.py (original)
> > +++ zorg/trunk/zorg/buildbot/commands/LitTestCommand.py Wed Feb 6
> 13:41:05 2013
> > @@ -38,13 +38,12 @@ class LitLogObserver(LogLineObserver):
> > return True
> >
> > def handleVerboseLogLine(self, line):
> > - # If this isn't a stop marker, just append it and continue.
> > - if not self.kTestVerboseLogStopRE.match(line):
> > - self.activeVerboseLog.append(line)
> > - return
> > + # Append to the log.
> > + self.activeVerboseLog.append(line)
> >
> > - # Otherwise, the log and test info are finished.
> > - self.testInfoFinished()
> > + # If this is a stop marker, process the test info.
> > + if self.kTestVerboseLogStopRE.match(line):
> > + self.testInfoFinished()
> >
> > def testInfoFinished(self):
> > # We have finished getting information for one test, handle it.
> > @@ -77,7 +76,7 @@ class LitLogObserver(LogLineObserver):
> > # Check for the test verbose log start marker.
> > m = self.kTestVerboseLogStartRE.match(line.strip())
> > if m:
> > - self.activeVerboseLog = []
> > + self.activeVerboseLog = [line]
> > if m.group(1) != self.lastTestResult[1]:
> > # This is bogus, the verbose log test name doesn't match what we
> > # expect. Just note it in the log but otherwise accumulate as
> normal.
> > @@ -176,7 +175,7 @@ PASS: test-three (3 of 3)
> > obs = self.parse_log("""
> > FAIL: test-one (1 of 3)
> > FAIL: test-two (2 of 3)
> > -**** TEST 'test-two' ****
> > +**** TEST 'test-two' FAILED ****
> > bla bla bla
> > **********
> > FAIL: test-three (3 of 3)
> > @@ -185,7 +184,10 @@ FAIL: test-three (3 of 3)
> > self.assertEqual(obs.resultCounts, { 'FAIL' : 3 })
> > self.assertEqual(obs.step.logs, [
> > ('test-one', 'FAIL: test-one'),
> > - ('test-two', 'bla bla bla'),
> > + ('test-two', """\
> > +**** TEST 'test-two' FAILED ****
> > +bla bla bla
> > +**********"""),
> > ('test-three', 'FAIL: test-three')])
> >
> > class TestCommand(unittest.TestCase):
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130206/eab7ab93/attachment.html>
More information about the llvm-commits
mailing list