Files
qdl/tests/run_tests.sh
Igor Opaniuk 6c0fbcce08 tests: add initial test set
Add tests make target and a simple test that executes qdl in dry-run mode
for a synthetic reference FLAT build with VIP table generation.

The FLAT build contains:
- patch0.xml
- patch1.xml
- rawprogram0.xml
- rawprogram1.xml

All binaries that these XML files point to are filled with zeros, generated
during github action  execution.

Tests ensures that the table is generated correctly by comparing
calculated and expected SHA256 hashes of DigestToSign.bin file.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2025-06-20 11:51:49 +02:00

35 lines
674 B
Bash
Executable File

#!/bin/bash
# SPDX-License-Identifier: BSD-3-Clause
set -e
SCRIPT_PATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
FLAT_BUILD_PATH=$SCRIPT_PATH/data
echo "####### Generate a FLAT build"
$FLAT_BUILD_PATH/generate_flat_build.sh
echo "####### Run QDL tests"
cd $SCRIPT_PATH
for t in test_*.sh; do
echo "###### Run $t"
bash $t
if [ $? -eq 0 ]; then
echo "####### Test $t: OK"
else
echo "####### Test $t: FAIL"
failed=1
fi
done
echo "####### Housekeeping"
rm -f ${FLAT_BUILD_PATH}/*.bin ${FLAT_BUILD_PATH}/*.img
rm -f ${FLAT_BUILD_PATH}/*.elf
if [ "$failed" == "1" ]; then
echo "####### Some test failed"
exit 1
fi
echo "####### All tests passed"