aboutsummaryrefslogtreecommitdiff
path: root/support/testing/infra
diff options
context:
space:
mode:
Diffstat (limited to 'support/testing/infra')
-rw-r--r--support/testing/infra/__init__.py7
-rw-r--r--support/testing/infra/basetest.py2
-rw-r--r--support/testing/infra/builder.py1
3 files changed, 9 insertions, 1 deletions
diff --git a/support/testing/infra/__init__.py b/support/testing/infra/__init__.py
index 27e2a2708d..b03e891771 100644
--- a/support/testing/infra/__init__.py
+++ b/support/testing/infra/__init__.py
@@ -1,4 +1,3 @@
-import contextlib
import os
import re
import sys
@@ -8,6 +7,7 @@ from urllib2 import urlopen, HTTPError, URLError
ARTIFACTS_URL = "http://autobuild.buildroot.net/artefacts/"
+
def open_log_file(builddir, stage, logtofile=True):
"""
Open a file for logging and return its handler.
@@ -20,9 +20,11 @@ def open_log_file(builddir, stage, logtofile=True):
fhandle = sys.stdout
return fhandle
+
def filepath(relpath):
return os.path.join(os.getcwd(), "support/testing", relpath)
+
def download(dldir, filename):
finalpath = os.path.join(dldir, filename)
if os.path.exists(finalpath):
@@ -46,6 +48,7 @@ def download(dldir, filename):
os.rename(tmpfile, finalpath)
return finalpath
+
def get_elf_arch_tag(builddir, prefix, fpath, tag):
"""
Runs the cross readelf on 'fpath', then extracts the value of tag 'tag'.
@@ -66,9 +69,11 @@ def get_elf_arch_tag(builddir, prefix, fpath, tag):
return m.group(1)
return None
+
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
diff --git a/support/testing/infra/basetest.py b/support/testing/infra/basetest.py
index 52dad7c43d..5210f0ae58 100644
--- a/support/testing/infra/basetest.py
+++ b/support/testing/infra/basetest.py
@@ -28,6 +28,7 @@ MINIMAL_CONFIG = \
# BR2_TARGET_ROOTFS_TAR is not set
"""
+
class BRTest(unittest.TestCase):
config = None
downloaddir = None
@@ -47,6 +48,7 @@ class BRTest(unittest.TestCase):
def show_msg(self, msg):
print "{} {:40s} {}".format(datetime.datetime.now().strftime("%H:%M:%S"),
self.testname, msg)
+
def setUp(self):
self.show_msg("Starting")
self.b = Builder(self.config, self.builddir, self.logtofile)
diff --git a/support/testing/infra/builder.py b/support/testing/infra/builder.py
index ef66b86113..7512339ae1 100644
--- a/support/testing/infra/builder.py
+++ b/support/testing/infra/builder.py
@@ -4,6 +4,7 @@ import subprocess
import infra
+
class Builder(object):
def __init__(self, config, builddir, logtofile):
self.config = '\n'.join([line.lstrip() for line in