Luna/tools/run-tests.sh
apio 0d924f89d3
All checks were successful
continuous-integration/drone/push Build is passing
tools: Avoid making the tests interfere with the main build directory
2023-07-21 14:49:59 +02:00

45 lines
729 B
Bash
Executable File

#!/usr/bin/env bash
set -e
export LUNA_BUILD_PREFIX="tests-"
source $(dirname $0)/env.sh
cd $LUNA_ROOT
tools/setup.sh
tools/full-clean.sh
tools/install-headers.sh
cmake -S . -B $LUNA_BUILD_DIR -G "$LUNA_CMAKE_GENERATOR_NAME" -DBUILD_TESTS=ON
cmake --build $LUNA_BUILD_DIR
rm base/etc/init/*
printf "Name=test\nCommand=/bin/run-tests\nWait=true\nStandardOutput=/dev/uart0\nStandardError=/dev/uart0\n" > base/etc/init/00-tests
tools/make-iso.sh
set +e
tools/fast-run.sh -device isa-debug-exit,iobase=0xf4,iosize=0x04 -display none
EXIT_CODE=$?
set -e
rm base/etc/init/00-tests
git checkout base/etc/init/
if [ "$EXIT_CODE" -eq "3" ]
then
exit 0
fi
if [ "$EXIT_CODE" -eq "5" ]
then
exit 1
fi
exit $EXIT_CODE