public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH] rust: Oe-selftest error log on console when it fails.
@ 2024-02-13 13:04 Yash.Shinde
  2024-02-13 18:12 ` Randy MacLeod
  0 siblings, 1 reply; 5+ messages in thread
From: Yash.Shinde @ 2024-02-13 13:04 UTC (permalink / raw)
  To: openembedded-core
  Cc: Randy.MacLeod, Umesh.Kallapa, Naveen.Gowda, Sundeep.Kokkonda,
	Shivaprasad.Moodalappa, Yash.Shinde

From: Yash Shinde <Yash.Shinde@windriver.com>

The rust oe-selftest output error log doesn't show any information on console when it fails.
The following changes emit stderr logs in terminal along with re-directing stdout and stderr to "summary.txt" file.

Changes made::
- cmd = cmd + " cd %s; python3 src/bootstrap/bootstrap.py test %s --target %s > summary.txt 2>&1;" % (builddir, testargs, targetsys)
+ cmd = cmd + " cd %s; python3 src/bootstrap/bootstrap.py test %s --target %s  > summary.txt 2> >(tee summary.txt >&2);" % (builddir, testargs, targetsys)

> summary.txt:                  Redirects the standard output (stdout) of the command to a file 'summary.txt'
2> >(tee summary.txt >&2):      Redirects stderr & stdout to summary.txt & writes stderr on terminal

The overall effect is that both stdout and stderr are captured in the summary.txt file, while stderr still being displayed in the terminal.

Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
---
 meta/lib/oeqa/selftest/cases/rust.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/selftest/cases/rust.py b/meta/lib/oeqa/selftest/cases/rust.py
index 164ad11ecd..07f1b5706c 100644
--- a/meta/lib/oeqa/selftest/cases/rust.py
+++ b/meta/lib/oeqa/selftest/cases/rust.py
@@ -213,7 +213,7 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
             cmd = cmd + " export RUST_TARGET_PATH=%s/rust-targets;" % rustlibpath
             # Trigger testing.
             cmd = cmd + " export TEST_DEVICE_ADDR=\"%s:12345\";" % qemu.ip
-            cmd = cmd + " cd %s; python3 src/bootstrap/bootstrap.py test %s --target %s > summary.txt 2>&1;" % (builddir, testargs, targetsys)
+            cmd = cmd + " cd %s; python3 src/bootstrap/bootstrap.py test %s --target %s  > summary.txt 2> >(tee summary.txt >&2);" % (builddir, testargs, targetsys)
             runCmd(cmd)
             end_time = time.time()
 
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-02-21 12:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-13 13:04 [PATCH] rust: Oe-selftest error log on console when it fails Yash.Shinde
2024-02-13 18:12 ` Randy MacLeod
2024-02-13 18:21   ` [OE-core] " Alexander Kanavin
2024-02-21  8:00   ` Yash Shinde
2024-02-21 12:21     ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox