-#!/usr/bin/env python
+#!/usr/bin/env python2
# Copyright (c) 2016 Google, Inc
# Written by Simon Glass <sjg@chromium.org>
# Bring in the patman and dtoc libraries
our_path = os.path.dirname(os.path.realpath(__file__))
-sys.path.append(os.path.join(our_path, '../patman'))
-sys.path.append(os.path.join(our_path, '../dtoc'))
+for dirname in ['../patman', '../dtoc', '..']:
+ sys.path.insert(0, os.path.join(our_path, dirname))
+
+# Bring in the libfdt module
+sys.path.insert(0, 'scripts/dtc/pylibfdt')
# Also allow entry-type modules to be brought in from the etype directory.
-sys.path.append(os.path.join(our_path, 'etype'))
+sys.path.insert(0, os.path.join(our_path, 'etype'))
import cmdline
import command
"""Run the functional tests and any embedded doctests"""
import entry_test
import fdt_test
- import func_test
+ import ftest
import test
import doctest
suite.run(result)
sys.argv = [sys.argv[0]]
- for module in (func_test.TestFunctional, fdt_test.TestFdt,
+ for module in (ftest.TestFunctional, fdt_test.TestFdt,
entry_test.TestEntry):
suite = unittest.TestLoader().loadTestsFromTestCase(module)
suite.run(result)
def RunTestCoverage():
"""Run the tests and check that we get 100% coverage"""
# This uses the build output from sandbox_spl to get _libfdt.so
- cmd = ('PYTHONPATH=%s/sandbox_spl/tools coverage run '
+ cmd = ('PYTHONPATH=$PYTHONPATH:%s/sandbox_spl/tools coverage run '
'--include "tools/binman/*.py" --omit "*test*,*binman.py" '
'tools/binman/binman.py -t' % options.build_dir)
os.system(cmd)