<div dir="ltr">On Wed, Feb 6, 2013 at 1:24 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Wed, Feb 6, 2013 at 11:41 AM, Daniel Dunbar <<a href="mailto:daniel@zuster.org">daniel@zuster.org</a>> wrote:<br>

> Author: ddunbar<br>
> Date: Wed Feb  6 13:41:05 2013<br>
> New Revision: 174533<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=174533&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=174533&view=rev</a><br>
> Log:<br>
> LitTestCommand: Include the verbose log start/stop markers in the extracted log.<br>
><br>
>  - The start marker in particular is a nice header for the log, and clearly<br>
>    calls out the test name. The stop marker is just nice to include for bracing<br>
>    the text and matching up to the lit output.<br>
<br>
</div>Would it make more/as much sense to just include the original log line<br>
("FAIL: ...") & skip the start/stop markers? (that way you don't need<br>
such a special case for the context-less failure case: as soon as you<br>
see the failure code, log that & whatever context comes after it, if<br>
any)?<br></blockquote><div><br></div><div style>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.</div>
<div style><br></div><div style> - Daniel</div><div style> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
><br>
> Modified:<br>
>     zorg/trunk/zorg/buildbot/commands/LitTestCommand.py<br>
><br>
> Modified: zorg/trunk/zorg/buildbot/commands/LitTestCommand.py<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/commands/LitTestCommand.py?rev=174533&r1=174532&r2=174533&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/commands/LitTestCommand.py?rev=174533&r1=174532&r2=174533&view=diff</a><br>

> ==============================================================================<br>
> --- zorg/trunk/zorg/buildbot/commands/LitTestCommand.py (original)<br>
> +++ zorg/trunk/zorg/buildbot/commands/LitTestCommand.py Wed Feb  6 13:41:05 2013<br>
> @@ -38,13 +38,12 @@ class LitLogObserver(LogLineObserver):<br>
>          return True<br>
><br>
>    def handleVerboseLogLine(self, line):<br>
> -    # If this isn't a stop marker, just append it and continue.<br>
> -    if not self.kTestVerboseLogStopRE.match(line):<br>
> -      self.activeVerboseLog.append(line)<br>
> -      return<br>
> +    # Append to the log.<br>
> +    self.activeVerboseLog.append(line)<br>
><br>
> -    # Otherwise, the log and test info are finished.<br>
> -    self.testInfoFinished()<br>
> +    # If this is a stop marker, process the test info.<br>
> +    if self.kTestVerboseLogStopRE.match(line):<br>
> +      self.testInfoFinished()<br>
><br>
>    def testInfoFinished(self):<br>
>      # We have finished getting information for one test, handle it.<br>
> @@ -77,7 +76,7 @@ class LitLogObserver(LogLineObserver):<br>
>      # Check for the test verbose log start marker.<br>
>      m = self.kTestVerboseLogStartRE.match(line.strip())<br>
>      if m:<br>
> -      self.activeVerboseLog = []<br>
> +      self.activeVerboseLog = [line]<br>
>        if m.group(1) != self.lastTestResult[1]:<br>
>          # This is bogus, the verbose log test name doesn't match what we<br>
>          # expect. Just note it in the log but otherwise accumulate as normal.<br>
> @@ -176,7 +175,7 @@ PASS: test-three (3 of 3)<br>
>      obs = self.parse_log("""<br>
>  FAIL: test-one (1 of 3)<br>
>  FAIL: test-two (2 of 3)<br>
> -**** TEST 'test-two' ****<br>
> +**** TEST 'test-two' FAILED ****<br>
>  bla bla bla<br>
>  **********<br>
>  FAIL: test-three (3 of 3)<br>
> @@ -185,7 +184,10 @@ FAIL: test-three (3 of 3)<br>
>      self.assertEqual(obs.resultCounts, { 'FAIL' : 3 })<br>
>      self.assertEqual(obs.step.logs, [<br>
>          ('test-one', 'FAIL: test-one'),<br>
> -        ('test-two', 'bla bla bla'),<br>
> +        ('test-two', """\<br>
> +**** TEST 'test-two' FAILED ****<br>
> +bla bla bla<br>
> +**********"""),<br>
>          ('test-three', 'FAIL: test-three')])<br>
><br>
>  class TestCommand(unittest.TestCase):<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div></div>