clixon/test/sum.sh
Olof Hagsand d64d433468 * Changed base OS in clixon-system container to Alpine
* Moved datastore/text/ code to datastore/ since there is only one type of datastore.
* Added "magic script line" to test script for sourced and scriped exits
2019-02-16 17:45:39 +01:00

29 lines
560 B
Bash
Executable file

#!/bin/bash
# Run, eg as:
# ./sum.sh # to run all tests and print
if [ $# -gt 0 ]; then
echo "usage: $0 # pipe to dev/null and continue on error"
exit -1
fi
err=0
for testfile in test*.sh; do # For lib.sh the variable must be called testfile
echo "Running $testfile"
./$testfile > /dev/null 2>&1
errcode=$?
if [ $errcode -ne 0 ]; then
err=1
echo -e "\e[31mError in $testfile errcode=$errcode"
echo -ne "\e[0m"
fi
done
if [ $err -eq 0 ]; then
echo OK
else
echo -e "\e[31mError"
echo -ne "\e[0m"
exit -1
fi