test_build.sh: Don't try to run cross-compiled programs
Check the commonly used ${CROSS_COMPILE} variable. If set, return
early and don't run the built binaries.
Change-Id: I14aad3562eb358b509ea9c7846a6cf5913e302f2
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/141
diff --git a/test_build.sh b/test_build.sh
index 245430c..ecdcace 100755
--- a/test_build.sh
+++ b/test_build.sh
@@ -11,6 +11,10 @@
test_prog() {
prog="$1"
+ if [ "${CROSS_COMPILE}" ]; then
+ return 0
+ fi
+
"${prog}" -p dummy:emulate=M25P10.RES,image="${TEMP_DIR}/image" -w "${TEMP_DIR}/rand"
"${prog}" -p dummy:emulate=M25P10.RES,image="${TEMP_DIR}/image" -r "${TEMP_DIR}/bak"
cmp "${TEMP_DIR}/rand" "${TEMP_DIR}/bak"