dtoc: Bring in the libfdt module automatically
authorSimon Glass <sjg@chromium.org>
Tue, 23 Nov 2021 18:03:38 +0000 (11:03 -0700)
committerSimon Glass <sjg@chromium.org>
Thu, 2 Dec 2021 16:15:43 +0000 (09:15 -0700)
Use the same technique as with binman to load this module from the U-Boot
tree if available. This allows running tests without having to specify
the PYTHONPATH variable.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/dtoc/test_fdt.py

index d104f3c..d86fc86 100755 (executable)
@@ -16,6 +16,12 @@ import unittest
 our_path = os.path.dirname(os.path.realpath(__file__))
 sys.path.insert(1, os.path.join(our_path, '..'))
 
+# Bring in the libfdt module
+sys.path.insert(2, 'scripts/dtc/pylibfdt')
+sys.path.insert(2, os.path.join(our_path, '../../scripts/dtc/pylibfdt'))
+sys.path.insert(2, os.path.join(our_path,
+                '../../build-sandbox_spl/scripts/dtc/pylibfdt'))
+
 from dtoc import fdt
 from dtoc import fdt_util
 from dtoc.fdt_util import fdt32_to_cpu