[Concept,14/15] test/run: Tidy up the tool path for binman

Message ID 20250819193918.874215-15-sjg@u-boot.org
State New
Headers
Series test: Improvements to make check et al |

Commit Message

Simon Glass Aug. 19, 2025, 7:39 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

Binman needs access to tools like mkimage and cbfstool to run all the
tests. Set up the TOOLS_DIR earlier and allow use of a TOOLS_DIR
environment variable to specify where the tools are. This can be used
from CI, for example.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 test/run | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
  

Patch

diff --git a/test/run b/test/run
index 1f60fc8fb61..f6d39989fb8 100755
--- a/test/run
+++ b/test/run
@@ -90,9 +90,12 @@  fi
 DTC_DIR=$(pwd)/build-sandbox_spl/scripts/dtc
 export PYTHONPATH=${DTC_DIR}/pylibfdt
 export DTC=${DTC_DIR}/dtc
-TOOLS_DIR=build-sandbox_spl/tools
+TOOLS_DIR=$(pwd)/build-sandbox_spl/tools
 
-run_test "binman" ./tools/binman/binman --toolpath ${TOOLS_DIR} test
+# TOOLPATH may be defined to provide mkimage, cbfstool, etc.
+export PATH=$PATH:${TOOLS_DIR}
+
+run_test "binman" ./tools/binman/binman ${TOOLPATH} test
 run_test "patman" ./tools/patman/patman test
 run_test "u_boot_pylib" ./tools/u_boot_pylib/u_boot_pylib
 
@@ -106,8 +109,7 @@  run_test "dtoc" ./tools/dtoc/dtoc -t
 
 # Code-coverage tests cannot run in parallel, so skip them in that case
 if [ -z "${para}" ]; then
-	export PATH=$PATH:${TOOLS_DIR}
-	run_test "binman code coverage" ./tools/binman/binman test -T
+	run_test "binman code coverage" ./tools/binman/binman ${TOOLPATH} test -T
 	run_test "dtoc code coverage" ./tools/dtoc/dtoc -T
 	run_test "fdt code coverage" ./tools/dtoc/test_fdt -T
 fi