# is fixed, if this exception still exists, it will then be logged as
# part of the test's stdout.
import traceback
- print 'Exception occurred while logging runtest status:'
+ print('Exception occurred while logging runtest status:')
traceback.print_exc()
# FIXME: Can we force a test failure here?
# Wrapper script to invoke pytest with the directory name that contains the
# U-Boot tests.
+from __future__ import print_function
+
import os
import os.path
import sys
traceback.print_exc()
# Hint to the user that they likely simply haven't installed the required
# dependencies.
- print >>sys.stderr, '''
+ print('''
exec(py.test) failed; perhaps you are missing some dependencies?
-See test/py/README.md for the list.'''
+See test/py/README.md for the list.''', file=sys.stderr)
sys.exit(1)
#
# Sanity check of the FIT handling in U-Boot
+from __future__ import print_function
+
import os
import pytest
import struct
src = make_fname('u-boot.dts')
dtb = make_fname('u-boot.dtb')
with open(src, 'w') as fd:
- print >> fd, base_fdt
+ print(base_fdt, file=fd)
util.run_and_log(cons, ['dtc', src, '-O', 'dtb', '-o', dtb])
return dtb
"""
its = make_fname('test.its')
with open(its, 'w') as fd:
- print >> fd, base_its % params
+ print(base_its % params, file=fd)
return its
def make_fit(mkimage, params):
its = make_its(params)
util.run_and_log(cons, [mkimage, '-f', its, fit])
with open(make_fname('u-boot.dts'), 'w') as fd:
- print >> fd, base_fdt
+ print(base_fdt, file=fd)
return fit
def make_kernel(filename, text):
for i in range(100):
data += 'this %s %d is unlikely to boot\n' % (text, i)
with open(fname, 'w') as fd:
- print >> fd, data
+ print(data, file=fd)
return fname
def make_ramdisk(filename, text):
for i in range(100):
data += '%s %d was seldom used in the middle ages\n' % (text, i)
with open(fname, 'w') as fd:
- print >> fd, data
+ print(data, file=fd)
return fname
def find_matching(text, match):