Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Michael Fischer <mf@go-sys.de>,
	Romain Naour <romain.naour@gmail.com>,
	Buildroot List <buildroot@buildroot.org>
Subject: Re: [Buildroot] [PATCH 5/5] support/testing: add suite of tests for gdb
Date: Sun, 10 Oct 2021 19:43:09 +0200	[thread overview]
Message-ID: <20211010174309.GO2081069@scaer> (raw)
In-Reply-To: <20211009191646.1076266-6-thomas.petazzoni@bootlin.com>

Thomas, All,

On 2021-10-09 21:16 +0200, Thomas Petazzoni spake thusly:
> The list of tests is as follows:
> 
> TestGdbHostOnlyDefault: build just minimal host-gdb, default version
> 
> TestGdbHostOnlyAllFeatures: build host-gdb, default version, with all
> features enabled (TUI, Python, simulator)
> 
> TestGdbserverOnly: build just target gdbserver, default version
> 
> TestGdbFullTarget: build just target gdb, default version
> 
> TestGdbHostOnly9x: build minimal host-gdb, 9.x version
> 
> TestGdbHostGdbserver9x: build minimal host-gdb 9.x + gdbserver
> 
> TestGdbHostGdbTarget9x: build minimal host-gdb 9.x + full gdb
> 
> TestGdbHostOnly11x: build minimal host-gdb, 11.x version
> 
> TestGdbHostGdbserver11x: build minimal host-gdb 11.x + gdbserver
> 
> TestGdbHostGdbTarget11x: build minimal host-gdb 11.x + gdb
> 
> TestGdbArc: build minimal host-gdb + gdb + gdbserver, for the special
> ARC architecture version
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  support/testing/tests/package/test_gdb.py | 215 ++++++++++++++++++++++
>  1 file changed, 215 insertions(+)
>  create mode 100644 support/testing/tests/package/test_gdb.py
> 
> diff --git a/support/testing/tests/package/test_gdb.py b/support/testing/tests/package/test_gdb.py
> new file mode 100644
> index 0000000000..a7b0870644
> --- /dev/null
> +++ b/support/testing/tests/package/test_gdb.py
> @@ -0,0 +1,215 @@
> +import os
> +import infra.basetest
> +
> +
> +class BaseGdb(infra.basetest.BRTest):
> +    def verify_host_gdb(self, prefix="arm-linux"):
> +        cmd = ["host/bin/%s-gdb" % prefix, "--version"]
> +        # We don't check the return value, as it automatically raises
> +        # an exception if the command returns with a non-zero value
> +        infra.run_cmd_on_host(self.builddir, cmd)
> +
> +    def boot(self):
> +        img = os.path.join(self.builddir, "images", "rootfs.cpio")
> +        self.emulator.boot(arch="armv5",
> +                           kernel="builtin",
> +                           options=["-initrd", img,
> +                                    "-net", "nic",
> +                                    "-net", "user"])
> +        self.emulator.login()
> +
> +    def verify_gdbserver(self):
> +        cmd = "gdbserver --version"
> +        self.assertRunOk(cmd)
> +
> +    def verify_gdb(self):
> +        cmd = "gdb --version"
> +        self.assertRunOk(cmd)
> +
> +
> +class TestGdbHostOnlyDefault(BaseGdb):
> +    config = \
> +        infra.basetest.MINIMAL_CONFIG + \
> +        """
> +        BR2_arm=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> +        BR2_PACKAGE_HOST_GDB=y
> +        """
> +
> +    def test_run(self):
> +        self.verify_host_gdb()
> +
> +
> +class TestGdbHostOnlyAllFeatures(BaseGdb):
> +    config = \
> +        infra.basetest.MINIMAL_CONFIG + \
> +        """
> +        BR2_arm=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> +        BR2_PACKAGE_HOST_GDB=y
> +        BR2_PACKAGE_HOST_GDB_TUI=y
> +        BR2_PACKAGE_HOST_GDB_PYTHON3=y
> +        BR2_PACKAGE_HOST_GDB_SIM=y
> +        """
> +
> +    def test_run(self):
> +        self.verify_host_gdb()
> +
> +
> +class TestGdbserverOnly(BaseGdb):
> +    config = \
> +        """
> +        BR2_arm=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> +        BR2_PACKAGE_GDB=y
> +        BR2_TARGET_ROOTFS_CPIO=y
> +        # BR2_TARGET_ROOTFS_TAR is not set
> +        """
> +
> +    def test_run(self):
> +        self.boot()
> +        self.verify_gdbserver()
> +
> +
> +class TestGdbFullTarget(BaseGdb):
> +    config = \
> +        """
> +        BR2_arm=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> +        BR2_PACKAGE_GDB=y
> +        BR2_PACKAGE_GDB_DEBUGGER=y
> +        BR2_TARGET_ROOTFS_CPIO=y
> +        # BR2_TARGET_ROOTFS_TAR is not set
> +        """
> +
> +    def test_run(self):
> +        self.boot()
> +        self.verify_gdb()
> +
> +
> +class TestGdbHostOnly9x(BaseGdb):
> +    config = \
> +        infra.basetest.MINIMAL_CONFIG + \
> +        """
> +        BR2_arm=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> +        BR2_PACKAGE_HOST_GDB=y
> +        BR2_GDB_VERSION_9_2=y
> +        """
> +
> +    def test_run(self):
> +        self.verify_host_gdb()
> +
> +
> +class TestGdbHostGdbserver9x(BaseGdb):
> +    config = \
> +        """
> +        BR2_arm=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> +        BR2_PACKAGE_HOST_GDB=y
> +        BR2_GDB_VERSION_9_2=y
> +        BR2_PACKAGE_GDB=y
> +        BR2_TARGET_ROOTFS_CPIO=y
> +        # BR2_TARGET_ROOTFS_TAR is not set
> +        """
> +
> +    def test_run(self):
> +        self.verify_host_gdb()
> +        self.boot()
> +        self.verify_gdbserver()
> +
> +
> +class TestGdbHostGdbTarget9x(BaseGdb):
> +    config = \
> +        """
> +        BR2_arm=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> +        BR2_PACKAGE_HOST_GDB=y
> +        BR2_GDB_VERSION_9_2=y
> +        BR2_PACKAGE_GDB=y
> +        BR2_PACKAGE_GDB_DEBUGGER=y
> +        BR2_TARGET_ROOTFS_CPIO=y
> +        # BR2_TARGET_ROOTFS_TAR is not set
> +        """
> +
> +    def test_run(self):
> +        self.verify_host_gdb()
> +        self.boot()
> +        self.verify_gdb()
> +
> +
> +class TestGdbHostOnly11x(BaseGdb):
> +    config = \
> +        infra.basetest.MINIMAL_CONFIG + \
> +        """
> +        BR2_arm=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> +        BR2_PACKAGE_HOST_GDB=y
> +        BR2_GDB_VERSION_11=y
> +        """
> +
> +    def test_run(self):
> +        self.verify_host_gdb()
> +
> +
> +class TestGdbHostGdbserver11x(BaseGdb):
> +    config = \
> +        """
> +        BR2_arm=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> +        BR2_PACKAGE_HOST_GDB=y
> +        BR2_GDB_VERSION_11=y
> +        BR2_PACKAGE_GDB=y
> +        BR2_TARGET_ROOTFS_CPIO=y
> +        # BR2_TARGET_ROOTFS_TAR is not set
> +        """
> +
> +    def test_run(self):
> +        self.verify_host_gdb()
> +        self.boot()
> +        self.verify_gdbserver()
> +
> +
> +class TestGdbHostGdbTarget11x(BaseGdb):
> +    config = \
> +        """
> +        BR2_arm=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> +        BR2_PACKAGE_HOST_GDB=y
> +        BR2_GDB_VERSION_11=y
> +        BR2_PACKAGE_GDB=y
> +        BR2_PACKAGE_GDB_DEBUGGER=y
> +        BR2_TARGET_ROOTFS_CPIO=y
> +        # BR2_TARGET_ROOTFS_TAR is not set
> +        """
> +
> +    def test_run(self):
> +        self.verify_host_gdb()
> +        self.boot()
> +        self.verify_gdb()
> +
> +
> +class TestGdbArc(BaseGdb):
> +    config = \
> +        """
> +        BR2_arcle=y
> +        BR2_archs4x_rel31=y
> +        BR2_TOOLCHAIN_EXTERNAL=y
> +        BR2_PACKAGE_HOST_GDB=y
> +        BR2_PACKAGE_GDB=y
> +        BR2_PACKAGE_GDB_SERVER=y
> +        BR2_PACKAGE_GDB_DEBUGGER=y
> +        """
> +
> +    def test_run(self):
> +        self.verify_host_gdb("arc-linux")
> -- 
> 2.31.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      reply	other threads:[~2021-10-10 17:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-09 19:16 [Buildroot] [PATCH 0/5] GDB updates Thomas Petazzoni
2021-10-09 19:16 ` [Buildroot] [PATCH 1/5] package/gdb: append to dependencies in conditional Thomas Petazzoni
2021-10-10  8:49   ` Yann E. MORIN
2021-10-10 10:05     ` Peter Korsgaard
2021-10-10 13:57     ` Thomas Petazzoni
2021-10-09 19:16 ` [Buildroot] [PATCH 2/5] package/gdb: add support for gdb 11.x Thomas Petazzoni
2021-10-10  9:10   ` Yann E. MORIN
2021-10-10 13:57     ` Thomas Petazzoni
2021-10-10 17:42       ` Yann E. MORIN
2021-10-09 19:16 ` [Buildroot] [PATCH 3/5] package/gdb: switch to gdb 10.x as the default Thomas Petazzoni
2021-10-10 17:42   ` Yann E. MORIN
2021-10-09 19:16 ` [Buildroot] [PATCH 4/5] package/gdb: drop support for version 8.3.x Thomas Petazzoni
2021-10-10 17:42   ` Yann E. MORIN
2021-10-09 19:16 ` [Buildroot] [PATCH 5/5] support/testing: add suite of tests for gdb Thomas Petazzoni
2021-10-10 17:43   ` Yann E. MORIN [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=20211010174309.GO2081069@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=mf@go-sys.de \
    --cc=romain.naour@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    /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