On Fri, Dec 3, 2010 at 6:05 AM, David Roe <r...@math.harvard.edu> wrote:

> import re
> def concise_log(long_log_name, concise_log_name):
>     with open(long_log_name) as long_log:
>         log = long_log.read()
>         p = "The following tests
> failed:\\n\\n(.*)\\n----------------------------------------------------------------------\n"
>         match = re.search(p, log, flags=re.DOTALL)
>         clog = ""
>         if match is not None:
>             tests = match.groups()[0].split('\n')
>             for test in tests:
>                 match = re.search(r"sage -t  -force_lib
> devel/([^/]*)/([^#]*)", test)
>                 if match is None:
>                     clog += test + "\nSee full log for more details"
>                 else:
>                     test = "sage -t  -force_lib /" +
> match.groups()[1].strip()
>                     failure = log.find(test)
>                     match = re.search(test, log)
>                     next = log[failure+1:].find("sage -t  -force_lib")
>                     clog += log[failure: failure+next] + "\n\n"
>         else:
>             clog = "No doctests failed"
>     with open(concise_log_name, "w") as concise_log:
>         concise_log.write(clog)
>

Yes, eliding the passed build/test entries was certainly on my todo
list, thanks for the code.

- Robert

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to