-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathrun_tests
More file actions
executable file
·35 lines (30 loc) · 771 Bytes
/
run_tests
File metadata and controls
executable file
·35 lines (30 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
DIR=$(dirname $0)
if [[ -z "$DIR" ]]; then
DIR="."
fi
TOTAL=0
FAILED=0
SUCCESSFUL=0
for t in $(find $DIR/tests/ -type f -name "test-*" | sort); do
echo -n "running $(basename $t) ... "
$t;
if [[ $? != 0 ]]; then
echo "FAILED ###"
FAILED=$(($FAILED + 1))
FAILED_TESTS="$FAILED_TESTS\n\t$(basename $t)"
else
echo "ok"
SUCCESSFUL=$(($SUCCESSFUL + 1))
fi
TOTAL=$(($TOTAL + 1))
done
if [[ "$FAILED" -gt 0 ]]; then
echo "====================================================="
echo -n "failed tests:"
echo -e $FAILED_TESTS
echo -n -e "\a"
fi
echo "====================================================="
echo "total: $TOTAL failed: $FAILED successful: $SUCCESSFUL"
exit $FAILED