* 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
29 lines
560 B
Bash
Executable file
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
|
|
|
|
|