All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
To: fuego@lists.linuxfoundation.org
Subject: [Fuego] [PATCH 2/2] LTP:ltp_process: parse the rt.log into a new sheet
Date: Wed, 13 Dec 2017 17:42:17 +0900	[thread overview]
Message-ID: <1513154537-11933-3-git-send-email-daniel.sangorrin@toshiba.co.jp> (raw)
In-Reply-To: <1513154537-11933-1-git-send-email-daniel.sangorrin@toshiba.co.jp>

[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@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



  parent reply	other threads:[~2017-12-13  8:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13  8:42 [Fuego] LTP: fix the spreadsheet parser script Daniel Sangorrin
2017-12-13  8:42 ` [Fuego] [PATCH 1/2] LTP:ltp_process: dont crash if no sheets are generated Daniel Sangorrin
2017-12-14  1:09   ` Bird, Timothy
2017-12-13  8:42 ` Daniel Sangorrin [this message]
2017-12-14  1:07   ` [Fuego] [PATCH 2/2] LTP:ltp_process: parse the rt.log into a new sheet Bird, Timothy
2017-12-14  1:09   ` Bird, Timothy
2017-12-14  1:15 ` [Fuego] LTP: fix the spreadsheet parser script Bird, Timothy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1513154537-11933-3-git-send-email-daniel.sangorrin@toshiba.co.jp \
    --to=daniel.sangorrin@toshiba.co.jp \
    --cc=fuego@lists.linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.