Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/3] support/testing: rename check_broken_links to has_broken_links
@ 2017-05-16 20:45 Luca Ceresoli
  2017-05-16 20:45 ` [Buildroot] [PATCH 2/3] support/testing: document get_elf_prog_interpreter Luca Ceresoli
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Luca Ceresoli @ 2017-05-16 20:45 UTC (permalink / raw)
  To: buildroot

has_broken_links makes it self-explanatory that this is a predicate
function, and that the return value tells whether there _are_ broken
links, not the opposite.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 support/testing/tests/toolchain/test_external.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/support/testing/tests/toolchain/test_external.py b/support/testing/tests/toolchain/test_external.py
index 1fbf81f8d356..0b15d489db8f 100644
--- a/support/testing/tests/toolchain/test_external.py
+++ b/support/testing/tests/toolchain/test_external.py
@@ -7,7 +7,7 @@ BR2_TARGET_ROOTFS_CPIO=y
 # BR2_TARGET_ROOTFS_TAR is not set
 """
 
-def check_broken_links(path):
+def has_broken_links(path):
     for root, dirs, files in os.walk(path):
         for f in files:
             fpath = os.path.join(root, f)
@@ -20,9 +20,9 @@ class TestExternalToolchain(infra.basetest.BRTest):
         # Check for broken symlinks
         for d in ["lib", "usr/lib"]:
             path = os.path.join(self.builddir, "staging", d)
-            self.assertFalse(check_broken_links(path))
+            self.assertFalse(has_broken_links(path))
             path = os.path.join(self.builddir, "target", d)
-            self.assertFalse(check_broken_links(path))
+            self.assertFalse(has_broken_links(path))
 
         interp = infra.get_elf_prog_interpreter(self.builddir,
                                                 self.toolchain_prefix,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 2/3] support/testing: document get_elf_prog_interpreter
  2017-05-16 20:45 [Buildroot] [PATCH 1/3] support/testing: rename check_broken_links to has_broken_links Luca Ceresoli
@ 2017-05-16 20:45 ` Luca Ceresoli
  2017-05-16 20:45 ` [Buildroot] [PATCH 3/3] support/testing/run-tests: help: put the one-letter form before the long form Luca Ceresoli
  2017-05-17 19:57 ` [Buildroot] [PATCH 1/3] support/testing: rename check_broken_links to has_broken_links Thomas Petazzoni
  2 siblings, 0 replies; 4+ messages in thread
From: Luca Ceresoli @ 2017-05-16 20:45 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 support/testing/infra/__init__.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/support/testing/infra/__init__.py b/support/testing/infra/__init__.py
index c3f645cf99d7..b5634f6f64d7 100644
--- a/support/testing/infra/__init__.py
+++ b/support/testing/infra/__init__.py
@@ -77,6 +77,16 @@ def get_file_arch(builddir, prefix, fpath):
     return get_elf_arch_tag(builddir, prefix, fpath, "Tag_CPU_arch")
 
 def get_elf_prog_interpreter(builddir, prefix, fpath):
+    """
+    Runs the cross readelf on 'fpath' to extract the program interpreter
+    name and returns it.
+    Example:
+    >>> get_elf_prog_interpreter('br-tests/TestExternalToolchainLinaroArm',
+                                 'arm-linux-gnueabihf',
+                                 'bin/busybox')
+    /lib/ld-linux-armhf.so.3
+    >>>
+    """
     cmd = ["host/usr/bin/{}-readelf".format(prefix),
            "-l", os.path.join("target", fpath)]
     out = subprocess.check_output(cmd, cwd=builddir, env={"LANG": "C"})
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 3/3] support/testing/run-tests: help: put the one-letter form before the long form
  2017-05-16 20:45 [Buildroot] [PATCH 1/3] support/testing: rename check_broken_links to has_broken_links Luca Ceresoli
  2017-05-16 20:45 ` [Buildroot] [PATCH 2/3] support/testing: document get_elf_prog_interpreter Luca Ceresoli
@ 2017-05-16 20:45 ` Luca Ceresoli
  2017-05-17 19:57 ` [Buildroot] [PATCH 1/3] support/testing: rename check_broken_links to has_broken_links Thomas Petazzoni
  2 siblings, 0 replies; 4+ messages in thread
From: Luca Ceresoli @ 2017-05-16 20:45 UTC (permalink / raw)
  To: buildroot

This is what the manpages usually do, and what Python does with the
automatically-added -h/--help parameter:

Before the change:
  $ ./support/testing/run-tests
    [...]
  optional arguments:
    -h, --help            show this help message and exit
    --list, -l            list of available test cases
    --all, -a             execute all test cases

After the change:
  $ ./support/testing/run-tests
    [...]
  optional arguments:
    -h, --help            show this help message and exit
    -l, --list            list of available test cases
    -a, --all             execute all test cases

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 support/testing/run-tests | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/support/testing/run-tests b/support/testing/run-tests
index 339bb66efa34..07dad0d8b938 100755
--- a/support/testing/run-tests
+++ b/support/testing/run-tests
@@ -10,17 +10,17 @@ def main():
     parser = argparse.ArgumentParser(description='Run Buildroot tests')
     parser.add_argument('testname', nargs='*',
                         help='list of test cases to execute')
-    parser.add_argument('--list', '-l', action='store_true',
+    parser.add_argument('-l', '--list', action='store_true',
                         help='list of available test cases')
-    parser.add_argument('--all', '-a', action='store_true',
+    parser.add_argument('-a', '--all', action='store_true',
                         help='execute all test cases')
-    parser.add_argument('--stdout', '-s', action='store_true',
+    parser.add_argument('-s', '--stdout', action='store_true',
                         help='log everything to stdout')
-    parser.add_argument('--output', '-o',
+    parser.add_argument('-o', '--output',
                         help='output directory')
-    parser.add_argument('--download', '-d',
+    parser.add_argument('-d', '--download',
                         help='download directory')
-    parser.add_argument('--keep', '-k',
+    parser.add_argument('-k', '--keep',
                         help='keep build directories',
                         action='store_true')
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/3] support/testing: rename check_broken_links to has_broken_links
  2017-05-16 20:45 [Buildroot] [PATCH 1/3] support/testing: rename check_broken_links to has_broken_links Luca Ceresoli
  2017-05-16 20:45 ` [Buildroot] [PATCH 2/3] support/testing: document get_elf_prog_interpreter Luca Ceresoli
  2017-05-16 20:45 ` [Buildroot] [PATCH 3/3] support/testing/run-tests: help: put the one-letter form before the long form Luca Ceresoli
@ 2017-05-17 19:57 ` Thomas Petazzoni
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2017-05-17 19:57 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 16 May 2017 22:45:29 +0200, Luca Ceresoli wrote:
> has_broken_links makes it self-explanatory that this is a predicate
> function, and that the return value tells whether there _are_ broken
> links, not the opposite.
> 
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
> ---
>  support/testing/tests/toolchain/test_external.py | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Series applied to master. Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-05-17 19:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-16 20:45 [Buildroot] [PATCH 1/3] support/testing: rename check_broken_links to has_broken_links Luca Ceresoli
2017-05-16 20:45 ` [Buildroot] [PATCH 2/3] support/testing: document get_elf_prog_interpreter Luca Ceresoli
2017-05-16 20:45 ` [Buildroot] [PATCH 3/3] support/testing/run-tests: help: put the one-letter form before the long form Luca Ceresoli
2017-05-17 19:57 ` [Buildroot] [PATCH 1/3] support/testing: rename check_broken_links to has_broken_links Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox