All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ricardo Martincoski <ricardo.martincoski@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 5/5] support/testing: add toolchain tests
Date: Sun, 05 Mar 2017 18:30:01 -0300	[thread overview]
Message-ID: <58bc8359882ea_6832a0cfd06544b@ultri3.mail> (raw)
In-Reply-To: 1488726201-6507-6-git-send-email-thomas.petazzoni@free-electrons.com

Thomas Petazzoni,

On Sun, Mar 05, 2017 at 12:03 PM, Thomas Petazzoni wrote:

[snip]
> +class TestExternalToolchain(infra.basetest.BRTest):

nose2 recognizes this as a test:
$ support/testing/run-tests --list 2>&1 | grep Toolchain | head -n1
test_run (tests.toolchain.test_external.TestExternalToolchain) ... ok

and it tries to run it when --all is used:
======================================================================
ERROR: test_run (tests.toolchain.test_external.TestExternalToolchain)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/testing-v2/support/testing/infra/basetest.py", line 56, in setUp
    self.b.build()
  File "/tmp/testing-v2/support/testing/infra/builder.py", line 23, in build
    cf.write(self.config)
TypeError: expected a string or other character buffer object

> +    def test_run(self):

I think you could avoid this by renaming this method ...

https://nose2.readthedocs.io/en/latest/usage.html#naming-tests
'Within test modules, nose2 will load tests from unittest.TestCase subclasses,
and from test functions (functions whose names begin with "test").'

... to something like this:
    def common_check(self):
...

> +        # Check for broken symlinks
> +        for d in ["lib", "usr/lib"]:
> +            path = os.path.join(self.builddir, "staging", d)
> +            self.assertFalse(check_broken_links(path))
> +            path = os.path.join(self.builddir, "target", d)
> +            self.assertFalse(check_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))
> +
> +class TestExternalToolchainSourceryArmv4(TestExternalToolchain):
> +    config = BASIC_CONFIG + \
> +"""
> +BR2_arm=y
> +BR2_arm920t=y
> +BR2_TOOLCHAIN_EXTERNAL=y
> +BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM=y
> +"""
> +    toolchain_prefix = "arm-none-linux-gnueabi"
> +
> +    def test_run(self):
> +        TestExternalToolchain.test_run(self)

... and changing all calls to something like this:
        self.common_check()

> +
> +        # Check the architecture variant
[snip]

Regards,
Ricardo

  reply	other threads:[~2017-03-05 21:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-05 15:03 [Buildroot] [PATCH v2 0/5] Runtime testing infrastructure Thomas Petazzoni
2017-03-05 15:03 ` [Buildroot] [PATCH v2 1/5] support/testing: core " Thomas Petazzoni
2017-03-05 15:03 ` [Buildroot] [PATCH v2 2/5] support/testing: add core tests Thomas Petazzoni
2017-03-05 16:00   ` Yann E. MORIN
2017-03-05 17:54     ` Thomas Petazzoni
2017-03-05 15:03 ` [Buildroot] [PATCH v2 3/5] support/testing: add fs tests Thomas Petazzoni
2017-03-05 15:03 ` [Buildroot] [PATCH v2 4/5] support/testing: add package tests Thomas Petazzoni
2017-03-05 16:27   ` Yann E. MORIN
2017-03-05 17:55     ` Thomas Petazzoni
2017-03-05 15:03 ` [Buildroot] [PATCH v2 5/5] support/testing: add toolchain tests Thomas Petazzoni
2017-03-05 21:30   ` Ricardo Martincoski [this message]
2017-03-05 21:36     ` Thomas Petazzoni
2017-03-06  0:41       ` Ricardo Martincoski

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=58bc8359882ea_6832a0cfd06544b@ultri3.mail \
    --to=ricardo.martincoski@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.