public inbox for buildroot@busybox.net
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/5] support/testing/tests/toolchain/test_external: support non-ELF toolchains
Date: Thu, 14 May 2020 14:53:00 +0200	[thread overview]
Message-ID: <20200514125304.1106087-3-thomas.petazzoni@bootlin.com> (raw)
In-Reply-To: <20200514125304.1106087-1-thomas.petazzoni@bootlin.com>

The TestExternalToolchain() base class implement a test checking if
the ELF interpreter that is advertised by Busybox really exists in the
rootfs. Of course, this only makes sense with ELF toolchains. Until
now, only ELF toolchains were tested, but we are going to use
TestExternalToolchain() with non-ELF toolchains as well, so let's make
this conditional.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 support/testing/tests/toolchain/test_external.py | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/support/testing/tests/toolchain/test_external.py b/support/testing/tests/toolchain/test_external.py
index 881d2b00db..1818ae0498 100644
--- a/support/testing/tests/toolchain/test_external.py
+++ b/support/testing/tests/toolchain/test_external.py
@@ -26,11 +26,15 @@ class TestExternalToolchain(infra.basetest.BRTest):
             path = os.path.join(self.builddir, "target", d)
             self.assertFalse(has_broken_links(path))
 
-        interp = infra.get_elf_prog_interpreter(self.builddir,
-                                                self.toolchain_prefix,
-                                                "bin/busybox")
-        interp_path = os.path.join(self.builddir, "target", interp[1:])
-        self.assertTrue(os.path.exists(interp_path))
+        with open(os.path.join(self.builddir, ".config")) as configf:
+            configlines = configf.readlines()
+
+        if "BR2_BINFMT_ELF=y\n" in configlines:
+            interp = infra.get_elf_prog_interpreter(self.builddir,
+                                                    self.toolchain_prefix,
+                                                    "bin/busybox")
+            interp_path = os.path.join(self.builddir, "target", interp[1:])
+            self.assertTrue(os.path.exists(interp_path))
 
 
 class TestExternalToolchainSourceryArmv4(TestExternalToolchain):
-- 
2.26.2

  parent reply	other threads:[~2020-05-14 12:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14 12:52 [Buildroot] [PATCH 0/5] Bootlin toolchains integration into Buildroot Thomas Petazzoni
2020-05-14 12:52 ` [Buildroot] [PATCH 1/5] support/scripts/bl-toolchain-gen: add new script to support Bootlin toolchains Thomas Petazzoni
2020-05-14 14:33   ` Titouan Christophe
2020-05-14 12:53 ` Thomas Petazzoni [this message]
2020-05-14 12:53 ` [Buildroot] [PATCH 3/5] toolchain/toolchain-external/toolchain-external-bootlin: add auto-generated files Thomas Petazzoni
2020-05-14 12:53 ` [Buildroot] [PATCH 4/5] toolchain/toolchain-external/toolchain-external-bootlin: finalize package addition Thomas Petazzoni
2020-05-14 12:53 ` [Buildroot] [PATCH 5/5] support/testing/test/toolchain/test_external_bootlin: new test cases Thomas Petazzoni

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=20200514125304.1106087-3-thomas.petazzoni@bootlin.com \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@busybox.net \
    /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