mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 2/2] test: report used Labgrid environment and build dir
Date: Mon, 16 Feb 2026 09:39:02 +0100	[thread overview]
Message-ID: <20260216083907.3543595-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20260216083907.3543595-1-a.fatoum@pengutronix.de>

We have custom logic for populating LG_ENV and LG_BUILDDIR if they
are not set. Let's print out this information at start to help avoid
surprises.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 conftest.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/conftest.py b/conftest.py
index 40c93d2f0473..8c76f8ddf3cf 100644
--- a/conftest.py
+++ b/conftest.py
@@ -76,6 +76,9 @@ def guess_lg_env():
     return None
 
 
+lg_env = lg_builddir = None
+
+
 def pytest_configure(config):
     if 'LG_BUILDDIR' not in os.environ:
         if 'KBUILD_OUTPUT' in os.environ:
@@ -88,6 +91,10 @@ def pytest_configure(config):
     if os.environ['LG_BUILDDIR'] is not None:
         os.environ['LG_BUILDDIR'] = os.path.realpath(os.environ['LG_BUILDDIR'])
 
+    global lg_env
+    global lg_builddir
+
+    lg_builddir = os.environ['LG_BUILDDIR']
     lg_env = config.option.lg_env
     if lg_env is None:
         lg_env = os.environ.get('LG_ENV')
@@ -96,6 +103,15 @@ def pytest_configure(config):
             os.environ['LG_ENV'] = lg_env
 
 
+def pytest_report_header(config):
+    report = []
+    if lg_builddir is not None:
+        report += [f"Build diectory: {lg_builddir}"]
+    if lg_env is not None:
+        report += [f"Labgrid Environment: {lg_env}"]
+    return "\n".join(report)
+
+
 def pytest_addoption(parser):
     def assignment(arg):
         return arg.split('=', 1)
-- 
2.47.3




      reply	other threads:[~2026-02-16  8:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-16  8:39 [PATCH 1/2] kconfig: add merge_into_defconfig_named to set CONFIG_NAME Ahmad Fatoum
2026-02-16  8:39 ` Ahmad Fatoum [this message]

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=20260216083907.3543595-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox