diff mbox series

[2/3] patchtest/selftest: allow passing extra arguments to patchtest

Message ID 20260318161209.54396-2-naftaly.ralamboarivony@smile.fr
State Under Review
Headers show
Series [1/3] patchtest: add --error-on-failure option | expand

Commit Message

naftaly.ralamboarivony@smile.fr March 18, 2026, 4:12 p.m. UTC
From: Naftaly RALAMBOARIVONY <naftaly.ralamboarivony@smile.fr>

Add an optional extra_args parameter to test() and append it to the
patchtest command when provided.

Signed-off-by: Naftaly RALAMBOARIVONY <naftaly.ralamboarivony@smile.fr>
---
 meta/lib/patchtest/selftest/selftest | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/lib/patchtest/selftest/selftest b/meta/lib/patchtest/selftest/selftest
index 43cccf4c85..51681bec38 100755
--- a/meta/lib/patchtest/selftest/selftest
+++ b/meta/lib/patchtest/selftest/selftest
@@ -130,11 +130,14 @@  def git_detach_head():
     return get_git_state()
 
 # Once the tests are in oe-core, we can remove the testdir param and use os.path.dirname to get relative paths
-def test(root, patch):
+def test(root, patch, extra_args=None):
     res = True
     patchpath = os.path.abspath(os.path.join(root, patch))
     
     cmd     = 'patchtest --base-commit HEAD --repodir %s --testdir %s/tests --patch %s' % (repodir, topdir, patchpath)
+    if extra_args:
+        cmd += " " + extra_args
+
     results = subprocess.check_output(cmd, stderr=subprocess.STDOUT, universal_newlines=True, shell=True)
 
     return results