test: Indent test-fit.py to match the next patch

We plan to rewrite this script to use the pytest framework. To make it
easier to review the changes, indent the code to match the next patch.
This gets all of the whitespace changes out of the way.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2017-08-05 10:28:39 -06:00 committed by Tom Rini
parent 0459bc30b6
commit bde671237f

View File

@ -134,11 +134,11 @@ sb save hostfs 0 %(loadables2_addr)x %(loadables2_out)s %(loadables2_size)x
reset reset
''' '''
def debug_stdout(stdout): def debug_stdout(stdout):
if DEBUG: if DEBUG:
print stdout print stdout
def make_fname(leaf): def make_fname(leaf):
"""Make a temporary filename """Make a temporary filename
Args: Args:
@ -150,7 +150,7 @@ def make_fname(leaf):
return os.path.join(base_dir, leaf) return os.path.join(base_dir, leaf)
def filesize(fname): def filesize(fname):
"""Get the size of a file """Get the size of a file
Args: Args:
@ -160,7 +160,7 @@ def filesize(fname):
""" """
return os.stat(fname).st_size return os.stat(fname).st_size
def read_file(fname): def read_file(fname):
"""Read the contents of a file """Read the contents of a file
Args: Args:
@ -171,7 +171,7 @@ def read_file(fname):
with open(fname, 'r') as fd: with open(fname, 'r') as fd:
return fd.read() return fd.read()
def make_dtb(): def make_dtb():
"""Make a sample .dts file and compile it to a .dtb """Make a sample .dts file and compile it to a .dtb
Returns: Returns:
@ -184,7 +184,7 @@ def make_dtb():
command.Output('dtc', src, '-O', 'dtb', '-o', dtb) command.Output('dtc', src, '-O', 'dtb', '-o', dtb)
return dtb return dtb
def make_its(params): def make_its(params):
"""Make a sample .its file with parameters embedded """Make a sample .its file with parameters embedded
Args: Args:
@ -197,7 +197,7 @@ def make_its(params):
print >>fd, base_its % params print >>fd, base_its % params
return its return its
def make_fit(mkimage, params): def make_fit(mkimage, params):
"""Make a sample .fit file ready for loading """Make a sample .fit file ready for loading
This creates a .its script with the selected parameters and uses mkimage to This creates a .its script with the selected parameters and uses mkimage to
@ -216,7 +216,7 @@ def make_fit(mkimage, params):
print >>fd, base_fdt print >>fd, base_fdt
return fit return fit
def make_kernel(filename, text): def make_kernel(filename, text):
"""Make a sample kernel with test data """Make a sample kernel with test data
Args: Args:
@ -232,7 +232,7 @@ def make_kernel(filename, text):
print >>fd, data print >>fd, data
return fname return fname
def make_ramdisk(filename, text): def make_ramdisk(filename, text):
"""Make a sample ramdisk with test data """Make a sample ramdisk with test data
Returns: Returns:
@ -246,7 +246,7 @@ def make_ramdisk(filename, text):
print >>fd, data print >>fd, data
return fname return fname
def find_matching(text, match): def find_matching(text, match):
"""Find a match in a line of text, and return the unmatched line portion """Find a match in a line of text, and return the unmatched line portion
This is used to extract a part of a line from some text. The match string This is used to extract a part of a line from some text. The match string
@ -285,7 +285,7 @@ def find_matching(text, match):
print text print text
raise ValueError('Test aborted') raise ValueError('Test aborted')
def set_test(name): def set_test(name):
"""Set the name of the current test and print a message """Set the name of the current test and print a message
Args: Args:
@ -296,7 +296,7 @@ def set_test(name):
test_name = name test_name = name
print name print name
def fail(msg, stdout): def fail(msg, stdout):
"""Raise an error with a helpful failure message """Raise an error with a helpful failure message
Args: Args:
@ -305,7 +305,7 @@ def fail(msg, stdout):
print stdout print stdout
raise ValueError("Test '%s' failed: %s" % (test_name, msg)) raise ValueError("Test '%s' failed: %s" % (test_name, msg))
def run_fit_test(mkimage, u_boot): def run_fit_test(mkimage, u_boot):
"""Basic sanity check of FIT loading in U-Boot """Basic sanity check of FIT loading in U-Boot
TODO: Almost everything: TODO: Almost everything: