support/testing: document get_elf_prog_interpreter
authorLuca Ceresoli <luca@lucaceresoli.net>
Tue, 16 May 2017 20:45:30 +0000 (22:45 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 17 May 2017 19:56:38 +0000 (21:56 +0200)
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
support/testing/infra/__init__.py

index c3f645cf99d7461cd937b8b5cdb8a9aea29dac23..b5634f6f64d7c1db598e446ee49a8c2e142fcc25 100644 (file)
@@ -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"})