[Fuego] [PATCH 2/2] LTP:ltp_process: parse the rt.log into a new sheet

Bird, Timothy Tim.Bird at sony.com
Thu Dec 14 01:09:17 UTC 2017


Applied and pushed.

Thanks,
 -- Tim

> -----Original Message-----
> From: fuego-bounces at lists.linuxfoundation.org [mailto:fuego-
> bounces at lists.linuxfoundation.org] On Behalf Of Daniel Sangorrin
> Sent: Wednesday, December 13, 2017 12:42 AM
> To: fuego at lists.linuxfoundation.org
> Subject: [Fuego] [PATCH 2/2] LTP:ltp_process: parse the rt.log into a new
> sheet
> 
> [Note] I noticed that some tests didn't produce any machine
> readable format result. This may need to be patched upstream.
> 
> TODO: add support for the normal parser as well.
> 
> Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
> ---
>  engine/tests/Functional.LTP/ltp_process.py | 24
> ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/engine/tests/Functional.LTP/ltp_process.py
> b/engine/tests/Functional.LTP/ltp_process.py
> index 867ef7a..eb059f4 100644
> --- a/engine/tests/Functional.LTP/ltp_process.py
> +++ b/engine/tests/Functional.LTP/ltp_process.py
> @@ -331,6 +331,30 @@ if os.path.exists('pts.log'):
>          # last working sheet
>          pts_set_style(ws)
> 
> +if os.path.exists('rt.log'):
> +    with open('rt.log') as f:
> +        rt_testcase_regex = "^--- Running testcase (.*)  ---$"
> +        rt_results_regex = "^\s*Result:\s*(.*)$"
> +        ws = book.create_sheet(title="RT tests")
> +        row = 0
> +        ws.cell(row=row,column=0).value = "Test"
> +        ws.cell(row=row,column=1).value = "Result"
> +        ws.cell(row=row,column=2).value = "Log"
> +        for line in f:
> +            m = re.match(rt_testcase_regex, line.rstrip())
> +            if m:
> +                test_case = m.group(1)
> +                row = row + 1
> +                ws.cell(row=row,column=0).value = test_case
> +            m = re.match(rt_results_regex, line.rstrip())
> +            if m:
> +                test_result = m.group(1)
> +                ws.cell(row=row,column=1).value = test_result
> +            if ws.cell(row=row,column=2).value:
> +                ws.cell(row=row,column=2).value =
> ws.cell(row=row,column=2).value + line
> +            else:
> +                ws.cell(row=row,column=2).value = line
> +
>  # if we have added sheets, remove the default one ("Sheet")
>  sheets = book.get_sheet_names()
>  if len(sheets) > 1:
> --
> 2.7.4
> 
> 
> _______________________________________________
> Fuego mailing list
> Fuego at lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/fuego


More information about the Fuego mailing list