test: Fixes to allow tests to run on a machine with old dtc
cover test: Fixes to allow tests to run on a machine with old dtc
These two patches should fix the problem with u-boot-dm/master where the binman tests fail.
Simon Glass (2):
dtoc: Allow DTC environment variable to provide path to dtc
test: Set the DTC environment variable
test/run | 8 +++++--- tools/binman/README | 4 ++++ tools/dtoc/fdt_util.py | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-)
Signature · 1 line
2.15.1.620.gb9897f4670-goog
PATCH 1/2 dtoc: Allow DTC environment variable to provide path to dtc
The system device-tree compiler may not be new enough to run the tests we use in U-Boot (e.g. with binman). Allow use of a DTC environment variable to point to the correct dtc. If not defined, the dtc on the default PATH is used.
---
tools/binman/README | 4 ++++ tools/dtoc/fdt_util.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-)
tools/binman/README +4 -0
@@ -536,6 +536,10 @@ entry contents. Most of the time such essoteric behaviour is not needed, but it can be essential for complex images. +If you need to specify a particular device-tree compiler to use, you can define +the DTC environment variable. This can be useful when the system dtc is too +old. + History / Credits -----------------
tools/dtoc/fdt_util.py +2 -1
@@ -79,7 +79,8 @@ def EnsureCompiled(fname): '-W', 'no-unit_address_vs_reg'] args.extend(search_list) args.append(dts_input) - command.Run('dtc', *args) + dtc = os.environ.get('DTC') or 'dtc' + command.Run(dtc, *args) return dtb_output def GetInt(node, propname, default=None):
Signature · 1 line
2.15.1.620.gb9897f4670-goog
PATCH 1/2 dtoc: Allow DTC environment variable to provide path to dtc
Quoted 11 lines · Simon Glass
The system device-tree compiler may not be new enough to run the tests we use in U-Boot (e.g. with binman). Allow use of a DTC environment variable to point to the correct dtc. If not defined, the dtc on the default PATH is used.
Signed-off-by Simon Glass <[email protected]>---
tools/binman/README | 4 ++++ tools/dtoc/fdt_util.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-)
Applied to u-boot-dm (and now in mainline). Sorry for the delay.
PATCH 2/2 test: Set the DTC environment variable
In reply to Simon GlassSet this to our own device-tree compiler since we know it is new enough to run the tests.
---
test/run | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
test/run +5 -3
@@ -17,17 +17,19 @@ run_test ./test/py/test.py --bd sandbox_spl --build -k \ # Run tests for the flat DT version of sandbox ./test/py/test.py --bd sandbox_flattree --build -PYTHONPATH=build-sandbox_spl/scripts/dtc/pylibfdt run_test \ +DTC_DIR=build-sandbox_spl/scripts/dtc + +PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \ ./tools/binman/binman -t run_test ./tools/patman/patman --test run_test ./tools/buildman/buildman -t -PYTHONPATH=build-sandbox_spl/scripts/dtc/pylibfdt run_test ./tools/dtoc/dtoc -t +PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test ./tools/dtoc/dtoc -t # This needs you to set up Python test coverage tools. # To enable Python test coverage on Debian-type distributions (e.g. Ubuntu): # $ sudo apt-get install python-pip python-pytest # $ sudo pip install coverage -PYTHONPATH=build-sandbox_spl/scripts/dtc/pylibfdt run_test \ +PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \ ./tools/binman/binman -T if [ $result == 0 ]; then
Signature · 1 line
2.15.1.620.gb9897f4670-goog
PATCH 2/2 test: Set the DTC environment variable
Quoted 9 lines · Simon Glass
Set this to our own device-tree compiler since we know it is new enough to run the tests.
Signed-off-by Simon Glass <[email protected]>---
test/run | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
Applied to u-boot-dm (and now in mainline). Sorry for the delay.